Live data from Hacker News

A lot of complex “scalable” systems can be done with a simple, single C++ server

twitter.com

171–180 of 376 posts

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#171
post #162

Earlier quoted context omitted.

But nobody in BigCo(tm) would do that, because everyone (including the executives) involved want to have Hadoop/BigData(tm) in their resume. /sarcasm

Its more like 'Here at BigCo, we do x because it scales. We have learned it from various incidents that we won't tell you about, but trust us we have to do it this way."

I've worked at BigCo. It's resume padding with the fear of looking like an idiot for not knowing about the new tech.

We were going to go all in on Snowflake with everyone on the team being for it. I sat down, read the original whitepaper, wrote a simulation of what the costs would look like with the current read/write statistics and tested a small batch of data on it to double check.

Turns out we would have paid between x500 to x10,000 what we were currently paying for using Postgres. I moved on three months ago, and last I heard they were trying to use Snowflake again.

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#172

You can choose a language that optimizes your hardware, or you can choose a language that optimizes your programmers. 99% of the time optimizing the programmers is the right call.

If you're using anything Hadoop related you're not optimizing programmers.

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#173

You can choose a language that optimizes your hardware, or you can choose a language that optimizes your programmers. 99% of the time optimizing the programmers is the right call.

this is the philosophy that brought us software like atom and slack

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#174

Earlier quoted context omitted.

They said read heavy, not read only. I guarantee you the bulk of traffic to SO is hitting a page and performing zero writes.

They log every single pageview to SQL Server. There are plenty of writes to various other counters, recommendation system, message inboxes, analytics, etc. Also the ads system, although I'm not sure how much of that is still 3rd-party. Yes it's read-heavy but there's still plenty of work done in assembling a page. It's definitely not as simple as caching at the CDN edge for every hit.

IIRC most of the "real time" stuff is done on Redis, for which this QPS load is usually a joke (depending on requests of course, but counters etc are easy)

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#175
post #111

Horizontal scalability carries a lot of overhead. Probably a factor of 10, easily. But the clue is in the name: eventually you'll get to a point where you have to scale. Back in 2010 I worked for a company whose system, in Java, ran on a single web server (with one identical machine for failover). We laughed at our nearest rivals, who were using Ruby, and apparently needed 60(!) machines to run their system, which ha…

Horizontally scaling a monolith web app has basically zero overhead. Both in app design and production complexity. But it can go decently far.

Only if you're assuming that the web app is entirely stateless. Which won't be the case unless it was deliberately designed that way.

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#177
post #78

As someone who has implemented a complex system in C++ in this decade, I’d say he’s not wrong, but you need to carefully weight the pros and cons. In our case latency and real time demands mattered a lot (NASDAQ feed parser), to the point of the (potential) slowdown of a garbage collector kicking in was enough to rule out Java and .NET. It runs entirely in memory and on 64+ cores. We implemented our own reference cou…

Memory management in modern C++ is considerably easier than it used to be. Bespoke memory managers aren't really needed, you can do almost anything you need to without ever using new or delete.

> Memory management in modern C++ is considerably easier than it used to be

It was never actually an issue

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#178
post #117

Earlier quoted context omitted.

Of course it's possible to write a horizontally scaled application in Java or C++. But once you have to deal with horizontal scaling anyway , language performance is much less of an advantage: as Carmack says, the difference between 100 servers and 10 is just accounting.

Spoken like an individual contributor far enough down the ladder to not have to worry about the bill.

In my experience it's the individual contributors who are overly obsessed with being elegant and efficient in their use of machine time. Those who are conscious of the bigger picture tend to have a more accurate sense of the relative costs of machine time versus engineering effort.

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#179
post #165

Earlier quoted context omitted.

Reddit threads are also much hotter for writing and have O(thousands) of replies.

Sure Reddit has more write activity but I don't see the number of replies being such a big factor. SO questions have answers, comments, tags, related questions, and many other secondary data to load. Reddit is slow due to poor architecture and a terrible frontend.

Old Reddit isn't slow. It seems to mostly be the new frontend.

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#180

Many developers severely underestimate how much workload can be served by a single modern server and high-quality C++ systems code. I've scaled distributed workloads 10x by moving them to a single server and a different software architecture more suited for scale-up, dramatically reducing system complexity as a bonus. The number of compute workloads I see that actually need scale-out is vanishingly small even in indu…

Can you expand on this? I have some pretty massive compute loads that need to be scaled onto a cluster with 100+ workers for most computations. This is after I use a library called dask that graphically does its own mapreduce optimisation inside its modules. This is all for a relatively small 250GB raw data file that I keep in a csv (and need to convert to SQL at some point). Are you saying this can be optimised to f…

I'm doing my PhD in HPC (part of my work is in situ stuff). One of the biggest problems is actually IO. But honestly, 250GB isn't that big. I haven't used dask, but I know people that do. I just avoid python for anything I need performance for, C++ is just always going to be faster.

Biased: you might want to look into DOE libraries. For IO I suggest ADIOS2 [0]. There's python bindings too.

One of the biggest things you can do is use a different storage type like BP (ADIOS) or hdf5. These are readable but binary. But to really determine how to speed up your problem you have to know where the bottleneck is. Is it IO or compute? With 100 workers (threads or nodes?) you aren't highly parallelized. I mean that could be a single node if it's threads.

[0] https://github.com/ornladios/ADIOS2

Post reply on HN