1/2/2024 0 Comments Database sharding postgresql![]() Run any reports from a read-only secondary.Īre you running pg_stat_statements to track slow queries? You probably have one or two that are blowing up everything else. If you are a SaaS with account-centric tenancy, you may have 2% of customers that are generating most of your load.īecause of that, I’d lean toward optimization of what you have in the short-run. It’s best to do things like convert to UUIDs, which may affect URLs used by customers. I’ve been at companies that it took about 18 months. Planning to shard is quite a long process. In the medium term, optimize your current usage.Īny data structure changes are going to take longer to plan and get right. In the super-short-run, I’d say give it more horsepower, and see if it works. Hey, I work at Crunchy Data, so we talk with a lot of folks at this phase. How do I know when I'm running into the limits of postgres vs. So my question is when do I know if I should be implementing a sharded database architecture or be upgrading the EC2 instance. This adds costs that could go up exponentially. This would require me to upgrade the EC2 instance postgres is running on. This adds complexity and if done incorrectly it could result in lost or corrupted data This would require me to shard the database. There are a few ways to solve my problem: What would be the best way to optimize this database? I've noticed queries have been slowing down even with indexes created. ![]() There are queries that have to join data from these tables and perform calculations on the results. Let's say I have an EC2 instance with a postgres database that has a couple of tables and about 400 million rows in one of the tables, each day there are about 20 million rows added. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |