Skip to content

v2.3.0 - Connection Pooling, Cursor Pagination & N+1 Detection

Choose a tag to compare

@AdrianCurtin AdrianCurtin released this 09 Jan 02:14
· 70 commits to master since this release

Connection Pooling, Cursor Pagination & N+1 Detection

This release adds HTTP connection pooling, cursor-based pagination, N+1 query detection, and thread safety improvements.

HTTP Connection Pooling (Default)

Parse Stack now uses HTTP persistent connections by default for improved performance.

# Default: connection pooling enabled
Parse.setup(
  server_url: "https://your-parse-server.com/parse",
  application_id: "your-app-id",
  api_key: "your-api-key"
)

# Custom configuration
Parse.setup(
  ...,
  connection_pooling: {
    pool_size: 5,
    idle_timeout: 60,
    keep_alive: 60
  }
)

# Disable if needed
Parse.setup(..., connection_pooling: false)

Cursor-Based Pagination

New Parse::Cursor for efficiently traversing large datasets:

# Iterate over pages
cursor = Song.cursor(limit: 100, order: :created_at.desc)
cursor.each_page { |page| process(page) }

# Iterate over items
Song.cursor(limit: 50).each { |song| puts song.title }

# Manual control
cursor = User.cursor(limit: 100)
first_page = cursor.next_page
second_page = cursor.next_page
cursor.reset!

# Resumable cursors
state = cursor.serialize
# Later...
cursor = Parse::Cursor.deserialize(state)

N+1 Query Detection

New Parse::NPlusOneDetector to detect N+1 query patterns:

# Enable warnings
Parse.warn_on_n_plus_one = true
# Or use mode API
Parse.n_plus_one_mode = :warn

# Strict mode for CI
Parse.n_plus_one_mode = :raise

# Fix with includes
songs = Song.all(limit: 100, includes: [:artist])

Available modes: :ignore (default), :warn, :raise

Thread Safety & Marshaling Improvements

  • IMPROVED: Thread safety improvements in Parse::Object for concurrent access
  • IMPROVED: Better marshaling support for Parse objects

Bug Fixes

  • IMPROVED: Aggregation pipeline correctly handles __aggregation_pipeline stages
  • IMPROVED: Better whitespace formatting in SortableGroupBy pipeline generation

Author: Adrian Curtin
Date: November 2025