Skip to content

Caching

Syntra ODBC uses an embedded local cache between your SQL clients and QuickBooks Desktop. This architecture delivers fast analytical query performance while keeping data fresh through incremental sync.

Client (Excel, Power BI, etc.)
Syntra Server (port 5433)
├──▶ Local Cache (fast reads)
├──▶ Live reads (QuickBooks Enterprise)
└──▶ Live QuickBooks fetch (for writes, and fallback reads)
QuickBooks Desktop

When a SELECT query arrives, Syntra chooses the optimal read path:

  1. Local cache: Default. Sub-millisecond reads from the local cache.
  2. Live reads: QuickBooks Enterprise feature. Low-latency reads directly from QuickBooks data. See Live Data Reads (Enterprise).
  3. Live QuickBooks fetch: Used when QB_MAX_STALENESS = 0 or the cache is stale. Requires QuickBooks Desktop to be running. Used for all write operations on every edition.

Rather than re-fetching all data on every poll, Syntra uses incremental sync:

  1. On first startup, a full sync populates the local cache with all QuickBooks data.
  2. On subsequent polls, only records modified since the last sync timestamp are fetched.
  3. Modified records are upserted into the cache, and deleted records are removed.

This approach dramatically reduces the load on QuickBooks and keeps sync times short, typically under a second for small change sets.

Tables are assigned to polling tiers based on how frequently they tend to change. Each tier has a different polling interval:

TierIntervalTypical Tables
Hot60 secondsInvoices, Sales Receipts, Payments, Bills
Warm180 secondsCustomers, Vendors, Items, Employees
Cold900 secondsAccounts, Classes, Terms, Sales Tax Codes
Frozen3600 secondsCompany Info, Preferences, Templates

Syntra monitors change frequency for each table and can promote or demote tables between tiers:

  • A table with frequent changes gets promoted to a faster tier.
  • A table with no recent changes gets demoted to a slower tier.
  • You can override tier assignments in config.toml.

In config.toml:

[cache.tiers]
hot_interval = 60
warm_interval = 180
cold_interval = 900
frozen_interval = 3600
[cache.overrides]
# Force a table to a specific tier
customers = "hot"
company_info = "frozen"

The cache is stored as a single file on disk, typically at:

C:\ProgramData\SyntraODBC\cache.db

The cache file grows as more QuickBooks data is synced. Typical sizes:

  • Small company (< 1,000 transactions): 5–20 MB
  • Medium company (10,000–50,000 transactions): 50–200 MB
  • Large company (100,000+ transactions): 200 MB – 1 GB

The cache persists across Syntra restarts. On startup, Syntra validates the cache integrity and resumes incremental sync from where it left off.

To force a live query that skips the cache:

SET QB_MAX_STALENESS = 0;
SELECT * FROM customers;

To rebuild the entire cache from scratch:

CALL qb_rebuild_all();

See Special Commands for details.

Check when each table was last synced:

SELECT table_name, last_sync, row_count, tier
FROM qb_cache_status
ORDER BY last_sync DESC;