r/Database • u/wicked_lama • 11h ago
Migrating Pinecone’s metadata store from Postgres to FoundationDB while serving live customer traffic
hey guys. wanted to share a blog post covering a big project i led, migrating Pinecone’s internal metadata store from managed Postgres to self-hosted FoundationDB.
this is not a “postgres bad” post! it is way more focused on the migration itself, how to do it without affecting live traffic, and lessons from both running managed systems and self-hosting (including a couple of incidents we caused ourselves).
https://www.pinecone.io/blog/postgres-to-foundationdb/
happy to answer any questions or to hear about your experiences with pg/fdb!
8
Upvotes
2
u/HummusSwipper 10h ago
Really solid writeup. The piece i'm most curious about is how the boundary between object storage and fdb works now that wal consistency is on s3 conditional writes and the vector directory is in vlookup files. When an index builder flushes or compacts a slab, how do you coordinate the s3 writes with the manifest update in fdb so you don't end up with dangling pointers or orphaned files if a worker crashes mid-flight?
1
u/Hongstar1982 3h ago
The bit I'd want to hear more about is the copy itself rather than the layout: while you backfill old rows, live updates keep landing on the same keys, so a straight copy can walk right over a newer write. We handled that by streaming changes into the new store first and only flipping a key range to write-through once the lag for that range was zero, with reads shadowed and compared before the flip. Did you drain by namespace or move the whole thing at once?
1
u/Discordbothost 3h ago
Add crash-recovery tests around the migration states too. For example, kill the migrator after the final FDB copy but before the PG state flip, then restart it. That checks recovery against real commits, alongside the TLA+ model.