Distributed system is slower than a laptop
codegood.co
codegood.co
I run a few VMs in a “homelab”. Was interested in redundancy so could work on system without taking down home networking… Familiar with GlusterFS, corosync/pacemaker, etc…
So to go from one system to 2, need a third system to at least ensure quorum.
Of course, storage has the same problem.
Active-active has its complexities. Maybe active-standby good enough with DRND. Still a lot to configure…
Filesystem replication now means my NVMe drives will be limited to 1Gbit/s networking link. 10GB somewhat difficult on SFF PC and expensive.
Physical location also matters. Standby probably should be somewhere else… But what about 3rd node? Wired networking not everywhere…
This ends up being a lot of moving parts, expense, and headache…
Guess what is fast? Single node. Move the storage drive to similar spare SFF PC. Two screws, takes about 3 minutes max. Local RAID-1 to guard against sudden failure… Backup a couple times a year for peace of mind.
It’s way too easy to overthink stuff…
It’s easier to make sense of the Linux kernel source despite being something like 30M lines of code.
I used to compare distributed system with freight trains vs F1 cars. But there are a ton of low latency distributed systems too like your LTE network.
The key factor is how much data is shared by how many endpoints. Having these two very high makes it for very hard problems. Like streaming high definition events to millions of people.
(modern server hardware and operating systems are also surprisingly reliable nowadays, which makes it harder to reach breakeven with a distributed design)
McSherry does a lot of interesting work on making monotonic/incremental distributed systems efficient (e.g. Differential and Timely Dataflow). Those kinds of systems scale much more linearly.
P.D: the business world is the one that needs AND tries everything, and most attempt to implement something is much worse than the simpler previous thing.
For most that I know and most I bet (even without knowing) add "high availability" or "warm standby" WILL CERTAINLY lead to worse availability.
In fact, the best setup for most people, and consider things from today (that you will see, not that different from mainframe days!):
- Single server on a *nix LTS/immutable distro with just the RDBMS + App backend, on decent hardware. Fast, lots of ram or whatever optional
- A true reliable backup system
- A decent network setup, ideally a VPN one for connect everybody, with good firewall, SSL and that is
More complex than this and is 90% certain is much worse, other 8% until the dude that do it and care leaves.
In the flip side:
> the problem with a single system is that mundane things cause unavailability
Is multiplied by each "system" you add. The basic failures are relative easy to deal and understand, the ones introduced by more complex system who knows?
Probably the most important step that I miss:
> How long would it take to procure a new server and restore from backup?
.. and applied to any complex extra you have.
For single system is viable (with something like nix) to go off for maybe half hour for what I see around, most of the time in procuring another machine (that what people do is to Bring any other machine it can not go to amazon and buy!) and restoring the backup.
Of course, I factoring that downtime is not "seconds or minutes" here, but neither I think many can do like that
P.D: all
> Is multiplied by each "system" you add
Was still the take away. The idea is the lost a single instance should cause downtown so it’s not multiplied. IE three instances of the database case tolerate a loss of a single instance for maintenance since the other two will take over the load.
There is of course an argument against the cost of this and sure I’d even accept the complexity argument since you probably need to add more tooling to manage the hand over but again the point of this complexity is specifically to avoid having a single point of failure / to naturally handle failure such that the possibility of downtime isn’t multiplied
Except the company probably approved a budget for AWS or another cloud provider, and basically gave a blank check to developers to deploy whatever is needed. So developers are going to just deploy MSK or whatever is trendy, instead of trying to get the most throughput from the servers they got from IT.
That happens at every level, from individual developers through to project leads and CTOs.
Consultancies are often no better. Choosing technologies that require substantial or highly specialised skill sets seems almost routine. I’m looking at you, Kubernetes.
I’m not entirely innocent here either. I owe a decent portion of my mortgage to MuleSoft consulting. That said, I don’t think I ever pretended it was always the best solution. Even while working directly for MuleSoft, my recommendation in probably half of the engagements was some variation of: ‘You’re using the wrong technology for this.’
But by then, an executive had usually tied their reputation to the project and the platform, commitments had been made, and changing course had become politically harder than continuing.
And so we persist.
In my experience, the best technology choices are boring ones. There’s still a large area of immature technology you can get creative with (like Backstage or Port for software catalogs and setting up a nice golden path”), but the meat and potatoes of development work should be a boring choice, that follows a well-tread path within a large ecosystem of developers.
There are exceptions, but they’re not for the majority of organisations.