How skip lists work and why databases use them

Skip lists are used in redis and LSM-trees, delivering O(log n) lookups with less complexity than B-trees. This post explains how they work, why randomness is useful and why you might choose them over B-trees.