Repository navigation
feat: compare with RxDB feature by feature; fix what the comparison found - #2
Merged
Merged
Conversation
…ound Docs: - /guide/vs-rxdb: 300 rows in eight sections, syncom against RxDB 17.6.0, decided from its code at the tag, runs of the published package and all 271 pages of rxdb.info; rendered from docs/comparison-rxdb.json by scripts/comparison.js (a group's `section` becomes its own table), with the benchmark charts filtered to the two (`only`). - docs/comparison.json: RxDB and syncom cells corrected from the deeper read. Fixes found while deciding the syncom column, each with a test: - scopes: an op takes the scope of its record (an update's delta named none); a host refuses a pushed op whose record is outside the peer's grant (applyRemote `bound`, `outOfScope`) - a dialer keeps its own ops until its registered nodes hold them (OpLog.retain, node.acked); UNDELIVERABLE when a host lacks ones the log no longer has - REWOUND: a node restored from an older directory moves past the host's seqs and bootstraps back what it lost - logged is committed: a record file that fails after the append is held in memory and replayed at the next open (UNPERSISTED) - a torn record file is INTEGRITY; entity names the storage answers to are refused; collection methods are scoped to their collection; one() leaves the cursor alone; index keys are canonical; merge()/diff() skip __proto__; ESM named imports of the root work - docs drift: log levels, event tables, gaps, read-only tabs, nested objects Browser budget 41 -> 42 KB (entry 41.9 KB). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A new docs page compares syncom with RxDB 17.6.0 in 300 rows. Deciding the
syncom column from running code turned up 12 bugs in syncom. Each is fixed
here with a regression test, and the cells describe the code after the fixes.
Docs:
/guide/vs-rxdbmodel and writes, queries and reactivity, replication, security and
integrity, extensibility and operations, project and ecosystem. A summary,
the method, an RxDB → syncom concept map, speed charts and "which to
choose" go with it.
17.6.0tag,from runs of the published package (with and without dev-mode), and from
all 271 pages of rxdb.info. Two adversarial passes tried to refute the
strongest claims about each project; none was refuted, and 13 were reworded.
closed source, so those cells follow the docs.
docs/comparison-rxdb.jsonis rendered byscripts/comparison.js, which now renders both matrices. A group'ssectionbecomes its own###table..sc-matrix-duelstyles thetwo-column table.
BenchCompare/BenchFigureacceptonly(library ids), andthe model functions take an optional filter.
docs/comparison.jsongets the RxDB and syncom cells thedeeper reading corrected, and
comparison.md/why.mdno longer claim asyncom host stops a write its validator rejects (it relays it).
Fixes
Security:
update()took the scope of its delta. With a field-basedsync.scopeit was minted global and reached every peer. An op nowtakes the scope of its record as it leaves it, re-read after validation.
Otheroverwrote a
Docrecord. A host'spushnow passes the grant toapplyRemoteasbound.refused:
outOfScopein the result, arefusedevent withreason: 'scope'.Replication:
retention.opsreach the host. A dialing nodekeeps its own ops until every enabled registered node holds them
(
OpLog.retain(keep);ackedin the registry, shown bylistNodes()).A host that lacks ops the log no longer holds is reported once per hello
as
UNDELIVERABLE.node notices the host holds more of its own stream, and reports
REWOUND.It then moves past the host's seqs and bootstraps back what the lost ops
wrote.
Storage:
after the log append rejected the write, though its op stayed logged and
replicated. Now the write stands, the entry is held in memory, the batch is
replayed onto the files at the next open, and
UNPERSISTEDis reported. Apeer's batch is held the same way.
INTEGRITY, not a bareSyntaxError.API:
get/update/delete/recordactonly on its own records (
null/NOT_FOUNDotherwise). An entity namedlike a storage member (
get,close,log…) is refused atopen().cursor.one()no longer leaveslimit(1)on the cursor.Indexed and unique object values match whatever their key order
(canonical
keyOf).merge()/diff()walk own keys only and never take__proto__.import { open } from '@alexify/syncom'works. Bothbarrels spell their exports out so cjs-module-lexer can read them.
Docs drift:
warn, notdebug.beforeApplyskipped.log,refusedand everyerrorcode.sync.op.outOfScope, which never existed, is gone from the table.Behaviour changes
emits
errorwithUNPERSISTED.collection.get(id)of another collection's record returnsnull;update/delete/recordreject withNOT_FOUND.applyRemoteresult and theapply/syncevent payloads gainoutOfScope.UNPERSISTED,REWOUND,UNDELIVERABLE. They are addedto the
SyncomErrorCodeunion and the codes table inapi.md.entry is 41.9 KB. Size figures in the README and docs are re-measured
(
pnpm size,pnpm bench:size,pnpm bench:report).Not covered
cannot reach a host. This is now reported (
UNDELIVERABLE), not silent.pnpm bench:comparewas not re-run; only the size figures are re-measured.Testing
pnpm test: 752 tests, 0 failures.pnpm test:coverage: 99.6 / 96.4 / 99.9 / 99.6 (stmts / branches / funcs /lines).
pnpm test:types,pnpm lint,pnpm format:check,pnpm sizeandpnpm docs:build(no dead links) all pass.tests/sync.retention.test.js(own-op retention,UNDELIVERABLE,REWOUND),tests/package/esm.test.js(ESM namedimports of every entry), plus additions to
sync.scopes,storage.fsi,storage,crdtand the query suite.bug gone.
/guide/vs-rxdbin the browser at desktop and phone widths.🤖 Generated with Claude Code