System Design Part 4 Distributed data

Distributed IDs: UUIDv7, Snowflake, and Segment Allocation, Compared on Order, Size, and What They Leak

Bill.Lin 19 min read

System Design series Part 4-4 | Previous: Consistent Hashing | Next: CAP and PACELC | Series map

Read first: Part 3-2 Indexes and B+Trees, Part 4-2 Sharding.

Scenario and problem

After the Sharding post split sign-up data across 16 shards, each shard’s own AUTO_INCREMENT starts at 1, and different shards end up with the same sign-up number. A new ID scheme has to meet these requirements:

  1. Globally unique: no two IDs may be the same, whichever shard or machine generated them
  2. Roughly increasing: new rows go on the right side of the B+Tree, which keeps writes fast (Indexes post)
  3. No single point of dependency: generating IDs must not make any one machine a bottleneck or a single point of failure, at a peak of 20,000 a second
  4. Small: the primary key is copied into every secondary index, so smaller is better; if the frontend uses it, it should ideally stay within the range of integers JavaScript can represent exactly
  5. Leaks nothing: a public ID must not let anyone work out business volume
After sharding, sign-up numbers collide1 / 4
After sharding, sign-up numbers collideFrontendSign-up APIID generatorShard 1Shard 16Sign-up APIShard 1Shard 16new sign-upnew sign-upSign-up no. 1024Sign-up no. 1024Sign-up APIShard 1new sign-upRight side of the B+TreeSign-up APIID generator20,000 IDs/sNo bottleneck, no SPOFSign-up APIFrontendsign-up numberExact, reveals no volume
  1. Each counts up, numbers repeatAfter sign-up data is split across 16 shards, each shard's AUTO_INCREMENT starts at 1, and different shards produce the same sign-up number.
  2. Unique, and roughly increasingThe new ID must be globally unique. It must also be roughly increasing, so new rows go on the right side of the B+Tree and writes stay fast.
  3. No single point to depend onGenerating IDs must not make any one machine a bottleneck or a single point of failure, and the peak needs 20,000 a second.
  4. Small, and leaks nothingThe primary key is copied into every secondary index, so smaller is better; if the frontend uses it, it should stay within the range of integers JavaScript can represent exactly. A public ID must not let anyone work out business volume either. No single option meets all five.

No single option meets all five, so this post is about trade-offs.

The simplest approach and its limits

  • One database hands out IDs: every shard asks the AUTO_INCREMENT of the same database for IDs, which puts the single point right back, and every write takes one more network round trip
  • A different start and step on each shard: MySQL’s auto_increment_increment = 16 and auto_increment_offset = 1..16; the first shard generates 1, 17, 33…, the second 2, 18, 34…. Simple and effective, but the shard count is hard-coded in the configuration, and resharding means changing the step too
  • UUIDv4: every machine generates its own with no coordination at all, but the values are completely random. The measurements below show what that does to the index

Core mechanism

Random vs time-ordered: measuring primary key inserts

Simulate inserting 2 million rows into a simplified InnoDB leaf level: 16 KB pages that split once they are 15/16 full, 150 bytes of data per row besides the primary key, and a buffer pool that holds only 3,000 pages (about 47 MB). The split rule mimics InnoDB: when the new row comes right after the row inserted last, the page splits at the insertion point (the old page stays full); otherwise it splits in half. The UUIDv7 values come from the Hibernate 7.4 implementation:

Simulation (IdIndexSimulation.java)
java
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.TreeMap;
import java.util.UUID;
import java.util.function.IntFunction;
import org.hibernate.id.uuid.UuidVersion7Strategy;

/**
 * A simplified leaf level of an InnoDB clustered index: 16 KB pages that split at 15/16 full, and a buffer pool that holds only 3,000 pages. Compares how four kinds of primary key insert.
 * The split rule mimics InnoDB: when the new row comes right after the row last inserted into this page, split at the insertion point; otherwise split in half.
 */
public class IdIndexSimulation {

    static final int ROWS = 2_000_000;
    static final int USABLE_BYTES = 16 * 1024 * 15 / 16;
    static final int PAYLOAD_BYTES = 150;                           // columns other than the primary key
    static final int BUFFER_POOL_PAGES = 3_000;

