TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Why we moved from AWS RDS to Postgres in Kubernetes

205 点作者 elitan超过 2 年前

19 条评论

nunopato超过 2 年前
(Nhost)<p>Sorry for not answering everyone individually, but I see some confusion duo to the lack of context about what we do as a company.<p>First things first, Nhost falls into the category of backend-as-a-service. We provision and operate infrastructure at scale, and we also provide and run the necessary services for features such as user authentication and file storage, for users creating applications and businesses. A project&#x2F;backend is comprised of a Postgres Database and the aforementioned services, none of it is shared. You get your own GraphQL engine, your own auth service, etc. We also provide the means to interface with the backend through our official SDKs.<p>Some points I see mentioned below that are worth exploring:<p>- One RDS instance per tenant is prohibited from a cost perspective, obviously. RDS is expensive and we have a very generous free tier.<p>- We run the infrastructure for thousands of projects&#x2F;backends which we have absolutely no control over what they are used for. Users might be building a simple job board, or the next Facebook (please don&#x27;t). This means we have no idea what the workloads and access patterns will look like.<p>- RDS is mature and a great product, AWS is a billion dolar company, etc - that is all true. But is it also true that we do not control if a user&#x27;s project is missing an index and the fact that RDS does not provide any means to limit CPU&#x2F;memory usage per database&#x2F;tenant.<p>- We had a couple of discussions with folks at AWS and for the reasons already mentioned, there was no obvious solution to our problem. Let me reiterate this, the folks that own the service didn&#x27;t have a solution to our problem given our constraints.<p>- Yes, this is a DIY scenario, but this is part of our core business.<p>I hope this clarifies some of the doubts. And I expect to have a more detailed and technical blog post about our experience soon.<p>By the way, we are hiring. If you think what we&#x27;re doing is interesting and you have experience operating Postgres at scale, please write me an email at nuno@nhost.io. And don&#x27;t forget to star us at <a href="https:&#x2F;&#x2F;github.com&#x2F;nhost&#x2F;nhost" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;nhost&#x2F;nhost</a>.
评论 #32996796 未加载
评论 #32990465 未加载
评论 #32989277 未加载
MBCook超过 2 年前
So they switch from one giant RDS instance with all tenants per AZ to per-tenant PG in Kubernetes.<p>So really we don’t know how much RDS was a problem compared to the the tenant distribution.<p>For the purposes of an article like this it would be nice if the two steps were separate or they had synthetic benchmarks of the various options.<p>But I understand why they just moved forward. They said they consulted experts, it would also be nice to discuss some of what they looked or asked about.
评论 #32992428 未加载
radimm超过 2 年前
Having recently heard a lot of about PostgreSQL in Kubernetes (cloudNativePG for example) it always makes me wonder about the actual load and the complexity of the cluster in the question.<p>&gt; This is the reason why we were able to easily cope with 2M+ requests in less than 24h when Midnight Society launched<p>This gives the answer, while it&#x27;s probably not evenly distributed gives 23 req&#x2F;sec (guess peak 60 - 100 might be already stretching it). Always wonder about use cases around 3 - 5k req&#x2F;sec as minimum.<p>[edit] PS: not really ditching neither k8s pg nor AWS RDS or similar solutions. Just being curious.
评论 #32987112 未加载
评论 #32987460 未加载
评论 #32987711 未加载
评论 #32990003 未加载
评论 #32987500 未加载
评论 #32991406 未加载
qeternity超过 2 年前
These threads are always full of people who have always used an AWS&#x2F;GCP&#x2F;Azure service, or have never actually run the service themselves.<p>Running HA Postgres is not easy...but at any sort of scale where this stuff matters, nothing is easy. It&#x27;s not as if AWS has 100% uptime, nor is it super cheap&#x2F;performant. There are tradeoffs for everyone&#x27;s use-case but every thread is full of people at one end of the cloud &#x2F; roll-your-own spectrum.
评论 #32988156 未加载
评论 #32988096 未加载
评论 #32988584 未加载
jmarbach超过 2 年前
$0.50 per extra GB seems high, especially for a storage-intensive app. Given the cost of cloud Object Storage services it doesn&#x27;t seem to make much sense.<p>Examples of alternatives for managed Postgres:<p>* Supabase is $0.125 per GB<p>* DigitalOcean managed Postgres is ~$0.35 per GB
评论 #32990403 未加载
评论 #32987387 未加载
neilv超过 2 年前
I didn&#x27;t see &quot;backups&quot; mentioned in that, though I&#x27;m sure they have them. Depending on your needs, it&#x27;s a big thing to keep in mind while weighing options.<p>For a small startup or operation, a managed service having credible snapshots, PITR backups, failover, etc. is going to save a business a lot of ops cost, compared to DIY designing, implementing, testing, and drilling, to the same level of credibility.<p>One recent early startup, I looked at the amount of work for me or a contractor&#x2F;consultant&#x2F;hire to upgrade our Postgres recovery capability (including testing and drills) with confidence. I soon decided to move from self-hosted Postgres to RDS Postgres.<p>RDS was a significant chunk of our modest AWS bill (otherwise, almost entirely plain EC2, S3, and traffic), but easy to justify to the founders, just by mentioning the costs it saved us for business existential protection we needed.
评论 #32989136 未加载
xwowsersx超过 2 年前
I&#x27;ve recently been spending a fair amount of time trying to improve query performance on RDS. This includes reviewing and optimizing particularly nasty queries, tuning PG configuration (min_wal_size, random_page_cost, work_mem, etc). I am using a db.t3.xlarge with general purpose SSD (gp2) for a web server that sees moderate writes and a lot of reads. I know there&#x27;s no real way to know other than through testing, but I&#x27;m not clear on which instance type best serves our needs — I think it may very well be the case that the t3 family isn&#x27;t fit for our purposes. I&#x27;m also unclear on whether we ought to switch to provisioned IOPS SSD. Does anyone have any general pointers here? I know the question is pretty open-ended, but would be great if anyone has general advice from personal experience?
评论 #32987072 未加载
评论 #32987091 未加载
评论 #32990280 未加载
ransom1538超过 2 年前
I operate a large fleet of mysql db instances. We cannot use Cloudsql (RDS competitor) due mainly to cost. BUT, one thing left out, was the ability to have complex topologies. EG. MasterA &lt;- SlaveA[1..n] &lt;- MasterB &lt;- SlaveB[1..n]. With extremely high writes, being able to cut and shard where you want if very powerful. In this example you could write to MasterB with different data. If i need to filter a table in replication: done. We don&#x27;t need to beg AWS RDS team for the option to change a db variable (I have done this). Warning: Doing this stuff at scale with massive bills is very stressful. It took about a year to get everything ironed out [snapshots, autoscaling, sharding, custom monitoring, etc].
qubit23超过 2 年前
I was hoping to see a bit more of an explanation of how this was implemented.
评论 #32987518 未加载
KaiserPro超过 2 年前
In this instance I can see the point, being able to give raw access to customer&#x27;s own psql instance is a good feature.<p>but. It sounds bloody expensive to develop and maintain a reliable psql service on k8s
geggam超过 2 年前
I would love to see the monitoring on this.<p>Network IOPs and NAT nastiness or disk IO the bigger issue ?
HL33tibCe7超过 2 年前
Couldn’t you just spin up an RDS instance for each project (so, single-tenant RDS instances) to avoid the noisy neighbour problem? Or is that too expensive?
评论 #32987553 未加载
techn00超过 2 年前
So what solution did you end up using? Crunchy operator?
评论 #32989114 未加载
xyzzy_plugh超过 2 年前
If the cost of operating a postgres database is eating into your margins so much (and you can&#x27;t simply adjust your prices to eat the difference) then I would suspect the wrong technology is in place.<p>Sure, RDS is expensive, but it&#x27;s also quite well done. Almost every cloud platform service is more expensive than doing it yourself. No surprise here.<p>In the past I&#x27;ve deployed SQLite over Postgres for cost cutting reasons. It&#x27;s not too difficult to swap out unless you&#x27;re heavily bought into database features.
评论 #32992456 未加载
mp3tricord超过 2 年前
In a production data base why are people executing long running queries on the primary. They should be using a DB replica.
e-clinton超过 2 年前
Congrats on the launch. Curious to see what else is in store for this week.<p>Do I have to manually upgrade my old instances?
评论 #32991969 未加载
stunt超过 2 年前
What&#x27;s the benefit of running Postgres in Kubernetes vs VMs (with replication obviously)?
maxyurk超过 2 年前
did you consider <a href="https:&#x2F;&#x2F;www.pgbouncer.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.pgbouncer.org&#x2F;</a> ?
0xbadcafebee超过 2 年前
Ah, the &#x27;ol sunk cost fallacy of infrastructure. We are already investing in supporting K8s, so let&#x27;s throw the databases in there too. Couldn&#x27;t possibly be that much work.<p>Sure, a decade-old dedicated team at a billion-dollar multinational corporation has honed a solution designed to support hundreds of thousands of customers with high availability, and we could pay a little bit extra money to spin up a new database per tenant that&#x27;s a little bit less flexible, ..... or we could reinvent everything they do on our own software platform and expect the same results. All it&#x27;ll cost us is extra expertise, extra staff, extra time, extra money, extra planning, and extra operations. But surely it will improve our product dramatically.
评论 #32987473 未加载
评论 #32987404 未加载
评论 #32987248 未加载
评论 #32987444 未加载