Is MongoDB storing documents like heap tables or index-organized tables?
ππ» kind of both, a B+Tree optimized for flexible size documents
dev.to/franckpachot...
@franckpachot.bsky.social
https://dev.to/franckpachot π₯ Developer Advocate at π MongoDB πΈ AWS Data Hero π ΎοΈ Oracle Certified Master π PostgreSQL andββ YugabyteβDB
Is MongoDB storing documents like heap tables or index-organized tables?
ππ» kind of both, a B+Tree optimized for flexible size documents
dev.to/franckpachot...
I made it more clear in the article.Thanks for the feedback. It's OCC in WiredTiger, per document, and MongoDB built fail-on-conflict on top, for transactions. Commit should not fail because of data, and could be retried without rollback what was done. Some drivers do that to be resilient to failure
07.08.2025 09:46 β π 1 π 0 π¬ 0 π 0Per statement. I should use fail-on-conflict rather than OCC which is generally used for detection at commit
05.08.2025 23:44 β π 1 π 0 π¬ 1 π 0Benchmarks from DbX's vendor showing it's faster than DbY are mainly marketing and serve little purpose in promoting DbX. However, they can help DbY's users spot poor design choices and anti-patterns that made DbY slower than carefully-tuned DbX
dev.to/franckpachot...
Query planner transformations on MongoDB documents with flexible schemas can surprise users familiar with SQL databases, which typically have fixed tabular schemas. An example of these subtle differences is explained in a new blog post. dev.to/franckpachot...
04.08.2025 17:57 β π 3 π 0 π¬ 0 π 0Easy to check MongoDB durability (WAL fsync to disk + sync replication to a quorum)
dev.to/franckpachot...
Nice to see a public presentation about SQL Assertions by @toonkoppelaars.bsky.social at @doagev.bsky.social
my.doag.org/events/userc...
Nope. I can't talk about pre-WiredTiger versions from 8 years ago, but MongoDB now offers robust storage and built-in high availability that isnβt found in other databases, at least not at the same price and operational simplicity.
dev.to/mongodb/stro...
The level of π© on Medium is high. This article references non-existent versions and features, as well as "early access internal builds" of open-source software π€£. AI is using this garbage to build the knowledge base for the next decade. Long live human experts who rely on factual information!
29.07.2025 06:10 β π 1 π 0 π¬ 0 π 0That would obviously apply to Oracle cloud also. They must give out EU stored data about EU customers to US. Very bad idea idea to use major US big-tech www.theregister.com/2025/07/25/m...
28.07.2025 18:34 β π 9 π 5 π¬ 1 π 1ACID properties in @MongoDB:
π Single-document updates wait on conflicts, similar to pessimistic locking, but uses optimistic concurrency control to avoid locks.
π User-managed transactions detect conflicts and enable applications to cancel and retry their transactions.
dev.to/franckpachot...
That was my initial thought. But it's interesting to see that NoSQL developers have a different opinion and view the index hint as an integral part of the query rather than an override.
Yes, there is something like baselines. I haven't tested it yet, but it could be as risky as you suspect.
I mainly use query planner hints for troubleshooting, and I rarely use them as workarounds. It's essential to understand whether hints force a plan, affecting the result, or favor one and may be ignored. Here's how hints work in #MongoDB dev.to/franckpachot...
22.07.2025 21:08 β π 6 π 1 π¬ 1 π 1Simulating edge conditions: Running #pgbench with added latency to test client/server transaction logic in SQL (business logic in App or DB?) and compare it with MongoDBβs document model
dev.to/franckpachot...
I forgot to add my blog to my @bsky.app bio. Fixed.
dev.to/franckpachot
Expect new content about #MongoDB, as well as some #PostgreSQL and #AWS databases.
Great.
If you have an expression, {$isArray: "$field"}, or {$isArray: ["$field"]}, if you don't take the shortcut, will tell you if it's an array or not.
If you have a constant like [5], I understand it's confusing, but you don't need the database to tell you that [5] is an array and 5 is a number π
Linking the thread which I broke when deleting a post π€·πΌββοΈ
bsky.app/profile/ivca...
Agree. It's for all operators (except $literal):
www.mongodb.com/docs/manual/...
In many languages, you have to escape some elements to be interpreted as data rather than the language's syntax, like quotes in SQL.
But where do you have this, with constants? Rather than testing a field or expression?
With literals, what is in the array is interpreted as the arguments for the $ operator, so 5 and [5] are the same. Cf. doc ππΌ
It's different if you pass a field (= one argument) that is an array
(I removed my previous post as it's misleadingπ«€)
Example with both:
mongoplayground.net/p/TfuvZsKJHW2
I don't think a driver can abort and retry safely. The application may have executed some non-transactional tasks (such as pushing to a queue, sending an email, logging to a file, or updating another database), so only the application can cancel them properly. driver/database do not know
20.07.2025 07:14 β π 0 π 0 π¬ 0 π 0An array is like a One-to-One Relationship that becomes One-to-Many in another document. For example, users have one email, and one day you have one with two emails. This would break in an SQL schema. However, MongoDB handles it with the operator that applies to all elements
19.07.2025 23:45 β π 0 π 0 π¬ 0 π 0MongoDB: "The documentation is pretty good!"
Also MongoDB: www.mongodb.com/developer/pr...
The transparent retry, which looks like a wait, happens only for a single document update. Here it is in a transaction. It fails on conflict. MongoDB has no wait queue / deadlock detection, which would defeat the scalability of sharding, so the application must have a retry logic
19.07.2025 22:54 β π 0 π 0 π¬ 1 π 0Looking for an AUTO-INCREMENT, BIGSERIAL, or GENERATED ALWAYS AS IDENTITY in MongoDB? Simply use a collection with an atomic increment-and-fetch operation, and choose ACID or not (SQL sequences are not ACID)
dev.to/franckpachot...
Old debates about relational 3NF are resurfacing. I revisited Coddβs paper to better understand the original goals of normalization, this time considering todayβs developer experience and document data modeling
www.linkedin.com/pulse/data-m...
A better database development experience in @intellijidea.com
17.07.2025 19:22 β π 0 π 0 π¬ 0 π 0π€© I love this
17.07.2025 10:31 β π 1 π 0 π¬ 0 π 0π Welcome the 2025 MongoDB Community Champions!
A diverse group from various countries, growing the tech community with professionals from industry, academia, startups, and large companies
www.mongodb.com/company/blog...
Memories from 25 years ago when I discovered Toad from a colleague at Mobistar π§πͺ (they changed name later). Only one PC in the open space had internet. BSCS consultants were the kings of telco IT, Oracle DBAs fixing their queries with the π button on TOAD (no need to select and lpad from plan_table)
11.07.2025 08:58 β π 1 π 0 π¬ 0 π 0A document database isn't just a JSON store with flexible schemas; it also integrates flexibility directly into indexes. MongoDB accepts wildcards in index definitions: dev.to/franckpachot.... I've tested the same on MongoDB emulations on top of SQL databases, and they all fail
10.07.2025 15:30 β π 1 π 0 π¬ 0 π 0