Franck Pachot

@FranckPachot
386 Followers
160 Following
881 Posts
🥑 Developer Advocate at 🍃 MongoDB
🔸 AWS Data Hero
🅾️ Oracle Certified Master
▝▞ Yugabyte​DB 🐘 PostgreSQL
🐦Twitterhttps://twitter.com/FranckPachot
✍🏼Bloghttps://dev.to/franckpachot
🔗LinkedInhttps://www.linkedin.com/in/franckpachot/
📺Youtubehttps://www.youtube.com/@franckpachot/community
You need to insert 1,000 documents into @MongoDB. You can either call insertMany() with the default session, which provides per-document ACID guarantees, or run it in a transaction so the entire batch is all-or-nothing. Which approach is faster?
https://dev.to/franckpachot/mongodb-transaction-performance-4dc7
🌱 TL;DR: it's the same. Choose the consistency boundaries based on your application, not myths or guesses.
MongoDB Transaction Performance

Many believe MongoDB transactions are slow, but this misconception often comes from misunderstanding...

DEV Community
Because a cost-based optimizer needs accurate statistics, run ANALYZE on PostgreSQL partitioned tables to gather them, since auto-analyze only processes partitions. https://dev.to/aws-heroes/postgresql-global-statistics-on-partitionned-table-require-a-manual-analyze-473h
PostgreSQL global statistics on partitionned table require a manual ANALYZE

PostgreSQL auto-analyze collects statistics on tables with rows. For partitioned tables, it excludes...

DEV Community
Relational algebra provides a logical model for reasoning about data independently of the domain, while document databases model data as applications do. A new blog to compare the relational selection (σ) on 1NF with its MongoDB equivalent: https://dev.to/franckpachot/from-relational-algebra-to-document-semantics-b00
From Relational Algebra to Document Semantics

The relational model was designed not to mirror application structures, but to optimize reasoning...

DEV Community
In databases, the Cartesian product is used to generate all combinations. In MongoDB, you can get it either at read time using multiple queries or a $lookup aggregation stage, or at write time through embedding, if it makes sense within your domain. https://dev.to/franckpachot/cross-join-in-mongodb-ep7
Cross join in MongoDB

Relational database joins are, conceptually, a cartesian product followed by a filter (the join...

DEV Community

Top‑K BM25 range + text search on 100 million MongoDB documents in under two seconds (I reused the excellent ParadeDB example for this test)

https://dev.to/franckpachot/top-k-queries-with-mongodb-search-indexes-bm25-3a41

Top-K queries with MongoDB search indexes (BM25)

A document database is more than a JSON datastore. It must also support efficient storage and...

DEV Community
Reading E. F. Codd's "A Relational Model of Data for Large Shared Data Banks" without prior knowledge of pre-relational network databases may make the "connection trap" difficult to understand. I tried to explain it using modern database concepts: https://dev.to/franckpachot/relational-composition-and-codds-connection-trap-in-postgresql-and-mongodb-4k34
Relational composition and Codd's "connection trap" in PostgreSQL and MongoDB

Relational composition is to joins what the cartesian product is to tables: it produces every result...

DEV Community
🌱 #MongoDB is not schemaless. In this “Hello World”, the first step is to declare a connection and schema to generate the #Prisma client.
📐There's a schema: it starts in the App, and the DB preserves it through memory and storage layers https://dev.to/franckpachot/prisma-mongodb-hello-world-928
Prisma + MongoDB “Hello World”

Prisma is an ORM (Object-Relational Mapper). With MongoDB, it acts as an Object Document Mapper,...

DEV Community

No rewind needed! MongoDB smoothly handles secondary nodes rejoining the replica set thanks to its recover-to-timestamp rollback in its Raft-inspired algorithm. Observe this in action with w:1 writes, where the rolled-back data isn’t lost but saved in a rollback directory:

https://dev.to/franckpachot/w1-asynchronous-write-and-conflict-resolution-in-mongodb-non-default-5677

{ w: 1 } Asynchronous Writes and Conflict Resolution in MongoDB

MongoDB guarantees durability—the D in ACID—over the network with strong consistency—the C in the CAP...

DEV Community
Normal forms in a document database
🍕Tabular: One Pizza, One Area
📖1NF: More Menu Options
💶2NF: Pizza Pricing
☎️3NF: Manager's Contacts
🗺️BCNF: Per-Area Pricing
🚚4NF: Delivery Areas
📏5NF: Adding Pizza Sizes
🗓️ 6NF: Tracking Price History
https://dev.to/franckpachot/normal-forms-and-the-document-model-mongodb-19f9
Normal Forms and MongoDB

I learned about normal forms when databases were designed before the applications that used them. At...

DEV Community
A good document model removes the need for explicit locks or serializable isolation to prevent write skew. Example in MongoDB with the well-known Doctor's On-Call Shift demo. https://dev.to/franckpachot/the-doctors-on-call-shift-with-snapshot-isolation-in-mongodb-18nn
The Doctor's On-Call Shift with Snapshot Isolation in MongoDB

In this series, we explored several ways to solve the "Doctor's On-Call Shift" problem, which...

DEV Community