Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    E

    Emmanuel Goossaert

    codecapsule.com · Personal blog · on HN since 2013

    Emmanuel Goossaert writes about SSD internals, hash tables such as Robin Hood hashing, and building key-value stores.

    Visit blogRSSHN submissions
    Systems & PerformanceDatabasesProgramming
    What HN says

    Commenters call his SSD series a favorite guide to drive internals for programmers and describe his hashing posts as instructive overviews.

    Stats for nerds
    41HN people shared it
    27linked in comments
    824story points
    May 2023last shared
    2015people per year2023

    Top posts on HN

    1. 1
      What every programmer should know about solid-state drives (2014)
      7 people · 324 points · first shared 2015 · 110 comments on HN
    2. 2
      How to implement an algorithm from a scientific paper
      3 people · 209 points · first shared 2013 · 77 comments on HN
    3. 3
      Coding for SSDs
      9 people · 195 points · first shared 2014 · 27 comments on HN
    4. 4
      Implementing a Key-Value Store (2012)
      3 people · 59 points · first shared 2015 · Discussion on HN
    5. 5
      Learn Street Epistemology to Deal with Difficult People at Work
      1 person · 19 points · first shared 2022 · 5 comments on HN
    6. 6
      Robin Hood hashing: backward shift deletion (2013)
      6 people · 6 points · first shared 2015 · Discussion on HN
    7. 7
      Skills Map of Senior Tech Career Progression
      1 person · 3 points · first shared 2021 · Discussion on HN
    8. 8
      Planned Reading: The Trick for Reading Nonfiction
      1 person · 3 points · first shared 2017 · Discussion on HN
    9. 9
      How I successfully tested and rejected two niche markets using online surveys
      1 person · 2 points · first shared 2013 · Discussion on HN
    10. 10
      Robin Hood hashing
      3 people · 1 points · first shared 2014 · Discussion on HN

    What HN people wrote when they linked it

    • DannyBeeMay 2016

      FWIW: This seems to mostly be lore.
      See http://www.nber.org/sys-admin/overwritten-data-guttman.html

      Note also "Since writing the above, I have noticed a comment attributed to Gutmann conceding that overwritten sectors on "modern" (post 2003?) drives can not be read by the techniques outlined in the 1996 paper, but he does not withdraw the overwrought claims of the paper with respect to older drives."

      (the comment is at http://seclists.org/bugtraq/2005/Jul/464)

      As for SSD's, it's harder to say because of wear leveling and bad sector replacement. They internally have their own translation layers, and so the overwritten data may not end up where the original data was (this is itself a complicated topic. http://codecapsule.com/2014/02/12/coding-for-ssds-part-3-pages-blocks-and-the-flash-translation-layer/ is a reasonble intro)

      However, one neat thing about them is that there are plenty of SSD's that do hardware encryption by default. When they get init'd, they set the key. You can reset the key, and then, pretty much, assuming the SSD's have not been backdoored by our security agencies, it doesn't matter what you do ;)

      This assumes you just want to destroy all the data though, not just some of it.

    • astrodustAug 2018

      Flash memory is different from a regular drive, and it's to do with how it writes. You can't alter a single bit, you must rewrite the whole block and those can be anywhere from 256KB to 4MB or more. http://codecapsule.com/2014/02/12/coding-for-ssds-part-2-architecture-of-an-ssd-and-benchmarking/

      Adding new bits is cheap, though, so if you can come up with an append-only strategy for your system and periodically combine those into a new, pristine version you'll get far more life out of your SSD than if you go around randomly flipping bits. Is Redis using memory-mapped files the problem here? Treating a file like memory is all fine and good until your random bit-flipping has to be directly persisted.

      I wonder if future SSD firmware implementations will avoid wear by having a small buffer reserved for little post-write patches that can absorb a few small changes before having to commit to rebuilding the whole block.

      There's talk of "annealing" as a way of restoring cells to full life: https://www.extremetech.com/computing/142096-self-healing-self-heating-flash-memory-survives-more-than-100-million-cycles

      Has anyone tried reflowing a worn out drive?

    • saurikNov 2016

      In addition to the answer from rndgermandude (which is also a reason why accessing a data structure in RAM, even in a world without cache lines, would be faster and more efficient if stored in a linear array rather than a tree), SSDs are themselves a complex data structure mapping data into erasure blocks in an attempt to minimize wear on the flash memory and increase efficiency. If the size of your fragments is smaller than the size of this block, you are going to take a performance penalty, and the size of this block is large: I did a search just now to find an article for you detailing this, and http://codecapsule.com/2014/02/12/coding-for-ssds-part-5-access-patterns-and-system-optimizations/ mentions 32 megabytes, and anything below that leads to a second layer of data structures on the SSD designed to map the high-level blocks to low-level blocks and incurs erasure penalties.

    • tveitaFeb 2017

      I read the section on sequential numbers as just illustrating a worst-case scenario of the case that could happen with either a naive hasher or malicious input.

      As far as I can see all the graphs but one use random numbers, so hashing won't add anything given good randomness.

      I've heard good arguments why linear probing should perform as well as quadratic probing when using Robin Hood bucket stealing, e.g. http://codecapsule.com/2013/11/11/robin-hood-hashing/#comment-44965

      > Note that even if you reduce modulo a prime > n, you'll still have the identity over the first n numbers.

      Which can be great! E.g. Python uses the identity function for number hashes, because if you're inserting mostly sequential numbers into a dict this gives you better cache performance.

    • jay-andersonDec 2016

      Java still uses a linked list chaining until a threshold is met (8 currently) which it then switches the bucket to a tree. I wish java could switch to open address hashing, but without value types it wouldn't help much (there's work on adding them: http://cr.openjdk.java.net/~jrose/values/values-0.html).

      Linear probing would likely be better than cuckoo hashing from a cpu cache perspective (all locations closer in memory). There are probing schemes which result in low number of checks and allow for higher loading factors similar to cuckoo hashing (e.g. robin hood hashing. See http://codecapsule.com/2013/11/17/robin-hood-hashing-backward-shift-deletion/)

    • riobardJun 2021

      One thing I'm still puzzled about SSD over-provisioning, which is also mentioned by the tutorial (https://codecapsule.com/2014/02/12/coding-for-ssds-part-4-advanced-functionalities-and-internal-parallelism/) recommended by the article:

      > A drive can be over-provisioned simply by formatting it to a logical partition capacity smaller than the maximum physical capacity. The remaining space, invisible to the user, will still be visible and used by the SSD controller.

      Does the controller read the partition table to decide that the space beyond logic partition is safe to use as scrap?

    Related

    Graham Jenkinsdarkcoding.net44 people

    Facebook’s code quality problem (2015)

    Graham Jenkins
    Personal · last shared 2025
    Tigris Blogtigrisdata.com37 people

    Nomadic infrastructure design for AI workloads

    Tigris Blog
    Company · last shared 2026
    Loup Vaillantloup-vaillant.fr53 people

    How I implemented my own crypto

    Loup Vaillant
    Personal · last shared 2026
    Eric Hammondalestic.com50 people

    How Much Does It Cost to Run a Serverless API on AWS?

    Eric Hammond
    Personal · last shared 2021
    Micah Lernermicahlerner.com22 people

    Understanding Google’s File System (2020)

    Micah Lerner
    Personal · last shared 2025
    Ted Unangsttedunangst.com269 people

    Can an email go 500 miles in 2025?

    Ted Unangst
    Personal · last shared 2026
    Solène Rapennedataswamp.org/~solene51 people

    Self hosting is important

    Solène Rapenne
    Personal · last shared 2026
    Small Datumsmalldatum.blogspot.com63 people

    The original LSM paper

    Small Datum
    Personal · last shared 2026