25 comments

  • maxtaco28 minutes ago
    Backpointers to earlier epochs in append-only cryptographic data structures like key transparency logs. If the client last fetched epoch 1000, and the server reports the current epoch is 3000, the server can return log(2000) intermediate epochs, following skip pointers, to provide a hash chain from epoch 3000 to 1000.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;foks-proj&#x2F;go-foks&#x2F;blob&#x2F;main&#x2F;lib&#x2F;merkle&#x2F;bits.go#L13" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;foks-proj&#x2F;go-foks&#x2F;blob&#x2F;main&#x2F;lib&#x2F;merkle&#x2F;bi...</a> <a href="https:&#x2F;&#x2F;github.com&#x2F;foks-proj&#x2F;go-foks&#x2F;blob&#x2F;main&#x2F;lib&#x2F;merkle&#x2F;client.go#L465" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;foks-proj&#x2F;go-foks&#x2F;blob&#x2F;main&#x2F;lib&#x2F;merkle&#x2F;cl...</a>
  • cremer10 hours ago
    Redis sorted sets are probably the most widely deployed example. Redis uses a skiplist for range queries and ordered iteration paired with a hash table for O(1) lookups. Together they cover the full API at the right complexity for each operation<p>Skiplists also win over balanced BSTs when it comes to concurrent access. Lock-free implementations are much simplier to reason about and get right. ConcurrentSkipListMap has been in the standard library since Java 6 for exactly this reason and it holds up well under high contention
    • antirez6 hours ago
      Yep, and it was simple in Redis to augment them with the &quot;span&quot; in order to support ranking, that is, given al element, tell me its position in the ordered collection.
    • maerF0x043 minutes ago
      A source: <a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;46841708" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;46841708</a>
    • ignoramous3 hours ago
      &gt; <i>Skiplists also win over balanced BSTs when it comes to concurrent access.</i><p>Balanced Skiplists search better than plain Skiplists which may skew (but balancing itself is expensive). Also, I&#x27;ve have found that finger search (especially with doubly-linked skiplist with million+ entries) instead of always looking for elements from the root&#x2F;head is an even bigger win.<p>&gt; <i>ConcurrentSkipListMap has been in the standard library since Java 6 for exactly this reason and it holds up well under high contention</i><p>An amusing observation I lifted from OCaml&#x27;s implementation (which inturn quotes Donald Knuth): MSBs of PRNG values have more &quot;randomness&quot; than LSBs (randomness affects &quot;balance&quot;): <a href="https:&#x2F;&#x2F;github.com&#x2F;ocaml&#x2F;ocaml&#x2F;blob&#x2F;389121d3&#x2F;runtime&#x2F;lf_skiplist.c#L86" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ocaml&#x2F;ocaml&#x2F;blob&#x2F;389121d3&#x2F;runtime&#x2F;lf_skip...</a><p>---<p>Some neat refs from our codebase:<p>- <i>Skip lists: Done right</i> (2016), <a href="https:&#x2F;&#x2F;ticki.github.io&#x2F;blog&#x2F;skip-lists-done-right" rel="nofollow">https:&#x2F;&#x2F;ticki.github.io&#x2F;blog&#x2F;skip-lists-done-right</a> &#x2F; <a href="https:&#x2F;&#x2F;archive.is&#x2F;kwhnG" rel="nofollow">https:&#x2F;&#x2F;archive.is&#x2F;kwhnG</a><p>- <i>An analysis of skip lists</i>, <a href="https:&#x2F;&#x2F;eugene-eeo.github.io&#x2F;blog&#x2F;skip-lists.html" rel="nofollow">https:&#x2F;&#x2F;eugene-eeo.github.io&#x2F;blog&#x2F;skip-lists.html</a> &#x2F; <a href="https:&#x2F;&#x2F;archive.is&#x2F;ffCDr" rel="nofollow">https:&#x2F;&#x2F;archive.is&#x2F;ffCDr</a><p>- <i>Skip lists</i>, <a href="http:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20070212103148&#x2F;http:&#x2F;&#x2F;eternallyconfuzzled.com&#x2F;tuts&#x2F;datastructures&#x2F;jsw_tut_skip.aspx" rel="nofollow">http:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20070212103148&#x2F;http:&#x2F;&#x2F;eternallyco...</a> &#x2F; <a href="https:&#x2F;&#x2F;archive.is&#x2F;nl3G8" rel="nofollow">https:&#x2F;&#x2F;archive.is&#x2F;nl3G8</a>
  • ozgrakkurt7 hours ago
    Some more links that are inside the article:<p>- More info about skiplists: <a href="https:&#x2F;&#x2F;arxiv.org&#x2F;pdf&#x2F;2403.04582" rel="nofollow">https:&#x2F;&#x2F;arxiv.org&#x2F;pdf&#x2F;2403.04582</a><p>- Performance comparison with B-tree ?: <a href="https:&#x2F;&#x2F;db.cs.cmu.edu&#x2F;papers&#x2F;2018&#x2F;mod342-wangA.pdf" rel="nofollow">https:&#x2F;&#x2F;db.cs.cmu.edu&#x2F;papers&#x2F;2018&#x2F;mod342-wangA.pdf</a><p>- Other blog from Anthithesis about writing their own db: <a href="https:&#x2F;&#x2F;antithesis.com&#x2F;blog&#x2F;2025&#x2F;testing_pangolin&#x2F;" rel="nofollow">https:&#x2F;&#x2F;antithesis.com&#x2F;blog&#x2F;2025&#x2F;testing_pangolin&#x2F;</a><p>Also I find it a bit hard to understand the performance outcome of this setup.<p>I know formats like parquet and databases like ClickHouse work better when duplicating data instead of doing joins. I guess BigQuery is similar.<p>The article is great but would be also interesting to learn how performance actually worked out with this.
    • nz2 hours ago
      Back in 2014, I did an analysis of (single threaded) CPU-efficiency and RAM-efficiency of various data-structures (skiplists, slablists, avl-trees, rb-trees, b-trees):<p><a href="https:&#x2F;&#x2F;nickziv.wordpress.com&#x2F;wp-content&#x2F;uploads&#x2F;2014&#x2F;02&#x2F;vis_ds.pdf" rel="nofollow">https:&#x2F;&#x2F;nickziv.wordpress.com&#x2F;wp-content&#x2F;uploads&#x2F;2014&#x2F;02&#x2F;vis...</a><p>I used whatever I could find on the internet at the time, so the comparison compares both algorithm and implementation (they were all written in C, but even slight changes to the C code can change performance -- uuavl performs much better than all other avl variants, for example). I suspect that a differently-programmed skip-list would not have performed quite so poorly.<p>The general conclusion from all this, is that any data-structure that can organize itself _around_ page-sizes and cache-sizes, will perform very well compared to structures that cannot.
  • carlsverre5 hours ago
    (I used to work at SingleStore, and now work at Antithesis)<p>SingleStore (f.k.a. MemSQL) used lock-free skiplists extensively as the backing storage of their rowstore tables and indexes. Adam Prout (ex CTO) wrote about it here: <a href="https:&#x2F;&#x2F;www.singlestore.com&#x2F;blog&#x2F;what-is-skiplist-why-skiplist-index-for-memsql&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.singlestore.com&#x2F;blog&#x2F;what-is-skiplist-why-skipli...</a><p>When SingleStore added a Columnar storage option (LSM tree), L0 was simply a rowstore table. Since rowstore was already a highly optimized, durable, and large-scale storage engine, it allowed L0 to absorb a highly concurrent transactional write workload. This capability was a key part of SingleStore&#x27;s ability to handle HTAP workloads. If you want to learn more, take a look at this paper which documents the entire system end-to-end: <a href="https:&#x2F;&#x2F;dl.acm.org&#x2F;doi&#x2F;10.1145&#x2F;3514221.3526055" rel="nofollow">https:&#x2F;&#x2F;dl.acm.org&#x2F;doi&#x2F;10.1145&#x2F;3514221.3526055</a>
    • reitzensteinm1 hour ago
      At the intersection of these two topics, does Antithesis have any capabilities around simulating memory ordering to validate lock free algorithms?
  • josephg12 hours ago
    For this problem, I’d consider a different approach. You have a fuzzer, and based on some seed it’s generating lots of records. You then need to query a specific record (or set of records) based on the leaf.<p>I’d just store a table of records with the leaf, associated with the seed. A good fuzzer is entirely deterministic. So you should be able to regenerate the entire run from simply knowing the seed. Just store a table of {leaf, seed}. Then gather all the seeds which generated the leaf you’re interested in and rerun the fuzzer for those seeds at query time to figure out what choices were made.
    • _dain_7 hours ago
      (I work at Antithesis)<p>Yes, this is (more or less) how we regenerate the system state, when necessary. But keep in mind that the fuzzing target is a network of containers, plus a whole Linux userland, plus the kernel. And these workloads often run for many minutes in each timeline. Regenerating the entire state from t=0 would be far too computationally intensive on the &quot;read path&quot;, when all you want are the logs leading up to some event. We only do it on the &quot;write path&quot;, when there&#x27;s a need to interact with the system by creating new branching timelines. And even then, we have some smart snapshotting so that you&#x27;re not always paying the full time cost from t=0; we trade off more memory usage for lower latency.<p>Oh one other thing: the &quot;fuzzer&quot; component itself is not fully deterministic. It can&#x27;t be, because it also has to forward arbitrary user input into the simulation component (which <i>is</i> deterministic). If you decide to rewind to some moment and run a shell command, that&#x27;s an input which can&#x27;t be recovered from a fixed random seed. So in practice we explicitly store all the inputs that were fed in.
  • bob102912 hours ago
    On practical machines they aren&#x27;t good for much. To access a value in a skip list you have to dereference way more pointers than in a b+ tree. On paper they&#x27;re about the same, but in practice the binary tree will tend to outperform. You get way more work done per IO operation.
    • marginalia_nu9 hours ago
      Skiplists are designed for fast intersection, not for single value lookup (assuming a sane design that&#x27;s not based on linked lists, that&#x27;s just an educational device that&#x27;s never used in practice).<p>They are extremely good at intersections, as you can use the skip pointers in clever ways to skip ahead and eliminate whole swathes of values. You can kinda do that with b-trees[1] as well, but skip lists can beat them out in many cases.<p>It&#x27;s highly dependent on the shape of the data though. For random numbers, it&#x27;s probably an even match, but for postings lists and the like (where skiplists are often used), they perform extremely well as these often have runs of semiconsecutive values being intersected.<p>[1] I&#x27;ll argue that if you squint a bit, a skiplist arguably <i>is</i> a sort of degenerate b-tree.
      • torginus5 hours ago
        I don&#x27;t understand how they differ in this regard from range trees, which they essentially are, just their method of construction is different.<p>Things like BSP trees are very good at intersections indeed, and have been used for things since time immemorial, but I think the skiplist&#x2F;tree tradeoff is not that different in this domain.
  • ahartmetz14 hours ago
    Skiplists have some nice properties - the code is fairly short and easy to understand, for one. Qt&#x27;s QMap used to be skip list based, here&#x27;s the rationale given for it: <a href="https:&#x2F;&#x2F;doc.qt.io&#x2F;archives&#x2F;qq&#x2F;qq19-containers.html#associativecontainers" rel="nofollow">https:&#x2F;&#x2F;doc.qt.io&#x2F;archives&#x2F;qq&#x2F;qq19-containers.html#associati...</a>
    • dwdz9 hours ago
      It seems like Qt went from red-black tree to skip list in Qt4 and back to red-black tree in Qt5.
      • torginus5 hours ago
        yeah it turns out that complex code, when its properly encapsulated and implemented in a bug-free manner, is not such a cost after all.<p>A correct skiplist is easier to NIH than a correct red-black tree (which for me was the final boss of the DS class in college), but has performance edge cases a red-black tree doesnt, if you treat it like a search tree.
        • ahartmetz1 hour ago
          I think it was more about binary size. There are a few sentences in the Qt containers documentation about them being &quot;optimized to minimize code expansion&quot;.
  • winwang13 hours ago
    Only somewhat related but there is supposedly a SIMD&#x2F;GPU-friendly skiplist algo written about here: <a href="https:&#x2F;&#x2F;csaws.cs.technion.ac.il&#x2F;~erez&#x2F;Papers&#x2F;GPUSkiplist.pdf" rel="nofollow">https:&#x2F;&#x2F;csaws.cs.technion.ac.il&#x2F;~erez&#x2F;Papers&#x2F;GPUSkiplist.pdf</a>
  • mrjn14 hours ago
    skiplists form the basis of in-memory tables used by LSM trees, which are themselves the basis of most modern DBs (written post 2005).
  • teiferer12 hours ago
    In the age of agentic programming and the ever increasing pressure to ship faster, I&#x27;m afraid this kind of knowledge will become more and more fringe, even moreso than it is today. Who has the time to think through the intricacies of parallel data structures? Clearly we&#x27;ll just throw more hardware at problems, write yet another service&#x2F;api&#x2F;http endpoint and move on to the next hype. The LLM figures out the algorithms and we soon lose the skills to develop new ones. And tell each other the scifi BS myth that &quot;AI&quot; will invent new data structures in the future so we don&#x27;t even beed humans in the loop.
    • Andys10 minutes ago
      Or..? A golden era for people who want to think of new things and test out their ideas quickly by having AI code it up.
    • boricj11 hours ago
      AI is like a genie: be careful what you wish for or you&#x27;ll get what you asked for.<p>Lately at work I&#x27;ve done C++ optimization tricks like inplace_map, inplace_string, placement new to inline map-like iterators inside a view adapter&#x27;s iterators and putting that byte buffer as the first member of the class to not incur std::max_align_t padding with the other members. At a higher architecture level, I wrote a data model binding library that can serialize JSON, YAML and CBOR documents to an output iterator one byte at a time without incurring heap allocation in most cases.<p>This is because I work on an embedded system with 640 KiB of SRAM and given the sheer amount of run-time data it will have to handle and produce, I&#x27;m wary not only about heap usage, but also heap fragmentation.<p>AI will readily identify such tricks, it can even help implement them, but unless constrained otherwise AI will pick the most expedient solution that answers the question (note that I didn&#x27;t say <i>answers the problem</i>).
      • hakanderyal11 hours ago
        This is also the reason why we have two polar opposite views on AI. “Slop generator” vs “Next best thing since sliced bread”.<p>With SOTA models it all depends on how you drive them.
        • timeinput3 hours ago
          All my old software before AI was self documenting and didn&#x27;t need comments -- it just was obvious. Today my prompts never make slop. I&#x27;m a really good driver.
    • ozgrakkurt7 hours ago
      People underestimate the effect of knowledge accumulation that happens when learning from high quality sources imo.<p>LLMs aren&#x27;t even close to the level of knowledge distillation capacity a human has yet.
    • dgb2312 hours ago
      I think the opposite is the case. We increasingly need to care more about performance and know how to leverage hardware better.<p>The market is telling us that through increased hardware prices.<p>LLMs being very powerful means that we need to start being smarter about allocating resources. Should chat apps really eat up gigabytes of RAM and be entitled to cores, when we could use that for inference?
  • tooltower13 hours ago
    In my personal projects, I&#x27;ve used it to insert&#x2F;delete transactions in a ledger. I wanted to be able to update&#x2F;query the account balance fast. Like the article says, &quot;fold operations&quot;.
  • medbar9 hours ago
    Skiplist operations are local for the most part, which makes it easier to write thread-safe code for than b-trees in practice. Anecdotally, they were a nice implementation problem for my Java class in uni. But I liked working with b-lists more.<p>Skip trees&#x2F;graphs sound interesting, but I can&#x27;t think of any use case for them off the top of my head.
  • shawn_w11 hours ago
    Random access with similar performance to a balanced binary tree, and ordered iteration as simple as a linked list. It&#x27;s a nice combination. (Of course, so is a binary search of a sorted array, which I lean more towards these days unless doing a lot of random insertions and deletions throughout the life of the mapping).
  • aaa_aaa9 hours ago
    Almost nothing. My friend and I used it once (in a rather obscure problem). Then used simple lists with some tricks with better performance because of the locality etc.
    • random32 hours ago
      You and your friend seem to make a dream team.
  • torginus5 hours ago
    &gt;What are skiplists good for<p>In practice, I have found out, nothing much. Their appeal comes from being simpler to implement than self-balancing trees, while claiming to offer the same performance.<p>But they completely lack a mechanism for rebalancing, and are incredibly pointer heavy (in this implementation at least), and inserts&#x2F;deletes can involve an ungodly amount of pointer patching.<p>While I think there are some append-heavy access patterns where it can come up on top, I have found that the gap between using a BST, a hashtable, or just putting stuff in an array and just sorting it when needed is very small.
    • CyberDildonics1 hour ago
      You&#x27;re right, but it&#x27;s not popular to go against the premise of a post.
  • torben-friis10 hours ago
    Could someone provide intuitive understanding for why the &quot;express lanes&quot; in a skip list are created probabilistically?<p>My first instinctive idea would be that there is an optimal distance, maybe based on absolute distance or by function of list size or frequency of access or whatever. Leaving the promotion to randomness is counter intuitive to me.
    • Karliss7 hours ago
      The same reason naive BST tree (non self balancing one) doesn&#x27;t work. You need to be able to add and remove elements without any knowledge of future operations and without malicious input being able to force a degenerate structure which is equivalent to a flat linked list. It&#x27;s a bit similar how treap achieves somewhat balanced tree using randomness instead of deterministic rebalancing algorithms.<p>If you knew all the items ahead of time and didn&#x27;t require adding&#x2F;removing them incrementally you could build optimal skiplist without randomness. But in such situations you likely don&#x27;t need a skip list or BST at all. Binary search on sorted list will do.
    • ozgrakkurt2 hours ago
      If it has a constant stride then that stride can align with something upstream and result in horrible performance
  • einpoklum1 hour ago
    &gt; <i>Every insert would need to write to both systems, and since we want to analyze the data online (while new writes are streaming in) keeping the two databases consistent would require something like two-phase commit (2PC).</i><p>Not convincing. One can write the bulk data which is at first unused - no need to sync anything. Then one writes to the tree DB using, where each node only stores a key to the relevant data.
  • fnordpiglet9 hours ago
    A major global bank operated all trading, especially the complex stuff, off of a globally replicated skip list.
    • techolic4 hours ago
      Would you mind sharing more?
  • locknitpicker13 hours ago
    FTA:<p>&gt; Skiplists to the rescue! Or rather, a weird thing we invented called a “skiptree”…<p>I can&#x27;t help but wonder. The article makes no mention of b-trees if any kind. To me, this sounded like the obvious first step.<p>If their main requirement was to do sequential access to load data, and their problem was how to speed up tree traversal on an ad-hoc tree data structure that was too deep, then I wonder if their problem was simply having tree nodes with too few children. A B+ tree specifically sounds to be right on the nose for the task.
    • akoboldfrying9 hours ago
      IIUC, the tree structure is the very thing they&#x27;re trying to store and query -- it&#x27;s not merely an artefact of a data structure that they&#x27;re using to store something else (the way a B+ tree or binary tree used to store, say, a set of product names would be). If their tree has long paths, it has long paths.
      • wwilson7 hours ago
        Author here. That’s right — the challenge was representing a tree in an existing SQL database that we’d chosen for its pricing model. I think encoding a B-tree in SQL would be a lot less fun even than what we did.
      • torginus5 hours ago
        The nice thing with skip lists, is all &#x27;rungs&#x27; of the list are stored in an array for a given node, so there&#x27;s a lot less pointer chasing.<p>The not so nice thing about it is that you have to pre-guess how deep your tree will be and allocate as many slots, or otherwise itll degrade into a linked list when you run out of rungs, or you end up wasting space.
  • esafak5 hours ago
    What they really wanted was an HTAP. <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Hybrid_transactional&#x2F;analytical_processing" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Hybrid_transactional&#x2F;analytica...</a>
  • m00dy8 hours ago
    It was really cool to mention its name during tech interviews but not anymore I guess.
  • hpcgroup4 hours ago
    [dead]
  • linzhangrun12 hours ago
    [dead]
  • feverzsj12 hours ago
    If you need a graph db, use a graph db.
  • jimmypk6 hours ago
    The article&#x27;s actual thesis is subtle — it&#x27;s not &quot;skiplists are faster&quot; but &quot;a totally naive implementation has adequate performance.&quot; That property was precisely why the skiptree-in-SQL approach worked: you needed a data structure where a half-implemented version, running on BigQuery&#x27;s execution engine, would still satisfy the performance contract. A B+ tree has no such property — a naive B+ tree in SQL would be strictly worse than using recursive CTEs, because you can&#x27;t maintain balance across JOINs.<p>This is also why skiplists are attractive in research and in early-stage implementations: the randomized promotion converts write complexity (deterministic rebalancing) into write simplicity (probabilistic promotion). You get a weaker worst-case guarantee, but in practice — especially in distributed systems where latency variance is already high — losing the rebalancing phase is often a good trade. The Redis case is the same dynamic: they didn&#x27;t choose skiplists over red-black trees for raw speed, they chose them because augmenting a skiplist with custom metadata (like the &quot;span&quot; antirez mentions) is local and composable in a way that augmenting a balanced BST is not.
    • peterldowns4 hours ago
      Why come here to just post AI comments? I don&#x27;t get the point.