Published OnNovember 25, 2025November 25, 2025

Ditto 4.13 Roundup: Windows Support, Optimized Queries, and Smarter Reconnection

Ditto 4.13 delivers significant improvements across query performance, platform coverage through expanded Flutter support, and sync efficiency with optimized reconnection handling for peers returning online.

Ditto 4.13 delivers key improvements to query performance, platform coverage, and sync efficiency. This release expands Flutter support, introduces multiple changes to how you can utilize and understand queries, and optimizes reconnection handling for peers coming back online.

Flutter Expanded Support Brings Windows

On the platform front, Windows joins the growing roster of desktop targets alongside the recently added Linux and macOS support. No code changes are required—simply target Windows as a build platform and your existing Ditto integration works seamlessly with all features, including sync, queries, and attachments. The Flutter Quickstart has been updated to demonstrate Windows support, providing a ready-to-run example for developers looking to deploy Ditto-powered applications on Windows desktops.

Enhance Query Performance with Multiple Indexes

Ditto 4.13 builds on the single-field index foundation introduced in 4.12 by adding intelligent index utilization for complex query predicates. The query optimizer can now leverage multiple indexes simultaneously when evaluating queries with OR, IN, and AND operators. Through union scans, queries with OR conditions combine results from separate indexes—for example, WHERE status = 'active' OR priority = 'high' uses both the status and priority indexes. Intersect scans handle AND conditions by narrowing results across multiple indexes, such as WHERE category = 'urgent' AND assignee = 'user123'. These optimizations deliver dramatic performance improvements for local queries and observer registrations, especially on large datasets where multi-condition filters would otherwise require full collection scans. For complete details on indexing strategies and syntax, see the documentation.

Troubleshooting Index Usage with EXPLAIN

When optimizing query performance, understanding which indexes are actually being used is critical. The EXPLAIN keyword provides insight into the query execution plan, showing you precisely how Ditto processes your query and which indexes are leveraged. Simply prefix your query with EXPLAIN to see the query plan breakdown.

EXPLAIN SELECT * FROM MOVIES where title LIKE 'Mind%'
{
  ...
  {
    "#operator": "indexScan",
    "collection": "movies",
    "datasource": "default",
    "desc": {
      "index": "movies_title_idx",
      "spans": [
        {
          "index_key": {
            "direction": "asc",
            "include_missing": true,
            "key": [
              "title"
            ]
          },
          "range": {
            "high": {
              "included": false,
              "value": "Mine"
            },
            "low": {
              "included": true,
              "value": "Mind"
            }
          }
        }
      ]
    }
  },
  ...
}

If you need to override the optimizer's index selection or explicitly force the use of multiple indexes, you can use the USE DIRECTIVES syntax. For example, to ensure a query uses both title and rating indexes:

SELECT *
FROM movies
USE DIRECTIVES '{"#index":["movies_title_idx", "movies_rated_idx"]}'
WHERE title LIKE 'Mind%' AND (rated = "PG" OR rated = "G"). 

This gives you fine-grained control over index utilization when debugging performance issues or when you have domain-specific knowledge about your data distribution that the optimizer can't infer.

Offline Reconnection Sync Performance Improvements

Ditto 4.13 also introduces intelligent session resync detection. This significantly optimizes reconnection scenarios between peers that have accumulated offline changes. When two previously synced peers reconnect after an extended disconnection, the sync engine now automatically determines whether a full session resync is more efficient than transmitting incremental updates.

Under the hood, the key addition is backlog-based detection: the sync engine tracks the size of pending changes (the diff backlog) and triggers session resync when the backlog exceeds a configurable threshold. This prevents the transmission of large, redundant, diff-bearing updates that can bottleneck the sync process. Instead, peers request a fresh session basis, allowing them to resynchronize more efficiently when they've been disconnected for extended periods. This optimization is particularly valuable in scenarios with intermittent connectivity or when devices sync infrequently, ensuring faster convergence and reduced bandwidth consumption during reconnection.

Bug Fixes and Stability Improvements

Beyond the headline features, Ditto 4.13 also includes several bug fixes and stability improvements across multiple platforms, ensuring a more robust experience for all developers. These fixes address edge cases in sync behavior, transport reliability, and platform-specific issues discovered through production deployments. For a complete breakdown of all platform-specific changes and fixes in 4.13, read the full release notes.

Read more
Stories
October 27, 2025
AWS Outage Reminds Us "Smart" Devices Are Only as Smart as Their Architecture
by
Ryan Ratner
When a 15-hour AWS outage turned $2,700 smart beds into saunas and left thousands of restaurants unable to process orders, it exposed the fatal flaw in how we're building edge applications—and why it's time to rethink everything
Product
October 24, 2025
Beyond GOTS: The Case for Commercial Edge Sync in Defense and Public Sector Operations
by
Mustafa Durrani
Leverage the scale, agility, and innovation velocity of the commercial market while maintaining the capability to integrate government-grade security requirements.