Franck Pachot's Avatar

Franck Pachot

@franckpachot.bsky.social

https://dev.to/franckpachot πŸ₯‘ Developer Advocate at πŸƒ MongoDB πŸ”Έ AWS Data Hero πŸ…ΎοΈ Oracle Certified Master 🐘 PostgreSQL andβ–β–ž Yugabyte​DB

1,058 Followers  |  323 Following  |  304 Posts  |  Joined: 25.06.2023  |  1.9929

Latest posts by franckpachot.bsky.social on Bluesky

Preview
MongoDB indexing internals: showRecordId() and hint({$natural:1}) You can understand how MongoDB stores documents internally with simple queries that rely on the...

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...

07.08.2025 14:17 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

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    πŸ“Œ 0

Per 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    πŸ“Œ 0
Preview
Transaction performance πŸ‘‰πŸ» retry with backoff A benchmark sponsored by EDB, a PostgreSQL company, in 2019 contributed to the myth that MongoDB...

Benchmarks 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...

05.08.2025 14:09 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Preview
Why MongoDB skips indexes when flattening or renaming sub-document fields in $project before $match aggregation pipeline MongoDB is a general-purpose database that offers more than just a JSON datastore. It is recognized...

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    πŸ“Œ 0
Preview
MongoDB High Availability: Replica Set in a Docker Lab MongoDB guarantees consistent and durable write operations through write-ahead logging, which...

Easy to check MongoDB durability (WAL fsync to disk + sync replication to a quorum)
dev.to/franckpachot...

02.08.2025 19:06 β€” πŸ‘ 3    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0
Post image

Nice to see a public presentation about SQL Assertions by @toonkoppelaars.bsky.social at @doagev.bsky.social
my.doag.org/events/userc...

02.08.2025 07:48 β€” πŸ‘ 10    πŸ” 2    πŸ’¬ 0    πŸ“Œ 0
Preview
Strong consistency πŸ‘‰πŸ» MongoDB highly available durable writes (Replication) In the previous post, I used strace to display all calls to write and sync to disk from any MongoDB...

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...

29.07.2025 06:18 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Post image Post image Post image Post image

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    πŸ“Œ 0
Preview
Microsoft exec admits it 'cannot guarantee' data sovereignty : Under oath in French Senate, exec says it would be compelled – however unlikely – to pass local customer info to US admin

That 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    πŸ“Œ 1
Preview
Lock-Free Wait-on-Conflict and Fail-on-Conflict in MongoDB Concurrency control in databases has two main modes for handling conflicts. Traditionally, these are...

ACID 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...

23.07.2025 18:13 β€” πŸ‘ 1    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0

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.

23.07.2025 09:43 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
.hint() in MongoDB is different that SQL optimizer hints: they force indexes MongoDB sits at the crossroads between SQL, where developers can write queries on a logical model...

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    πŸ“Œ 1
Preview
Database latency with PostgreSQL and MongoDB: it's the data model that makes it fast A business transaction ideally involves a single roundtrip to the database. MongoDB allows a single...

Simulating 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...

21.07.2025 07:21 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Franck Pachot β€” DEV Community Profile πŸ₯‘ Developer Advocate at πŸƒΒ MongoDB, πŸ”ΆΒ AWS Data Hero, 🐘 PostgreSQL fan,β–β–žΒ YugabyteDB expert, πŸ…ΎοΈΒ Oracle Certified Master, and πŸ’šΒ loving all databases πŸ›’οΈ

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.

20.07.2025 09:20 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

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 πŸ˜‰

20.07.2025 09:09 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Linking the thread which I broke when deleting a post πŸ€·πŸΌβ€β™‚οΈ
bsky.app/profile/ivca...

20.07.2025 08:59 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Aggregation Operators - Database Manual - MongoDB Docs Contains a list of aggregation operators to use in aggregation stages.

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?

20.07.2025 08:57 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Post image

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

20.07.2025 07:53 β€” πŸ‘ 1    πŸ” 1    πŸ’¬ 1    πŸ“Œ 0

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    πŸ“Œ 0

An 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    πŸ“Œ 0
Preview
Everything You Know About MongoDB is Wrong! | MongoDB There are a bunch of myths floating around about MongoDB. Here's where I bust them.

MongoDB: "The documentation is pretty good!"

Also MongoDB: www.mongodb.com/developer/pr...

08.07.2025 20:31 β€” πŸ‘ 2    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0

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    πŸ“Œ 0
Preview
Sequences in MongoDB In a previous post about No-gap sequence in PostgreSQL and YugabyteDB, I mentioned that sequences in...

Looking 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...

18.07.2025 17:41 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Preview
Data Modeling: Is Normalization Still Relevant? During my university days (in the 90s), we studied relational databases as the gold standard of data modeling, applying normal forms from 1NF to 3NF and beyondβ€”normalization was the ultimate goal. Yet...

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...

18.07.2025 14:22 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

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
Preview
β€œHello, Community!”: Meet the 2025 MongoDB Community Champions! | MongoDB Blog Introducing the 2025 cohort of MongoDB Community Champions.

πŸ’š 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...

16.07.2025 15:09 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

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    πŸ“Œ 0
Preview
Wildcard Indexes ($**) In SQL databases, we sometimes encounter an Entity-Attribute-Value (EAV) model to work around the...

A 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

@franckpachot is following 20 prominent accounts