Using TLA+ for fun and profit in the development of ElasticSearch [video]
youtube.com
youtube.com
The sheer number of configurable options for the cluster bringup, index setup, plugable components turns it into a very hard to tame beast. There is an opportunity here somewhere for someone to make Elasticsearch on Rails (convention over configuration). With 7.x, I feel the time is just abt right to try something like that.
What excites me most abt 7.x is the overhaul of underlying distributed engine that's been going on for over 2yrs [2] that will enable a whole slew of super nice features [3] that'd put it on par with state-of-the-art distributed databases in terms of not only features but resiliency.
[0] https://www.elastic.co/guide/en/elasticsearch/resiliency/cur...
[1] https://www.microsoft.com/en-us/research/publication/pacific...
[2] https://github.com/elastic/elasticsearch/issues/10708
[3] https://www.elastic.co/blog/elasticsearch-sequence-ids-6-0
I'm not an expert on it, but I've worked with it some to verify distributed systems at a FAANG company (with the oversight of real experts)--so it does get used there!
An example would be encoding a distributed locking system, with an invariant saying "no lock is owned by more than 1 node at a time". You would encode all of the locking and unlocking behavior in your state machine, and then the checker would verify it.
In practice this is not done. Perhaps never done. I know of only one toy example that you could maybe extend to do this. TLA+ is meant to double-check design level questions and intuitions rather than code level or implementation level ones. That is it attempts to give guidance on whether a design is flawed rather than whether an implementation successfully follows a specified design.
This may sound limiting, but the fact that this is an artifact completely separate from code makes TLA+ much more attractive from a business risk perspective in my opinion.
Wayne also has a great blog: https://www.hillelwayne.com
Btw, not all great technology finds adoption at the FAANGs. At least Facebook and Google tend to be quite insular: they certainly don't frown on open source, but it must be something that can be assimilated into the worldview of hulking monorepos, company IDEs and tools teams.
To put it another way: if Facebook/Google are giant Borg cubes, then TLA+ is a clever little Vulcan ship applying pure logic to stay in the game.
i suggest spending a few hours with author's own video course: https://lamport.azurewebsites.net/video/videos.html
it is generally useful, what it doesn't do is emit working prototypes.