    record Key(long hi, long lo) implements Comparable<Key> {
        public int compareTo(Key o) {
            int c = Long.compareUnsigned(hi, o.hi);
            return c != 0 ? c : Long.compareUnsigned(lo, o.lo);
        }
    }

    static final class Page {
        final List<Key> keys = new ArrayList<>();
        final int id;
        Key lastInserted;
        Page(int id) {
            this.id = id;
        }
    }

    public static void main(String[] args) {
        UuidVersion7Strategy[] v7 = new UuidVersion7Strategy[4];  // 4 application servers generate their own, writes interleave
        for (int i = 0; i < v7.length; i++) {
            v7[i] = new UuidVersion7Strategy();
        }
        System.out.println("Primary key        Key size  Leaf pages    Avg fill    Splits  Buffer pool misses per 1,000 inserts");
        run("AUTO_INCREMENT", 8, i -> new Key(i + 1, 0));
        Random random = new Random(42);
        int[] workerOrder = {0, 1, 2, 3};
        run("Snowflake (4 apps)", 8, i -> {
            long ms = i / 4;                                        // 4 rows per millisecond, 1 from each server, in random arrival order
            if (i % 4 == 0) {
                shuffle(workerOrder, random);
            }
            return new Key((ms << 22) | ((long) workerOrder[i % 4] << 12), 0);
        });
        run("UUIDv7 (4 apps)", 16, i -> uuid(v7[i % 4].generateUuid(null)));
        run("UUIDv4", 16, i -> uuid(UUID.randomUUID()));
    }

    static void shuffle(int[] a, Random random) {
        for (int i = a.length - 1; i > 0; i--) {
            int j = random.nextInt(i + 1);
            int t = a[i];
            a[i] = a[j];
            a[j] = t;
        }
    }

    static Key uuid(UUID u) {
        return new Key(u.getMostSignificantBits(), u.getLeastSignificantBits());
    }

    static void run(String label, int keyBytes, IntFunction<Key> ids) {
        int capacity = USABLE_BYTES / (keyBytes + PAYLOAD_BYTES);
        TreeMap<Key, Page> tree = new TreeMap<>();                 // smallest key of each page → page
        LinkedHashMap<Integer, Boolean> bufferPool = new LinkedHashMap<>(BUFFER_POOL_PAGES, 0.75f, true) {
            @Override
            protected boolean removeEldestEntry(Map.Entry<Integer, Boolean> eldest) {
                return size() > BUFFER_POOL_PAGES;
            }
        };
        int[] nextPageId = {0};
        long misses = 0;
        long splits = 0;
        for (int i = 0; i < ROWS; i++) {
            Key key = ids.apply(i);
            Map.Entry<Key, Page> entry = tree.floorEntry(key);
            Page page;
            if (entry == null) {
                page = tree.isEmpty() ? new Page(nextPageId[0]++) : tree.firstEntry().getValue();
                if (!tree.isEmpty()) {
                    tree.remove(tree.firstKey());
                }
                tree.put(key, page);
            } else {
                page = entry.getValue();
            }
            misses += bufferPool.put(page.id, Boolean.TRUE) == null ? 1 : 0;
            int index = -Collections.binarySearch(page.keys, key) - 1;
            boolean rightward = index > 0 && page.keys.get(index - 1).equals(page.lastInserted);
            page.keys.add(index, key);
            page.lastInserted = key;
            if (page.keys.size() > capacity) {
                splits++;
                int from = rightward ? index : page.keys.size() / 2;
                Page right = new Page(nextPageId[0]++);           // inserting rightward: keys smaller than the new row stay in the old page, which stays nearly full
                right.lastInserted = key;
                right.keys.addAll(page.keys.subList(from, page.keys.size()));
                page.keys.subList(from, page.keys.size()).clear();
                tree.put(right.keys.get(0), right);
                bufferPool.put(right.id, Boolean.TRUE);
            }
        }
        double fill = (double) ROWS / ((long) tree.size() * capacity);
        System.out.printf("%-18s %6d B %,11d %10.0f%% %,9d %16.1f%n",
                label, keyBytes, tree.size(), fill * 100, splits, misses * 1000.0 / ROWS);
    }
}
text
Primary key        Key size  Leaf pages    Avg fill    Splits  Buffer pool misses per 1,000 inserts
AUTO_INCREMENT          8 B      20,619        100%    20,618              0.0
Snowflake (4 apps)      8 B      36,380         57%    36,379              0.0
UUIDv7 (4 apps)        16 B      35,001         62%    35,000              0.0
UUIDv4                 16 B      31,420         69%    31,419            672.7
  • Buffer pool misses are the biggest gap: UUIDv4 inserts land at random positions, so once the index is larger than the buffer pool, 673 out of every 1,000 inserts have to read a page in from disk. At 4,000 writes a second, the leaf level alone needs 2,700 random reads a second. Time-ordered IDs always go on the far right, the rightmost page always stays in memory, and misses are 0
  • UUIDv4’s fill factor is 69%, matching the theoretical value for random inserts into a B-Tree, ln 2 ≈ 69%; the same data takes about 45% more pages
  • Strictly increasing AUTO_INCREMENT fills every page
  • Snowflake and UUIDv7 generated on several interleaved machines fill only 57% to 62%: IDs from the 4 machines arrive interleaved, so a new row often does not come right after the previous one, the page splits in half, and the left half never receives new rows again. This is a result of the simplified model, and the real fill factor depends on the database’s split strategy (InnoDB also checks for leftward inserts), but remember that “roughly increasing” is not “strictly increasing”. On buffer pool misses, which matter most for write performance, they score 0, the same as AUTO_INCREMENT
  • Primary key size: every secondary index in InnoDB stores the primary key. A 16-byte UUID takes 8 bytes more per index entry than an 8-byte BIGINT; with 5 secondary indexes and 3 billion rows, that is about 120 GB more

