Live data from Hacker News

Stack Overflow is a cacheless, 9-server on-prem monolith

twitter.com

61–70 of 120 posts

Re: Stack Overflow is a cacheless, 9-server on-prem monolith

#61

Earlier quoted context omitted.

"Normal" sized services should be adequate enough for that purpose.

Microservices became a synonym for Services Orientated Architecture years ago. It's almost always relatively normal sized services split by functional area e.g. Auth, Cache etc.

I agree that it does among some. But the semantics of "MICRO-services" is that smaller is better and you can find those who take it to be smallest is bestest. You can't just assume the word "micro" is just a hanger on and isn't doing work convincing people of the virtue of super-small. Lots and lots of orgs and people fall into this trap. I've worked at them. I've argued with advocates in the professional sphere. All the time.

If it was literally just SOA, I wouldn't have issues with it as you can reasonable have conversations about where divisions should be placed. Maybe you are surrounded with more reasonable advocates, but that is not the norm in my experience.

When you have orgs assigning a team to build and maintain 20+ services... It's gone into full self destruct mode.

Re: Stack Overflow is a cacheless, 9-server on-prem monolith

#62
post #14

Even though I love their simplicity as an example of how to be pragmatic and not over-engineer, do remember that they’ve tuned their code to the point that they built an ORM that is one of the fastest in the NET world. I used it and it was awesomely lightweight. It’s as much an example of how far world class talent can go, as it is about doing more with less.

Right - Marc Gravell and Tim Craver, who worked on the core architecture of Stack Overflow, were both so obsessive about extracting performance from .net web applications that when they couldn’t do any more from the outside, they both quit and went to work for Microsoft on performance improvements in the framework itself. I feel like it’s similar to how people point to Craigslist as evidence that you can still build…

You don't, really. You can use Django or Perl today and just enable nginx caching for non authenticated users, for many applications.

Stack Overflow didn't need these optimizations. They could have just deployed 20 servers instead and still been profitable. People optimized just because they like to.

Re: Stack Overflow is a cacheless, 9-server on-prem monolith

#63
post #54

The best cache is the one built into the database. People seem to forget that the major rdbmses have sophisticated cache strategies of their own and that handing them more RAM (and ensuring they are configured to use it for query or other cache) is usually a good first strategy before trying to second guess and reinvent the cache outside the db. Thread says SO allocates 1.5TB RAM to SQL Server. Sounds wise.

Makes sense. Traditional RDBMSs are basically a buffer cache and a query optimization engine. If the data is sitting in memory, and you've tuned extracting the data from memory as fast as possible, job done.

Not just a RDBMSs. Any modern DB, document store, or kv store will use a buffer cache.

Re: Stack Overflow is a cacheless, 9-server on-prem monolith

#64
post #4

It is ironic that many questions on Stack Overflow are about various cloud services, hyped-up technologies, and problems caused by over-engineering.

I’m always puzzled when I’m using SO to help diagnose some obscure problem in my tech stack and I see a bunch of “hot questions” in the sidebar about whether dwarf armor can deflect magic bullets, or what the energy capacity of a Stormtrooper’s laser rifle is, etc.

Re: Stack Overflow is a cacheless, 9-server on-prem monolith

#65

The main takeaway is that the questions searched for are so widely distributed that there is no need for a cache layer - they are nothing but long tail. At that point there is no 'cloud' design that can help. Its either one database (or maybe just shard everything onto thousands of distributed nodes) But the point I am trying to make is that kubernetes and microservices etc are based on idea of winners - power laws.…

I mean, kubernetes or microservices don’t care how the data reads are distributed, right? That problem is a database-level thing whereas k8s is infrastructure, you can run any kind of database with any kind of sharding you want on it. I feel like it might be more accurate to say something like “the value of caching is based on the idea of winners” for example

Re: Stack Overflow is a cacheless, 9-server on-prem monolith

#66
post #4

It is ironic that many questions on Stack Overflow are about various cloud services, hyped-up technologies, and problems caused by over-engineering.

