News for hackers. Stuff that matters.
Re:NVMe is not a hard disk by tyingq on Friday June 11, 2021 @12:50PM (#27475666)
"most database-like applications do their redundancy themselves, at the application level, so that...storage replication in distributed storage...is not only useless, but actively undesirable"

I do believe that's been the author's experience. However, I think he may be unaware that's not everyone's...or even most people's, experience.

Re:NVMe is not a hard disk by walrus01 on Friday June 11, 2021 @01:04PM (#27475828)
My biggest take away from this is "I certainly hope this person isn't responsible for actually designing the bare metal storage infrastructure meant to underly something important". They seem to be operating from the premise that data replication at the 'cloud' level can solve all their problems.
Re:NVMe is not a hard disk by ahupp on Friday June 11, 2021 @01:47PM (#27476379)
Not sure what to say, but this is how it works on all the large systems I'm familiar with.

Image you have two servers, each with two 1TB disks (4TB physical storage). And you have two distinct services with 1TB datasets, and want some storage redundancy.

One option is to put each pair of discs in a RAID-1 configuration, and so each RAID instance holds one dataset. This protects against a disk failure, but not against server or network failures.

Your other option is to put one copy of the dataset on each server. Now you are protected from the failure of any single disk, server, or the network to that server.

In both cases you have 2TB of logical storage available.

Re:NVMe is not a hard disk by wafflespotato on Friday June 11, 2021 @04:32PM (#27478113)
you're putting yourself at risk of split-brain though (or downtime due to fail-over (or the lack of it)).

In either case what you're describing isn't really the 'cloud' alternative.

Re:NVMe is not a hard disk by dan_quixote on Friday June 11, 2021 @05:05PM (#27478485)
Yeah, that's a complication/cost of HA that a significant portion of industry has long accepted. Everywhere I've been in the last 5 years has had this assumption baked in across all distributed systems.
Re:NVMe is not a hard disk by nightfly on Friday June 11, 2021 @05:49PM (#27478918)
Where possible, my organization tries and have services deployed in sets of three (and try and require a quorum) to reduce/eliminate split-brain situations. And we're very small scale.
Re:NVMe is not a hard disk by 411111111111111 on Friday June 11, 2021 @01:23PM (#27476065)
I think you're giving him too little credit there.

The parents point is really spot on though: most websites aren't at scale where every stateful api has redundant implementations. But the author's point does have merit: inevitably, something goes wrong with all systems - and when it does, your system goes down if you trust your HA config to work. If you actually did go for redundant implementations, your users likely aren't even gonna notice anything went wrong.

It's however kinda unsustainable to maintain unless you have a massive development budget

Re:NVMe is not a hard disk by alisonkisk on Friday June 11, 2021 @01:55PM (#27476477)
But why is his layer the only correct layer for redundancy?

He's also doing wasted work his redundancy has bugs that a consumer has to worry about working around.

Re:NVMe is not a hard disk by 411111111111111 on Friday June 11, 2021 @02:31PM (#27476920)
We're currently quite off-topic if i'm honest.

I think the author was specifically talking about RAID-1 redundancy and is advocating that you can leave your systems with RAID-0 (so no redundant drives in each server), as you're gonna need multiple nodes in your cluster anyway... so if any of your systems disks break, you can just let it go down and replace the disk while the node is offline.

but despite being offtopic: redundant implementations are -from my experience - not used in a failover way. they're active at all times and load is spread if you can do that, so you'd likely find the inconsistencies in the integration test layer.

Re:NVMe is not a hard disk by rbanffy on Friday June 11, 2021 @04:15PM (#27477911)
> not used in a failover way.

Aurora works like that. Read replicas are on standby and become writable when the writable node dies or is replaced. They can be used, of course, but so can other standby streaming replicas.

Re:NVMe is not a hard disk by smueller1234 on Friday June 11, 2021 @04:18PM (#27477934)
I'm not the original author but I used to work with him and now do in storage infrastructure at Google. As others pointed out, what the author, Kris, writes kind of implies/requires a certain scale of infrastructure to make sense. Let me try to provide at least a little bit of context:

The larger your infrastructure, the smaller the relative efficiency win that's worth pursuing (duh, I know, engineering time costs the same, but the absolute savings numbers from relative wins go up). That's why an approach along the lines of "redundancy at all levels" (raid + x-machine replication + x-geo replication etc) starts becoming increasingly worth streamlining.

Another, separate consideration is types of failures you have to consider: an availability incident (temporary unavailability) vs. durability (permanent data loss). And then it's worth considering that in the limit to long durations, an availability incident will become the same as a durability incident. This is contextual: To pick an obvious/illustrative example, if your Snapchat messages are offline for 24h, you might as well have lost the data instead.

Now, machines fail, of course. Doing physical maintenance (swapping disks) is going to take significant, human time scales. It's not generally tolerable for your data to be offline for that long. So local RAID barely helps at all. Instead, you're going to want to make sure your data stays available despite a certain rate of machine failure.

You can now make similar considerations for different, larger domains. Network, power, building, city/location, etc. They have vastly different failure probabilities and also different failure modes (network devices failing is likely an availability concern, a mudslide into your DC is a bit less likely to recover). Depending on your needs, you might accept some of these but not others.

The most trivial way to deal with this is to simply make sure you have a replica of each chunk of data in multiple of each of these kinds of failure zones. A replica each on multiple machines (pick the amount of redundancy you need based on a statistical model from component failure rates), a replica each on machines under different network devices, on different power, in different geographies, etc.

That's expensive. The next most efficient thing would be to use the same concept as RAID (erasure codes) and apply that across a wider scope. So you basically get RAID, but you use your clever model of failure zones for placement.

This gets a bit complicated in practice. Most folks stick to replicas. (Eg. last I looked, for example HDFS/Hadoop only supported replication, but it did use knowledge of network topology for placing data.)

The reason why you don't want to do this in your application is because it's really kinda complicated. You're far more likely to have many applications than many storage technologies (or databases).

Now, at some point of infrastructure size or complexity or team size it may make sense to separate your storage (the stuff I'm talking about) from your databases as well. But as Kris argues, many common databases can be made to handle some of these failure zones.

In any case, that's the extremely long version of an answer to your question why you'd handle redundancy in this particular layer. The short answer is: Below this layer is too small a scope or with too little meta information. But doing it higher in the stack fails to exploit a prime opportunity to abstract away some really significant complexity. I think we all know how useful good encapsulation can be! You avoid doing this in multiple places simply because it's expensive.

(Everything above is common knowledge among storage folks, nothing is Google specific or otherwise it has been covered in published articles. Alas, the way we would defend against bugs in storage is not public. Sorry.)

Re:NVMe is not a hard disk by sterlind on Friday June 11, 2021 @09:21PM (#27480484)
Erasure codes are indeed a great illustration of the scale concept. If your designing to tolerate 2 simultaneous failures with 3 drives you need RAID-1 with N=3, 3x the cost of a single copy. If you have 15 drives you can do 12-of-15 erasure coding which is only 1.25x the cost of a single copy.
Re:NVMe is not a hard disk by isotopp on Friday June 11, 2021 @03:42PM (#27477582)
If you are not running a database at home, you have the database in a replication setup.

That provides capacity, but also redundancy. Better redundancy than at the disk level - fewer resources are shared.

https://blog.koehntopp.info/2021/03/24/a-lot-of-mysql.html Here is how we run our datatbases.

Re:NVMe is not a hard disk by tyingq on Friday June 11, 2021 @04:56PM (#27478377)
"If you are not running a database at home, you have the database in a replication setup."

That's one of the perceptions I'm saying isn't always true. Especially in big, non-tech companies that have a mish-mash of crazy legacy stuff. Traditional H/A disks and backups still dominate some spaces.

Re:NVMe is not a hard disk by AstralStorm on Saturday June 12, 2021 @11:51AM (#27485260)
Backups that are easily restored trump replication for so many cases and much more cheaply. High availability is overrated when you have spare preconfigured commodity hardware you can spin up in minutes, which is often perfectly acceptable human time scale. You really don't need the other insurance running all the time - that only makes it more fragile.

Only really huge services would care about downtime of this degree, or horizontal scaling.

Re:NVMe is not a hard disk by isotopp on Monday June 14, 2021 @03:28AM (#27500196)
> Backups that are easily restored trump replication for so many cases and much more cheaply

At 400 MB/s, you restore a terabyte in 45 minutes, and then you need to replay the changes that happened since the backup (in MySQL: replay the binlog), which will take aproximately another 15 minutes.

"One hour of MTTR or provisioning time per Terabyte of data at 400 MB/s sustained linear I/O speed" is a useful rule of thumb.

Having a replica that you can promote reduces that to seconds. Having a time delayed replica where you just roll forward the binlog reduces that to minutes.

You can work with modern databases without using replication, but that in most cases just shows you suck at operations.

Re:NVMe is not a hard disk by Spooky23 on Friday June 11, 2021 @04:32PM (#27478103)
Agreed. It depends on what you do.

When I ran large-scale Exchange and database systems, we would always get into big fights with the storage people, who believed that SAN disk with performance tiering, replication, etc was the way to solve all problems.

The problem at the time was that the fancy storage cost $40+ Gb/mo and performed like hot garbage because the data didn’t tier well. For email, the “correct” answer in 2010 was local disk or dumb sas arrays with exchange dag.

For databases, the answer was “it depends”. Often it made sense to use the SAN and replication at that layer.

Re:NVMe is not a hard disk by lurkerasdfh8 on Friday June 11, 2021 @01:32PM (#27476194)
Even if the author assumptions are true and valid, this is like saying mirroring RAID is a safe backup option :)

it is not. if you have 10 DB hosts with the same brand of nvme, and they fail under a workload, what good is it that you have 10 hot-hot failover hosts? you just bought yourself a few days, or hours if you are specially unlucky and using consumer grade.

Re:NVMe is not a hard disk by tyingq on Friday June 11, 2021 @01:35PM (#27476236)
Yep. Mirroring happily mirrors mistakes very well, and very quickly.
Re:NVMe is not a hard disk by alisonkisk on Friday June 11, 2021 @01:46PM (#27476360)
Replication also replicates mistakes.
Re:NVMe is not a hard disk by isotopp on Friday June 11, 2021 @03:08PM (#27477282)
Correct.

For that you have time delayed replicas and of course backups. But time delayed replicas are usually much faster to restore than a backup.