Snowflake

A 64-bit integer made of three parts:

Bits Content Range
1 Sign bit, always 0
41 Milliseconds since a custom epoch 2^41 ms is about 69.7 years
10 Machine ID 1,024 machines
12 Sequence within the same millisecond 4,096 per machine per millisecond

The upside: 64 bits, time-ordered, and every machine generates its own. The cost is two things you have to manage yourself:

  • Machine ID: if two machines get the same machine ID, they generate the same IDs. On Kubernetes, Pods can be recreated at any time, so the machine ID has to come from the StatefulSet ordinal, or from a lease in a database or ZooKeeper
  • Clock rollback: when an NTP correction moves the system time backward, new timestamps may repeat earlier ones. Detect rollback: wait when it is small, and refuse to issue IDs when it is large

Full implementations of both are in The Snowflake Algorithm and an Enterprise-Grade Implementation.

UUIDv7 and ULID

UUIDv7, defined in RFC 9562 (2024), is 128 bits: the first 48 bits are a Unix timestamp in milliseconds, and most of the rest is random. The Hibernate 7.4 implementation puts 12 bits of sub-millisecond time and 62 random bits after the timestamp, so IDs generated on the same machine are strictly increasing.

Like Snowflake it is time-ordered, but it needs no machine ID: the random part is large enough that the chance of two machines generating the same ID in the same millisecond is negligible. The cost is 128 bits, twice the size of Snowflake. PostgreSQL has a built-in uuidv7() since version 18. ULID is another format of the same idea (48 bits of time + 80 random bits, as a 26-character base32 string) and was widely used before UUIDv7 was standardized.

Segment allocation

The database only hands out segments: each application server takes 1,000 IDs from the database at a time, hands them out one by one from memory, and fetches the next segment when they run out.

  • The database is accessed only once per 1,000 IDs, so its load is very low
  • When the database fails briefly, the segment still in hand lasts for a while. A common optimization is to prefetch the next segment in the background once 10% is left (double buffering)
  • It produces 64-bit integers, increasing within each machine and roughly increasing globally
  • When a machine restarts, the unused part of its segment is wasted, leaving gaps in the IDs

Comparing options

Size Ordering Coordination needed Depends on Information leaked
Single database AUTO_INCREMENT 8 B Strictly increasing For every ID A single database Total count and growth rate
Shard start and step 8 B Increasing within each shard No Hard-coded shard count Total count and growth rate
UUIDv4 16 B Random No None None
UUIDv7 16 B Roughly increasing No Clock Creation time
Snowflake 8 B Roughly increasing Assigning machine IDs Clock, machine ID Creation time, machine, volume per millisecond
Segment allocation 8 B Roughly increasing Once per segment Database (buffered) Total count and growth rate

