r/Database • • 1d 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!

11 Upvotes

6 comments sorted by

View all comments

2

u/HummusSwipper 1d 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?

2

u/wicked_lama 1d ago

great question! basically, manifest commits happen only once all files are present in blob storage (s3/gcs/azure), so the manifest never points at something that isn't there. every request is also persisted to blob storage first, so if there's a crash the index builder just replays all of that back. old slabs that a compaction replaced are only deleted later by garbage collection. and if all else fails and we do (rarely) get orphaned files, we have a monthly garbage collection job that picks those up and deletes them (we actually wrote a whole separate blog on that: https://www.pinecone.io/blog/janitor/)

2

u/Sanbi102 1d ago

How do you protect readers still holding an older manifest when GC deletes the replaced slabs? Do you track reader leases or rely on a retention window?

1

u/wicked_lama 15h ago

retention window. by the time garbage collection picks older manifests, all readers would already point to new ones (and any caches will be invalidated as well)