Merkle Trees — Not Just For Blockchains
(Apologies, I couldn’t resist the image/pun).
Regardless, you know that hash trees have been used to validate data (since, well, 1979 I guess) in all sorts of arena, from databases like Cassandra, Dynamo, and Riak, to version control systems like git and subversion, to a host of file systems. They weren’t invented just for Bitcoin
Anyhow, here’s another nifty use case — using merkle trees to do immutable deploys of websites at Netlify.
Why immutable deploys? A bunch-a reasons, including
• atomic deploys and instant rollbacks,
• the ability to accurately preview deploys (by dereferencing the name from the content, you just point the name at the new hash behind the scene),
• split testing (transparently routing requests to different versions of the site),
and a whole bunch more.
Why immutable deploys? A bunch-a reasons, including
• atomic deploys and instant rollbacks,
• the ability to accurately preview deploys (by dereferencing the name from the content, you just point the name at the new hash behind the scene),
• split testing (transparently routing requests to different versions of the site),
and a whole bunch more.
The way they do this is pretty nifty
- • They identify and store all files based on the hashes of the content (not the names!)
- • A deploy is based on a merkle-tree based on the changed content (change two files? That’s your deploy)
- • The deploy is done by swapping out the new tree for the old tree. Need to revert? Reverse the swap!
It’s all pretty nifty — check out this writeup for more details!
Comments