How to choose:

  • You do not want to manage any infrastructure: UUIDv7, which trades 16 bytes for no machine IDs and no ID service
  • You need 64 bits (for example, the ID has to fit an existing BIGINT column, or there are many secondary indexes): Snowflake or segment allocation. If you already have a reliable database, segment allocation is the simplest; if you do not want ID generation to depend on the database, use Snowflake
  • IDs will be public: whichever one you use internally, give the outside world a separate random ID (see Security)

In Java

1. UUIDv7 primary keys in JPA

Hibernate 7’s @UuidGenerator can specify version 7 directly. MySQL has no native UUID type, so store it as BINARY(16), not CHAR(36): the string form takes at least 36 bytes, and every entry in every secondary index carries it.

java
package entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import java.util.UUID;
import org.hibernate.annotations.UuidGenerator;

@Entity
public class Registration {

    @Id
    @UuidGenerator(style = UuidGenerator.Style.VERSION_7)
    @Column(columnDefinition = "BINARY(16)")
    private UUID id;

    private long lectureId;
    private long memberId;

    protected Registration() {
    }

    public Registration(long lectureId, long memberId) {
        this.lectureId = lectureId;
        this.memberId = memberId;
    }

    public UUID getId() {
        return id;
    }
}

2. Segment allocation

java
package idgen;

import java.util.concurrent.locks.ReentrantLock;
import org.springframework.jdbc.core.simple.JdbcClient;
import org.springframework.transaction.support.TransactionTemplate;

/** Segment allocation: take a segment of IDs (for example 1,000) from the database at a time, hand them out from memory, then take the next segment. */
public class SegmentIdGenerator {

    private final JdbcClient jdbc;
    private final TransactionTemplate tx;
    private final String bizTag;
    private final int step;
    private final ReentrantLock lock = new ReentrantLock();        // fetching a segment does I/O; ReentrantLock keeps virtual threads from being pinned
    private long next;
    private long end;

    public SegmentIdGenerator(JdbcClient jdbc, TransactionTemplate tx, String bizTag, int step) {
        this.jdbc = jdbc;
        this.tx = tx;
        this.bizTag = bizTag;
        this.step = step;
    }

    public long nextId() {
        lock.lock();
        try {
            if (next == end) {
                allocate();
            }
            return next++;
        } finally {
            lock.unlock();
        }
    }

    /** The UPDATE's row lock makes machines fetch one at a time, so each gets a non-overlapping range (max_id - step, max_id]. */
    private void allocate() {
        long maxId = tx.execute(status -> {
            jdbc.sql("UPDATE id_segment SET max_id = max_id + :step WHERE biz_tag = :tag")
                    .param("step", step)
                    .param("tag", bizTag)
                    .update();
            return jdbc.sql("SELECT max_id FROM id_segment WHERE biz_tag = :tag")
                    .param("tag", bizTag)
                    .query(Long.class)
                    .single();
        });
        next = maxId - step + 1;
        end = maxId + 1;
    }
}

The table behind it has a single row:

sql
CREATE TABLE id_segment (
    biz_tag VARCHAR(32) PRIMARY KEY,
    max_id  BIGINT NOT NULL
);
INSERT INTO id_segment VALUES ('registration', 0);

3 application servers share one H2 database, and each fetches IDs with 4 threads at once:

Verification (SegmentDemo.java)
java
package idgen;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.springframework.jdbc.core.simple.JdbcClient;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.transaction.support.TransactionTemplate;

/** 3 application servers share one database, and each fetches IDs with 4 threads at once. */
public class SegmentDemo {

    record Issued(long sequence, String instance, long id) {}

