Order Stamps – A String-Based Trick for Effortless List Ordering
Order Stamps – A String-Based Trick for Effortless List Ordering
Hey HN, our small team recently stumbled onto a neat approach for handling ordered lists in DBs without all the reindexing headaches. We’ve been calling it Order Stamps, and we originally built it for our own distributed database project, GoatDB. The concept is simple—treat the “position” of each list item as an infinitely splittable string rather than an integer index. Why bother? Ever inserted an item “in the middle” of a large list and had to reorder everything afterward? We wanted O(1) list operations so you only ever update a single row per insertion/deletion. How to use it? Just add a string order column to your rows, then call the start() or end() functions to generates stamps that insert at either ends. There's also the between() function that generates a stamp between two others. Finally, just sort by this order column to get the correct list. The order of these stamps remain consistent even if you filter a subset of the rows, and it's also collision resistant so stamps can be safely generated without coordination. How does it work? Think of “AA” and “AB.” If you want something in the middle, pick “AAM” or “AAX” or keep making up new strings. There’s always room for more “in-between” values because strings can keep growing. We’re curious if this approach might be useful to you. Our code is a small TypeScript utility—no heavy lifts—and it plays nicely with standard DB indexes so your range queries stay fast. What do you think? We’d love the community’s take on the design choices or edge cases we might not have considered. We hope you’ll dig into the code and give us your thoughts! If you end up using Order Stamps (with or without GoatDB), let us know how it goes. Github Repo: https://github.com/goatplatform/orderstamp-js Looking forward to your feedback—thanks for reading!
Share cardActual performance
Launch Intel predictions
Analyze your own launch →Correct prediction on native model
Similar products
Systema Robotica, a treatise on the order and evolution of robotkind
Firefox Addon, Supertab - list of tabs in most recently used order
Order Tramadol Online
Know What to Order Before You Order It
Who Next? - you provide a list, we pick the order
Order Like a Malaysian
Order an Uber with the Click of Your Heels
Sift through recently dropped .com's in order of PRONOUNCEABILITY, etc
Sift through recently dropped .com's in order of pronounceability, etc.
BackerETA – Crowdsourced order tracking for crowdfunding, and more