From 4b975d1c93cdd4e98fb4e964d3e09015c9287f61 Mon Sep 17 00:00:00 2001 From: mongo-light Date: Sun, 2 Aug 2026 10:42:39 +0300 Subject: [PATCH] README: document read/write lock concurrency model --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 118954b..dc334f7 100644 --- a/README.md +++ b/README.md @@ -46,9 +46,12 @@ mongosh --port 27017 Killed mid-write (`kill -9`), the database recovers all committed writes; the log and compaction both work with relative or absolute `--db` paths. Records up to the announced 16 MB `maxBsonObjectSize` replay correctly. -- **Concurrency**: one mutex serializes commands end-to-end (command-level - atomicity); the Io worker pool only overlaps connection I/O with command - execution — there is no read parallelism. Fine for light workloads. +- **Concurrency**: a writer-preferring read/write lock splits command + execution — reads (`find`, `count`, `aggregate`, `list*`) run concurrently + 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