    public static void main(String[] args) {
        DriverManagerDataSource ds = new DriverManagerDataSource("jdbc:h2:mem:ids;DB_CLOSE_DELAY=-1;LOCK_TIMEOUT=10000", "sa", "");
        JdbcClient jdbc = JdbcClient.create(ds);
        jdbc.sql("CREATE TABLE id_segment (biz_tag VARCHAR(32) PRIMARY KEY, max_id BIGINT NOT NULL)").update();
        jdbc.sql("INSERT INTO id_segment VALUES ('registration', 0)").update();
        TransactionTemplate tx = new TransactionTemplate(new DataSourceTransactionManager(ds));

        ConcurrentLinkedQueue<Issued> issued = new ConcurrentLinkedQueue<>();
        java.util.concurrent.atomic.AtomicLong clock = new java.util.concurrent.atomic.AtomicLong();
        try (ExecutorService executor = Executors.newFixedThreadPool(12)) {
            for (String instance : List.of("app-a", "app-b", "app-c")) {
                SegmentIdGenerator generator = new SegmentIdGenerator(jdbc, tx, "registration", 1_000);
                for (int t = 0; t < 4; t++) {
                    executor.submit(() -> {
                        for (int i = 0; i < 10_000; i++) {
                            long id = generator.nextId();
                            issued.add(new Issued(clock.incrementAndGet(), instance, id));
                        }
                    });
                }
            }
        }

        List<Issued> all = new ArrayList<>(issued);
        all.sort((a, b) -> Long.compare(a.sequence(), b.sequence()));
        Set<Long> unique = new HashSet<>();
        all.forEach(i -> unique.add(i.id()));
        long inversions = 0;
        for (int i = 1; i < all.size(); i++) {
            inversions += all.get(i).id() < all.get(i - 1).id() ? 1 : 0;
        }
        long maxId = jdbc.sql("SELECT max_id FROM id_segment WHERE biz_tag = 'registration'").query(Long.class).single();
        System.out.printf("Issued %,d IDs, %,d unique, %d segment fetches from the database%n", all.size(), unique.size(), maxId / 1_000);
        System.out.printf("In issue order, share of IDs smaller than the previous one: %.1f%%%n", 100.0 * inversions / (all.size() - 1));
        for (String instance : List.of("app-a", "app-b", "app-c")) {
            System.out.println(instance + " first 3 IDs issued: " + all.stream()
                    .filter(i -> i.instance().equals(instance)).limit(3).map(Issued::id).toList());
        }
    }
}
text
Issued 120,000 IDs, 120,000 unique, 120 segment fetches from the database
In issue order, share of IDs smaller than the previous one: 2.7%
app-a first 3 IDs issued: [2001, 2002, 2003]
app-b first 3 IDs issued: [1001, 1002, 1003]
app-c first 3 IDs issued: [1, 3, 4]
  • All 120,000 IDs are unique, and the database was accessed only 120 times
  • Each machine increases within its own segment, but the three hand out IDs interleaved, so the global order is only roughly increasing. In issue order, 2.7% of the IDs are smaller than the one before
  • The three each got a different segment (starting at 1, 1001, and 2001), because the UPDATE’s row lock makes the fetches happen one at a time

3. Snowflake

For assigning machine IDs and handling clock rollback, see The Snowflake Algorithm and an Enterprise-Grade Implementation.

Pitfalls and gotchas

  • Passing 64-bit IDs to JavaScript: JavaScript’s Number represents integers exactly only up to 2^53 (about 9 × 10^15). The Snowflake ID 912145357725569027 below becomes 912145357725569024 when converted to a Number and shows up on screen as 912145357725569000, and a lookup with it finds nothing. Always send 64-bit IDs in JSON as strings
  • Clock rollback: Snowflake and UUIDv7 both depend on system time. Hibernate’s UUIDv7 guarantees increasing values within one JVM, but clock skew between machines makes the order of IDs differ from the order things actually happened. Do not use the size of an ID to decide which event came first
  • Duplicate machine IDs: when two Pods get the same Snowflake machine ID, they generate duplicate IDs. When that happens, the later write may overwrite the earlier row, or fail on the primary key
  • Storing UUIDs as CHAR(36): more than twice the size of BINARY(16). MySQL converts with UUID_TO_BIN(); its swap flag reorders the bits of a UUIDv1, and a UUIDv7 already has the time first, so do not swap it again
  • Segment allocation leaves gaps: restarts and scaling out both skip numbers. Numbers that regulations require to be consecutive, such as invoice numbers, need their own sequence in the database
  • Hard-coded shard start and step: going from 16 shards to 32 means changing the step on every shard, and the new IDs must not collide with the old ones

