How it works...
Since the earliest incarnation of BDR 3, the timeshard sequence type has existed to prevent sequential ID collisions. It works using an algorithm pioneered by Instagram that uses bit packing to overload a 64-bit integer with identifying information. Each ID actually contains the BDR sequential node ID, a timestamp, and the local sequence value.
There are basically two ways to ensure that all new sequences generate values according to this approach. We can either do as the instructions suggest and set bdr.default_sequence_kind to timeshard before creating any kind of sequence, or we can set the same parameter in our postgresql.conf file. Whatever we decide, it's best to be consistent to avoid accidentally creating any of the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access