Repository navigation
v6 architecture: twelve decisions to make before the format breaks #308
Replies: 13 comments
DR-2 — Migration from v5: a format guard in 5.3, a read-only v5 reader, a dump format, no in-place upgradeStatus: Proposed · Release: 5.3 (guard, export) + 6.0 (reader, import) · Breaks: nothing for 5.x users Context
Proposal
Alternatives
Open questions
|
DR-3 — 5.3 as a bridge releaseStatus: Proposed · Release: 5.3 · Breaks: nothing (additive) Context — A jump straight from 5.2 to a v6 API means every user rewrites at once, in the same release that changes the file format. Proposal
Alternatives — Breaking everything in 6.0 with no bridge: simpler for us, harder for every user, and it mixes code changes with data migration. Open questions — Is a 5.3 with this much new API acceptable, or should part of it go into a 5.4? |
DR-4 — WAL v2 and transactional storageStatus: Proposed · Release: 6.0 must · Breaks: WAL and header format; Context
Proposal
What becomes impossible — torn allocations and frees, leaked pages after a crash, a page in neither the WAL nor the free list, losing committed data on a browser reload. Migration — new WAL and header format; covered by DR-2. Open questions — Keep multi-process mode in 6.0, or mark it experimental and port it in 6.x? |
DR-5 — Transactions: write conflicts detected, reads from a snapshotStatus: Proposed · Release: conflict detection as a 5.x fix (in progress for #304); snapshot reads 6.0 should · Breaks: behaviour: a conflicting commit fails instead of losing the other one's write Context
Proposal
Alternatives — Hold the collection write lock from a transaction's first write to its commit: simpler, but it serialises explicit transactions per collection (per database in single-file mode) and turns long transactions into timeouts. Open questions — Should a conflict retry automatically for auto-commit writes, or always surface to the caller? |
DR-6 — One index key codec and one sort order for all BSON valuesStatus: Proposed · Release: 6.0 must · Breaks: index format (indexes are rebuilt by the upgrade); Context
Proposal
What becomes impossible — indexed and unindexed queries disagreeing because of key encoding. Open questions — Keep the primary-key encoding as it is, to avoid rebuilding primary trees during the upgrade? |
DR-7 — One collection object per name, one record storeStatus: Proposed · Release: 6.0 must · Breaks: internal; the public Context
Proposal
What becomes impossible — #301 and #305 by construction; a document readable through one API and not the other. Open questions — none beyond the API shape in DR-10. |
DR-8 — One collection core for typed and schema-less collectionsStatus: Proposed · Release: 6.0 should (can slip to 6.x) · Breaks: internal Context — About 2,000 of Proposal — One collection core over raw BSON owns CRUD, index maintenance, retention, vacuum, CDC and transactional reads. A typed collection is a generated mapper on top of it; a schema-less collection is Alternatives — Keep both and share only the record store (DR-7): smaller step, the divergence in index maintenance, retention and CDC stays. Open questions — In 6.0, or as the first 6.x refactor once DR-6 and DR-7 are in? |
DR-9 — BSON wire revision and the field-name dictionaryStatus: Proposed · Release: 6.0 must · Breaks: file format (documents are rewritten by the upgrade); Context
Proposal
Open questions — Real Decimal128, or keep .NET decimal under a BLite-specific tag? Case-preserving names change how schema-less queries match field names: case-sensitive like MongoDB, or case-insensitive as today? |
DR-10 — The public API of v6Status: Proposed · Release: 6.0 must (additive parts in 5.3, DR-3) · Breaks: public API Context
Proposal
Open questions — Keep the name |
DR-11 — Source generator: diagnostics, incremental models, no run-time reflectionStatus: Proposed · Release: diagnostics and key tables 6.0 must; rewrite 6.0 should · Breaks: generated code (regenerate only) Context
Proposal
Open questions — Keep the netstandard2.1 reflection fallbacks, or require the generator on every target? |
DR-12 — One query plan for LINQ, BLQL and generated filtersStatus: Proposed · Release: 6.x · Breaks: query results where today's paths disagree (each such change goes through the differential suites) Context — Four query front ends (LINQ, BLQL, generated Proposal — LINQ, BLQL and generated filters compile to one predicate representation plus sort, skip, take, projection and aggregate; one planner picks the access path; one executor evaluates the residual over raw BSON; an index result is treated as exact only when the planner proves it. Reference semantics are defined once: LINQ-to-Objects for typed queries, the DR-6 order and null rule for BLQL. Alternatives — Keep the front ends and fix divergences one by one, as now: each fix is small, the class does not close. Open questions — Does BLQL keep MongoDB-style semantics where they differ from LINQ (missing fields, array matching)? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
#296 tracks what v6 needs around the code (migration guide, docs, release engineering). This Discussion is about the code itself. While reviewing it for #296 I found that the defects of the last weeks cluster in a few structural places, and that v6, which breaks the file format anyway (#212, #234), is the one chance to fix those places without a second break. Four of the defects were serious enough to file on their own: #304 (two concurrent transactions both commit and one is lost), #305, #306, #307.
The architecture is yours to decide. So instead of one large proposal, this Discussion holds one decision record per topic, each in its own reply below, so that each one can be accepted, changed or rejected on its own thread. Nothing in them is started before you say so, apart from bug fixes for 5.x as today.
Nothing here needs an answer before the questions in #287.
How the records work
docs/decisions/DR-NNN-<topic>.md, one file per decision, and gets one tracking issue linked from Epic: v6.0.0 — migration guide, changelog, docs, samples and release engineering #296. A later change of mind is a new record that supersedes the old one, so the history of why stays readable.6.0.0-preview.Nbuild, and the oracle suites must pass for it.The one rule behind the scope
The file format may break once. Every change that touches the on-disk format, or the public API, goes into 6.0 together, so that users migrate once. Everything that is internal can keep coming in 6.x minors. That puts each topic in one of three buckets: 6.0 must (format, contract), 6.0 should (internal, but it removes a whole bug class), 6.x (internal improvement).
The decisions
mainare the gate for every v6 change[Obsolete]DynamicCollectionconstructorBsonValueAPIWho does what
I'm happy to take DR-1 (the oracle stack is mine), DR-2 (migration) and the documentation side of all of them, and to work on any other one you want help with. Where you'd rather implement a decision yourself, the record and its tests are the hand-over.
All reactions