🔥 The DB Grill 🔥

Where database blog posts get flame-broiled to perfection

Stop Nesting Database Systems
Originally from cedardb.com/blog/index.xml
December 18, 2024 • Roasted by Alex "Downtime" Rodriguez Read Original Article

Alright, team, gather 'round the virtual water cooler. I just finished reading this... masterpiece of architectural ambition, and I have to say, I'm genuinely impressed. The sheer audacity, the beautifully bold vision of just... smooshing databases together like a toddler with Play-Doh. It's a breathtakingly brave blog post.

I mean, the author starts by pointing out that embedding one database into another is "surprising and worrying," and then spends the next thousand words detailing exactly why it's a five-alarm fire in a tire factory. It’s a bold strategy, Cotton. Let's see if it pays off.

My favorite part is the casual mention of nesting four—count 'em, four!—systems together. PlanetScale, which is Vitess on MySQL, packing PostgreSQL, which is packing pg_duckdb, which is packing DuckDB and MotherDuck. This isn't a data stack; it's a Russian nesting doll of potential outages. It's a cascading catastrophe just waiting for a misplaced comma in a config file. I'm already clearing a spot on my laptop lid for the MotherDuck sticker, right next to my stickers for RethinkDB and Parse. They'll have so much to talk about.

And the promises! Oh, the delicious, delectable promises.

They allow you to run transactions in PostgreSQL and claim to seamlessly hand over analytical workloads to Clickhouse and DuckDB with a sleek interface directly from PostgreSQL.

"Seamlessly." That's the word that gets my pager-induced PTSD tingling. "Seamless" is code for “works perfectly until it encounters a single ray of production sunlight.” I love the idea that this extension just takes over. It “controlls query execution for all queries you send to PostgreSQL.” What could possibly go wrong with a plucky upstart extension hijacking the query planner of a 25-year-old database engine? It's fine. We don't need predictable performance or resource management. Who's in charge of memory allocation here? Do they flip a coin? Let's just let the two schedulers fight it out in the kernel. The winner gets the RAM.

I’m particularly enamored with the frank admission that for all this added complexity, the performance gains are... well, let's just say, aspirational. The article notes that scans still run at PostgreSQL speeds because the embedded engine "has no access to columnar layout or advanced techniques." So, we're building a sports car by strapping a jet engine to a unicycle, but the wheels still have to touch the ground. You get all the operational overhead of a complex, multi-headed beast, but the core bottleneck remains. Stunning.

But this is where the genius truly shines through. The monitoring story. It’s so elegantly simple, because it doesn't exist.

This is true "zero-downtime" thinking, in the sense that you will have zero idea why there is downtime.

I can see it now. It's 3:17 AM on the Sunday of Memorial Day weekend. The monthly reports are running. A query that has worked flawlessly for weeks suddenly hangs. pg_stat_activity shows it’s active, but nothing's happening. The logs are a cryptic dialogue between two systems speaking different languages. One says, “Hey, I sent you the data to scan,” and the other says nothing, because it has quietly suffocated on a weirdly formatted timestamp that only appears on the last day of a month in a leap year.

My on-call alert will just say: [FIRING:1] DatabaseIsSad (job="franken-db-prod").

And of course, after this daring database dalliance, this whole intellectual exercise, the article gently pivots to... "by the way, our product, CedarDB, solves all of this." It's magnificent. It's like watching someone meticulously build a beautiful, intricate, flammable sculpture, light it on fire, and then, as it burns to the ground, turn to the camera and say, "Tired of fires? Try our patented, fire-proof building materials."

Truly, a spectacular piece of content. 10/10. Now if you'll excuse me, I need to go preemptively write a post-mortem for a system that doesn't even exist in our infrastructure yet. It's just a matter of time.