Live data from Hacker News

Scaling Rails and Postgres to millions of users at Microsoft

stepchange.work

11–20 of 96 posts

Re: Scaling Rails and Postgres to millions of users at Microsoft

#12
post #8

I don't understand why you wouldn't just use Elixir/Phoenix if you need to scale?

I don't understand why you wouldn't use if you need to scale? /s

I mean, you could, but you'd be missing out on the Rails-esque nature of Elixir/Phoenix.

Re: Scaling Rails and Postgres to millions of users at Microsoft

#13
post #7

Postgres can be scaled vertically like Stackoverflow did. With cache on edge for popular reads if you absolutely must (but you most likely dont). 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) Seriously its so create scalable backend services with postgres…

Stack overflow absolutely had load balancers, and 9 web servers, and Redis caches. They also use 4 SQL servers, so not entirely vertical either. And they were only serving 500 requests a second on average (peak was probably higher).

Re: Scaling Rails and Postgres to millions of users at Microsoft

#14
post #7

Postgres can be scaled vertically like Stackoverflow did. With cache on edge for popular reads if you absolutely must (but you most likely dont). 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) Seriously its so create scalable backend services with postgres…

That works for the performance aspect, but doesn't address any kind of High Availability (HA).

There are definitely ways to make HA work, especially if you run your own hardware, but the point is that you'll need (at least) a 2nd server to take over the load of the primary one that died.

Re: Scaling Rails and Postgres to millions of users at Microsoft

#15
post #4

Earlier quoted context omitted.

Like many of the BSDs

Did Postgres used to be a BSD? Are they known for good documentation?

BSD was the Unix distribution; BSD and Postgres/Ingres development did overlap at UC Berkeley.

Re: Scaling Rails and Postgres to millions of users at Microsoft

#16
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.

[1] https://github.com/lfittl/activerecord-clean-db-structure/is...

Re: Scaling Rails and Postgres to millions of users at Microsoft

#17

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. [1] https://github.com/lfittl/activerecord-clean-db-structure/is...

Hi there! That's funny! This interview and those gem updates were unrelated. However both are part of the sweet spot for me of education, advocacy, and technical solutions for PostgreSQL and Ruby on Rails apps.

I hope you’re able to check out the podcast episode and enjoy it. Thanks for weighing in within the gem comments, and for commenting here on this connection. :)

Re: Scaling Rails and Postgres to millions of users at Microsoft

#18
post #7

Postgres can be scaled vertically like Stackoverflow did. With cache on edge for popular reads if you absolutely must (but you most likely dont). 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) Seriously its so create scalable backend services with postgres…

> One server What happens if this server dies?

Then your service is offline until you fix it. For many services a completely acceptable thing to happen once in a blue moon

Most would probably get two servers with a simple failover strategy. But on the other hand servers rarely die. At the scale of a datacenter it happens often, but if you have like six of them, buy server grade stuff and replace them every 3-5 years chances you won't experience any hardware issues

Re: Scaling Rails and Postgres to millions of users at Microsoft

#19
post #9

Earlier quoted context omitted.

They are excellent! Another great example is the Django project, which I always point to for how to write and structure great technical documentation. Working with Django/Postgres is such a nice combo and the standards of documentation and community are a huge part of that.

Interestingly I have had almost the exact opposite experience being very frustrated with the Django docs. To be fair, it could be because I'm frustrated with Django's design decisions having come from Rails. When learning Django a few years ago, I still carry a deep loathing against polymorphism (generic relations[0]), and model validations (full clean[1]), You know what - it's design decisions... [0] https://docs.dj…

generic relations are hard to get right, really if you can avoid using them you're going to avoid a lot of trickiness.

When you need them... it's nice to have them "just there", implemented correctly (at least as correctly as they can be in an entirely generic way).

Model validations is a whole thing... I think that Django offering a built-in auto-generated admin leads to a whole slew of differing decisions that end up coming back to be really tricky to handle.

Post reply on HN