Earlier quoted context omitted.
This article has very little useful information... There's nothing novel about optimizing queries, sharding and using read replicas.
It has one piece of useful info: their main data store even for 800M users is a single instance of postgres (for writes) without sharding.
Scaling PostgreSQL to power 800M ChatGPT users
61–70 of 145 posts
Re: Scaling PostgreSQL to power 800M ChatGPT users
#62How do they store all the other stuff related to operating the service? This must be a combination of several components? (yes, including some massdata storage, Id guess?)
This would be cool to understand, as Ive absolutely no idea how this is done (and could be done :-)
Re: Scaling PostgreSQL to power 800M ChatGPT users
#63This is why I love Postgres. It can get you to being one of the largest websites before you need to reconsider your architecture just by throwing CPU and disk at it. At that point you can well afford to hire people who are deep experts at sharding etc.
Can you, though? OpenAI is haemorrhaging money like it is going out of style and, according to the news cycle over the last couple of days, will likely to be bankrupt by 2027.
Re: Scaling PostgreSQL to power 800M ChatGPT users
#64Re: Scaling PostgreSQL to power 800M ChatGPT users
#65Earlier quoted context omitted.
I know they said that, but in fact sharding is entirely a database-level concern. The application need not be aware of it at all.
Sharding can be made mostly transparent, but it's not purely a DB-level concern in practice. Once data is split across nodes, join patterns, cross-shard transactions, global uniqueness, certain keys hit with a lot of traffic, etc matter a lot. Even if partitioning handles routing, the application's query patterns and its consistency/latency requirements can still force application-level changes.
But how would any of that change by going outside Postgres itself to begin with? That's the part that doesn't make much sense to me.
Re: Scaling PostgreSQL to power 800M ChatGPT users
#66This is however the most down to earth: How we scale Postgresql I've read in a long time. No weird hacker, no messing around with the source code or tweaking the Linux kernel. Running on Azure Postgresql it's not like OpenAI have those options anyway, but still it seems a lot more relatable than: We wrote our own drive/filesystem/database-hack in Javascript.
Re: Scaling PostgreSQL to power 800M ChatGPT users
#67Months passed by since this application was developed (a simple Phoenix/Elixir backend), and yesterday I was casually checking my database to see how many rows it had - about 500,000+ roughly. I didn't notice a single hint of the volume the Postgres was handling, granted - I'm the only user, but there's always a lot going on - RAG, mostly that requires searching of the database for context before multiple agents send you a response (and respond amongst themselves). Absolutely zero performance degradation.
I'm convinced that Postgres is a killer database that doesn't get the attention it deserves over the others (for chat). Already managing some high traffic websites (with over 500M+ requests) with no issues, so I am extremely unsurprised that it works really well for chat apps at scale too.
Re: Scaling PostgreSQL to power 800M ChatGPT users
#68Earlier quoted context omitted.
The major hyperscalers all offer a plethora of virtual machines SKUs that are essentially one entire two-socket box with many-core CPUs. For example, Azure Standard_E192ibds_v6 is 96 cores with 1.8 TB of memory and 10 TB of local SSD storage with 3 million IOPS. Past those "general purpose" VMs you get the enormous machines with 8, 16, or even 32 sockets.[1] These are almost exclusively used for SAP HANA in-memory da…
Are there any pictures around of these 8, 16, 32 socket boards? Just curious how they look like.
Multiple of these can be linked together with “NUMALink” cables, which carry the same protocol as the traces that go between sockets on the motherboard. You end up with a single kernel running across multiple chassis.
Re: Scaling PostgreSQL to power 800M ChatGPT users
#69There’s also a lot of repetition. Maybe it was AI generated…?
Re: Scaling PostgreSQL to power 800M ChatGPT users
#70Sure, but choosing from the start a DB that can scale with ease would have taken far less time and effort.
You can bend any software into doing anything, but is it worth it?