A universally unique identifier (UUID) identifies an entity across systems without relying on a meaningful name. Its 128-bit value is commonly displayed as 32 hexadecimal characters separated by four hyphens, producing a 36-character string. section 4.4 section 4.4.1
ScyllaDB provides two related identifier types:
- UUID supplies a predominantly random identifier, typically corresponding to version 4. Its 122 random bits make collisions extremely unlikely, although not mathematically impossible. section 4.4.1
- TIMEUUID supplies a version 1 identifier containing a timestamp. ScyllaDB can sort it temporally, making it useful for recent-first results and conflict-free primary keys. section 4.4.1
- ScyllaDB generates UUID values with uuid() and TIMEUUID values with now(); applications may instead generate identifiers when they need to know the value immediately. section 4.4.1 section 4.7
Choosing IDs for restaurant reviews
A restaurant-review application can use TIMEUUID for article IDs, article-summary IDs, and author IDs. The embedded time lets queries sort article summaries by recency and helps express when related data was created. A plain UUID is sufficient when the application needs only a quick random identifier. section 4.4.2
cqlsh: types> INSERT INTO basic(text, uuid, timeuuid)
VALUES ('uuids', uuid(), now());
See UUID and TIMEUUID generated directly in CQL with uuid() and now(). section 4.4.1









