README: document read/write lock concurrency model

This commit is contained in:
mongo-light
2026-08-02 10:42:39 +03:00
parent e14cb8cef9
commit 4b975d1c93

View File

@@ -46,9 +46,12 @@ mongosh --port 27017
Killed mid-write (`kill -9`), the database recovers all committed writes; Killed mid-write (`kill -9`), the database recovers all committed writes;
the log and compaction both work with relative or absolute `--db` paths. the log and compaction both work with relative or absolute `--db` paths.
Records up to the announced 16 MB `maxBsonObjectSize` replay correctly. Records up to the announced 16 MB `maxBsonObjectSize` replay correctly.
- **Concurrency**: one mutex serializes commands end-to-end (command-level - **Concurrency**: a writer-preferring read/write lock splits command
atomicity); the Io worker pool only overlaps connection I/O with command execution — reads (`find`, `count`, `aggregate`, `list*`) run concurrently
execution — there is no read parallelism. Fine for light workloads. across connections, writes (CRUD, DDL) are exclusive and totally ordered,
and handshake/no-op commands run lock-free. The log append + `fsync` still
happen under the write lock, so the crash guarantees are unchanged. Fine
for light workloads.
## Layout ## Layout