xid
flake
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
xid
-
The Easiest Way to Create a REST API With Go
The goal of babyapi is to be so easy that a baby could do it. As previously mentioned, babyapi.DefaultResource already implements the required interface, so it can be used as a starting point for simple resource types. Besides simply implementing the interface, this default struct implements some validations around the ID and uses rs/xid to create a unique identifer on new resources.
-
Build a Job Queue with Rust Using Aide-De-Camp (Part 2)
To schedule a job, all we need to do is serialize the payload, create a new JID (we use XID for JIDs), and insert both into the adc_queue table.
-
How we used Go 1.18 when designing our Identifiers
XID's are 96 bits. The first 32 bits are the time, which means we get our k-sorting immediately. The next 40 bits are a machine identifier and a process identifier. However, unlike the other systems, these are calculated automatically using the library and don't require us to configure anything ourselves. The final 24 bits are a sequence number, which allows a single process to generate 16,777,216 identifiers per second!
- Xid, globally unique id generator
-
I need a unique ID sequence number generator, I know I could just use a small MySQL instance, but is there no other way?
Checkout xid https://github.com/rs/xid and how MongoDB does its id
-
You Don't Need UUID
I've had success using xid for user-visible IDs. What's nice is they're shorter than UUID, will sort in order, hides the amount of rows in the table.
https://github.com/rs/xid
flake
-
How we used Go 1.18 when designing our Identifiers
Snowflake identifiers were first developed by Twitter and typically are 64 bits (although some variants use 128 bits). This scheme encodes the time the ID was generated as the first 41 bits, then encodes an instance ID for the next 10 bits, and finally a sequence number for the final 12 bits.
What are some alternatives?
nanoid - A tiny and fast Go unique string generator
ulid - Universally Unique Lexicographically Sortable Identifier (ULID) in Go
uuid - Go package for UUIDs based on RFC 4122 and DCE 1.1: Authentication and Security Services.
gouid - Fast, dependable universally unique ids
sno - Compact, sortable and fast unique IDs with embedded metadata.
goflake - A highly scalable and serverless unique ID generator for use in distributed systems. Written in GoLang. Inspired by Twitters Snowflake.
go.uuid - UUID package for Go
Monoton - Highly scalable, single/multi node, sortable, predictable and incremental unique id generator with zero allocation magic on the sequential generation
golang-docker-cache - Improved docker Golang module dependency cache for faster builds.
modd - A flexible developer tool that runs processes and responds to filesystem changes
ksuid - K-Sortable Globally Unique IDs
hord - Manage data in Go with a simple key-value interface supporting various databases.