Security

  • An ID is not authorization: knowing a sign-up’s ID does not mean you are allowed to see it. Predictable IDs let attackers try them one by one, but even when IDs are unpredictable, you cannot skip the authorization check (BOLA in Part 8)

  • IDs leak information: here is what an attacker can work out from nothing but the ID of their own order:

    Demo (IdLeakDemo.java)
    java
    package idgen;
    
    import java.time.Instant;
    import java.time.ZoneId;
    import java.util.UUID;
    import org.hibernate.id.uuid.UuidVersion7Strategy;
    
    /** What an attacker can work out from nothing but the ID of their own order. */
    public class IdLeakDemo {
    
        static final long SNOWFLAKE_EPOCH = Instant.parse("2020-01-01T00:00:00Z").toEpochMilli();
        static final ZoneId TAIPEI = ZoneId.of("Asia/Taipei");
    
        public static void main(String[] args) {
            long yesterday = 1_203_551;
            long today = 1_215_907;
            System.out.printf("AUTO_INCREMENT: order #%d at 10:00 yesterday, order #%d at 10:00 today → about %,d orders a day%n",
                    yesterday, today, today - yesterday);
    
            long issuedAt = Instant.parse("2026-11-22T01:00:00.123Z").toEpochMilli() - SNOWFLAKE_EPOCH;
            long snowflake = (issuedAt << 22) | (17L << 12) | 3;         // 41 bits of time, 10 bits of machine, 12 bits of sequence; the attacker sees only this number
            long millis = (snowflake >>> 22) + SNOWFLAKE_EPOCH;
            System.out.printf("Snowflake %d → created at %s, machine ID %d, sequence %d in that millisecond%n", snowflake,
                    Instant.ofEpochMilli(millis).atZone(TAIPEI).toLocalDateTime(), (snowflake >>> 12) & 0x3FF, snowflake & 0xFFF);
    
            UUID v7 = UuidVersion7Strategy.INSTANCE.generateUuid(null);
            System.out.printf("UUIDv7 %s → created at %s%n", v7,
                    Instant.ofEpochMilli(v7.getMostSignificantBits() >>> 16).atZone(TAIPEI).toLocalDateTime());
    
            System.out.printf("UUIDv4 %s → 122 random bits, nothing to infer%n", UUID.randomUUID());
        }
    }
    text
    AUTO_INCREMENT: order #1203551 at 10:00 yesterday, order #1215907 at 10:00 today → about 12,356 orders a day
    Snowflake 912145357725569027 → created at 2026-11-22T09:00:00.123, machine ID 17, sequence 3 in that millisecond
    UUIDv7 01a20398-59fb-7220-a7b7-124383ab79db → created at 2026-11-22T22:10:45.883
    UUIDv4 b79a18d2-0a3d-4507-bd15-54a1f17fa16a → 122 random bits, nothing to infer

    With sequential AUTO_INCREMENT, a competitor who places one order a day can work out the platform’s daily order volume; Snowflake leaks the creation time, the number of machines, and the volume per millisecond; UUIDv7 leaks the creation millisecond, which PostgreSQL’s uuid_extract_timestamp() extracts in one line. For data such as anonymous reports, the creation time itself is sensitive

  • Separate internal and public IDs: use a time-ordered ID as the table’s primary key, and add a UUIDv4 column (with a unique index) for URLs and APIs. Only the UUIDv4 ever appears outside, so you get both internal performance and external unpredictability

  • UUIDv7 is not a secret: tokens that work for whoever knows them, such as password resets and invite links, need a random value of at least 128 bits from SecureRandom. The time part of a UUIDv7 is predictable, and only 62 bits of Hibernate’s implementation are random

When to use it, and when not to

  • UUIDv7: the default for new systems, with no extra infrastructure
  • Snowflake: you need 64 bits, write volume is high, and you do not want ID generation to depend on the database
  • Segment allocation: you already have a reliable database, need 64 bits, and want the simplest implementation
  • UUIDv4: public IDs, and data that does not need ordering
  • Do not use IDs for: authorization, ordering events, counting, or business numbers that must be consecutive

References

Comments