0

Is there a way to get shorter unique IDs for entries in RethinkDB?

We have a URL scheme where <url>/:ID URLs get very long with the default ID

Their docs don't seem to talk about this... https://rethinkdb.com/api/javascript/uuid/

Qasim
  • 1,554
  • 1
  • 13
  • 22

2 Answers2

1

According to the linked documentation, we should read Wikipedia's article for UUID. Which starts said article with: A universally unique identifier (UUID) is a 128-bit number [...]. So I guess that no: UUID is a fixed-length thing. (Yeah, I learnt something too here.)

Stock Overflaw
  • 3,203
  • 1
  • 13
  • 14
0

RethinkDB will by default use uuid as id . If you want a shorter id, handle it from your application side. Before inserting set id value. Be careful with your id generation logic, if it conflicts with existing ids in your table, it will overwrite them.

Bopsi
  • 2,090
  • 5
  • 36
  • 58
  • 1
    This seemed like a good discussion on the topic: https://stackoverflow.com/questions/4564112/is-it-safe-to-turn-a-uuid-into-a-short-code-only-use-first-8-chars – Qasim Jul 20 '19 at 09:03