Franck Pachot

@FranckPachot
386 Followers
160 Following
882 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

SQL databases rely on relational algebra and normal forms. Document databases use comparable math, just starting from non-1NF instead of 1NF. A 1986 paper, "Theory of Non-First Normal Form Relational Databases," introduced nested relations, expanded relational operators, and a query language called SQL/NF. Great concepts to understand document database modeling and its use. To make it easier, I mapped each concept to its modern equivalent, MongoDB, with examples:

https://dev.to/franckpachot/non-first-normal-forms-1nf-and-mongodb-an-alternative-to-4nf-to-address-3nf-anomalies-17i8

Non-First Normal Forms ( 1NF) and MongoDB: an alternative to 4NF to address 3NF anomalies

SQL databases are grounded in relational algebra, but they are not the only databases with a strong...

DEV 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
@caravantraveller So "The killer feature that led to the PostgreSQL decision was ... encryption at rest". They didn't realize that PostgreSQL doesn't provide encryption 🤷🏼‍♂️
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