TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Scaling Rails and Postgres to millions of users at Microsoft

202 pointsby htormey9 months ago

11 comments

pajeets9 months ago
Postgres can be scaled vertically like Stackoverflow did. With cache on edge for popular reads if you absolutely must (but you most likely dont).<p>No need to microservice or sync read replicas even (unless you are making a game). No load balancers. Just up the RAM and CPU up to TB levels for heavy real world apps (99% of you wont ever run into this issue)<p>Seriously its so create scalable backend services with postgrest, rpc, triggers, v8, even queues now all in Postgres. You dont even need cloud. Even a mildly RAM&#x27;d VPS will do for most apps.<p>got rid of redis, kubernetes, rabbitmq, bunch of SaaS tools. I just do everything on Postgres and scale vertically.<p>One server. No serverless. No microservice or load handlers. It&#x27;s sooo easy.
评论 #41386590 未加载
评论 #41388569 未加载
评论 #41386602 未加载
评论 #41438593 未加载
评论 #41389316 未加载
评论 #41386541 未加载
评论 #41396701 未加载
评论 #41387366 未加载
评论 #41389595 未加载
cdiamand9 months ago
I ran into some scaling challenges with Postgres a few years ago and had to dive into the docs.<p>While I was mostly living out of the &quot;High Availability, Load Balancing, and Replication&quot; chapter, I couldn&#x27;t help but poke around and found the docs to be excellent in general. Highly recommend checking them out.<p><a href="https:&#x2F;&#x2F;www.postgresql.org&#x2F;docs&#x2F;16&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;www.postgresql.org&#x2F;docs&#x2F;16&#x2F;index.html</a>
评论 #41385533 未加载
评论 #41384021 未加载
rubyfan9 months ago
15 years ago I worked on a couple of really high profile rails sites. We had millions of users with Rails and a single mysql instance (+memcached and nginx). Back then ruby was a bit slower than it is today but I’m certain some of the challenges you face at that scale are things people still do today…<p>1. try to make most things static-ish reads and cache generic stuff, e.g. most things became non-user specific HTML that got cached as SSI via nginx or memcached<p>2. move dynamic content to services to load after static-ish main content, e.g. comments, likes, etc. would be loaded via JSON after the page load<p>3. Move write operations to microservices, i.e. creating new content and changes to DB become mostly deferrable background operations<p>I guess the strategy was to do as much serving of content without dipping into ruby layer except for write or infrequent reads that would update cache.
teleforce9 months ago
Please check this excellent book by former Microsoft and Groupon engineer on scaling Rails and Postgres:<p>[1] High Performance PostgreSQL for Rails Reliable, Scalable, Maintainable Database Applications by Andrew Atkinson:<p><a href="https:&#x2F;&#x2F;pragprog.com&#x2F;titles&#x2F;aapsql&#x2F;high-performance-postgresql-for-rails&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pragprog.com&#x2F;titles&#x2F;aapsql&#x2F;high-performance-postgres...</a>
giovannibonetti9 months ago
What a small world. Earlier today I got tagged in a PR [1] where Andrew became the maintainer of a Ruby gem related to database migrations. Good to know he is involved in multiple projects in this space.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;lfittl&#x2F;activerecord-clean-db-structure&#x2F;issues&#x2F;33">https:&#x2F;&#x2F;github.com&#x2F;lfittl&#x2F;activerecord-clean-db-structure&#x2F;is...</a>
评论 #41386881 未加载
benwilber09 months ago
Postgres can scale to millions of users, but Rails definitely can&#x27;t. Unless you&#x27;re prepared to spend a ton of money.
评论 #41387632 未加载
cies9 months ago
My experience scaling up Rails (mostly in size of codebase NOT in size of traffic) really made me love typesafe languages.<p>IDE smartness (auto complete, refactoring), compile error instead of runtime, clear APIs...<p>Kotlin is a pretty nice &quot;Type-safe Ruby&quot; to me nowadays.
评论 #41399026 未加载
neonsunset9 months ago
This desperately needs the Walmart treatment of JET.com’s teams past acquisition :)
jojobas9 months ago
What&#x27;s Rails and Postgres? Do they mean ASP.NET and MS SQL Server?
评论 #41390342 未加载
djaouen9 months ago
I don&#x27;t understand why you wouldn&#x27;t just use Elixir&#x2F;Phoenix if you need to scale?
评论 #41387293 未加载
评论 #41394238 未加载
评论 #41386546 未加载
datadeft9 months ago
Scaling a non-scalabe by default framework that should have been few services written in a performance first language at a billion+ USD company.<p>I am not sure why are we boliling the oceans for the sake of a language like Ruby and a framework like Rails. I love those to death but Amazons approach is much better (or it used to be): you can&#x27;t make a service for 10.000+ users in anything else than: C++, Java (probably Rust as well nowadays).<p>For millions of users the CPU cost difference probably justifies the rewrite cost.
评论 #41393448 未加载
评论 #41388652 未加载
评论 #41388337 未加载
评论 #41389797 未加载