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…
A lot of complex “scalable” systems can be done with a simple, single C++ server
301–310 of 376 posts
Re: A lot of complex “scalable” systems can be done with a simple, single C++ server
#302Earlier quoted context omitted.
The only point of using Python threads is to wait for I/O. Which, while limiting, is a huge use case, for network servers in particular.
Can't you also defer work to c extensions in threads?
Parallelism is possible, but only for computations in native code.
FWIW Node.js is essentially the same situation.
Re: A lot of complex “scalable” systems can be done with a simple, single C++ server
#303Earlier quoted context omitted.
Web servers are usually trivially horizontally scalable. You must have had significant in-memory shared state to encounter that problem. Right? Had you adopted a less stateful model, you'd have looked rather pretty with two Java servers.
> You must have had significant in-memory shared state to encounter that problem. Right? "Significant" is in the eye of the beholder. The core of the system was easy to make shardable. But you'd be surprised how many implicit assumptions creep in, how easy it is for ancillary parts to end up sharing state when it's easy. Also note that just because your state's in a database doesn't mean having two instances of the t…
Yes and no.
You'd need some ops work, but you'd need to worry a lot less about managing your infrastructure provisioning to keep costs low, e.g. reserved instances, dynamic scaling, etc. and putting out fires when you inevitable exceed your tight perf margins.
You could overprovision 24/7 by 50% and write it off. Your competitors couldn't.
Re: A lot of complex “scalable” systems can be done with a simple, single C++ server
#304Re: A lot of complex “scalable” systems can be done with a simple, single C++ server
#305Earlier quoted context omitted.
I'd like to see these 10 lines that supposedly avoid the problems with the GIL.
It still hits the problems, but it can still be better than single-threaded. That's the point of his comment. People say the GIL is bad so they throw the baby out with the bathwater and no longer use threads, which isn't very well-reasoned. Been a while since I've used Python, but as far as I remember the GIL only affects Python objects. So if you use Numpy for operations, you can avoid the GIL.
Correct.
Threads cannot help Python-heavy code; they can help I/O-heavy or native-heavy code (assuming native code releases the GIL).
Even without multithreading, numpy programming can give amazing speedups. It's the reason why data science Python isn't dead in the water.
Re: A lot of complex “scalable” systems can be done with a simple, single C++ server
#306From the next tweet in the thread: “JAVA [sic] or C# would also be close, and there are good reasons to prefer those over C++ for servers.”
Neither of these are usually the case for web application servers.
Re: A lot of complex “scalable” systems can be done with a simple, single C++ server
#307Earlier quoted context omitted.
Backend web development doesn't change much once developed. How many ways can one do CRUD on the backend?
Out of curiosity, have you ever actually been employed as a backend web developer?
Re: A lot of complex “scalable” systems can be done with a simple, single C++ server
#308Earlier quoted context omitted.
I'm starting to wonder if there is market to do "technology laundering", use things like PostgreSQL, SQLite, standard Unix tools, put it under some cloud marketing and charge a x10 premium. Or perhaps not only there is market, but that's more or less what everyone is already doing.
If you can set it up so it solves my problems, yes. I could manage my own server and fine tune everything, or I can throw it on snowflake. Snowflake means I've spent almost no time managing anything and it was costing less than an aws box running postgres but absolutely blew it out of the water performance wise. Depends on your workload but it's been perfect for one of my use cases. If they were just using postgres u…
Re: A lot of complex “scalable” systems can be done with a simple, single C++ server
#309Earlier quoted context omitted.
Backend web development doesn't change much once developed. How many ways can one do CRUD on the backend?
In my experience this is only true iff the system never gets any more user facing features. Every new non-insignificant feature requires a new REST-API route, or database table or modification of the GraphQL schema. And depending on how you designed the backend, even small redesigns of the frontend might require changes on the backend. Consider a simple app showing car rentals, where you initially have something like…
Re: A lot of complex “scalable” systems can be done with a simple, single C++ server
#310Earlier quoted context omitted.
You have 250GB of "raw" data stored in CSV format. The parsed version of this data in memory is likely to be a fraction of the on-disk size. A `long` or `double` only take up eight bytes in memory but 10-20 bytes on disk stored as ASCII in a CSV file. Even if your raw data was 250GB you could store it in memory mapped files. A fast SSD can easily hit a gigabyte per second sequential read speed, far faster than your t…
> A fast SSD can easily hit a gigabyte per second sequential read speed, far faster than your typical network. It's important to note that often your disks aren't directly attached to your compute. That's frequently the case in (particularly cheap) cloud instances.
It's also a domain where you can buy an off-the-shelf desktop for a few hundred dollars to do the work. That's the thrust of this whole thread, because scalable "cloud" systems exist and look cheap people obsess about throwing more instances at problems.
Modern commodity systems are ridiculously powerful and far more capable than people tend to assume. Even "the cloud" gets underestimated because people look at the low end cheap instances and assume they need to spin up hundreds of those when one beefy image for a short duration could do the same work.