I’m always puzzled when I’m using SO to help diagnose some obscure problem in my tech stack and I see a bunch of “hot questions” in the sidebar about whether dwarf armor can deflect magic bullets, or what the energy capacity of a Stormtrooper’s laser rifle is, etc.

Not knocking any interest, just really curious that there is such a wide range of topics on there.

Re: Stack Overflow is a cacheless, 9-server on-prem monolith

#67
Please ignore my lack of understanding a bit here. I'm genuinely trying to learn.

I've always heard (and it made sense to me) that to reduce latency of requests from across the globe, you might want to have read replicas or caches spread on global infrastructure. Then how is it that stack overflow is fast here when the db is on-prem, 7 seas across from me? Any amount of RAM should not account for the distance, right?

Re: Stack Overflow is a cacheless, 9-server on-prem monolith

#68
post #14

Even though I love their simplicity as an example of how to be pragmatic and not over-engineer, do remember that they’ve tuned their code to the point that they built an ORM that is one of the fastest in the NET world. I used it and it was awesomely lightweight. It’s as much an example of how far world class talent can go, as it is about doing more with less.

Not to take anything away from Dapper (it's an excellent library), but it isn't really that much faster than EntityFramework anymore.

> EF Core 6.0 performance is now 70% faster on the industry-standard TechEmpower Fortunes benchmark, compared to 5.0.

> This is the full-stack perf improvement, including improvements in the benchmark code, the .NET runtime, etc. EF Core 6.0 itself is 31% faster executing queries.

> Heap allocations have been reduced by 43%.

> At the end of this iteration, the gap between Dapper and EF Core in the TechEmpower Fortunes benchmark narrowed from 55% to around a little under 5%.

https://devblogs.microsoft.com/dotnet/announcing-entity-fram...

Again, this isn't to take anything away from Dapper. It's a wonderful query library that lets you just write SQL and map your objects in such a simple manner. It's going to be something that a lot of people want. Historically, Entity Framework performance wasn't great and that may have motivated StackOverflow in the past. At this point, I don't think EF's performance is really an issue.

If you look at the TechEmpower Framework Benchmarks, you can see that the Dapper and EF performance is basically identical now: https://www.techempower.com/benchmarks/#section=data-r21&l=z.... One fortunes test is 0.8% faster for Dapper and the other is 6.6% faster. For multiple queries, one is 5.6% faster and the other is 3.8% faster. For single queries, one is 12.2% faster and the other 12.9% faster. So yes Dapper is faster, but there isn't a huge advantage anymore - not to the point that one would say StackOverflow has tuned their code to such an amazing point that they need substantially less hardware. If they swapped EF in, they probably wouldn't notice much of a difference in performance. In fact, in the real world where apps, the gap between them is probably going to end up being less.

If we look at some other benchmarks in the community, they tell a similar story: https://github.com/FransBouma/RawDataAccessBencher/blob/mast...

In some tests, EF actually edges past Dapper since it can compile queries in advance (which just means calling `EF.CompileQuery(myQuery)` and assigning that to a static variable that will get reused.

Again, none of this is to take away from Dapper. Dapper is a wonderful, simple library. In a world where there's so many painful database libraries, Dapper is great. It shows wonderful care in its design. Entity Framework is great too and performance isn't really an interesting distinction. I love being able to use both EF and Dapper and having such amazing database access options.

Re: Stack Overflow is a cacheless, 9-server on-prem monolith

#70

Earlier quoted context omitted.

I’m always puzzled when I’m using SO to help diagnose some obscure problem in my tech stack and I see a bunch of “hot questions” in the sidebar about whether dwarf armor can deflect magic bullets, or what the energy capacity of a Stormtrooper’s laser rifle is, etc.

Not knocking any interest, just really curious that there is such a wide range of topics on there.

Those are not Stack Overflow questions. Stack Overflow is strictly for programming questions. They are from other sites that are also part of Stack Exchange.
Post reply on HN