No release in over a year
Int64 (UInt64, UInt63) autoincrement via redis-servers with timestamp in microseconds, autoincerent via redis key. Support 1-5 redis servers in one system (1 - timestamp + 4 servers - autoincrementers).
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

Int64 UUID (UInt64, UInt63) autoincremented via redis-server¶ ↑

Generates universally unique identifiers (UUID64) with unsigned Int64 (so it will be UInt63) for use in distributed applications. Based on: 1) possibility autoincrement value in redis-server 2) unix timestamps with microseconds 3) expire key possibility in redis database.

Generating UInt63 Ids¶ ↑

Call #generate to generate a new UUID64. The method returns a Int64 unique value.

For example in rails:

before_create do |record|
  record.id ||= RedisInt64Autoincrement.generate(Rails.cache.redis || Redis.new(url: "redis://localhost:6379/0"))
end

Why so hard?¶ ↑

We have an issue where the servers have different times on each server and during the time the server syncs the time we have a shift of a few seconds. So this lib have +-50(UUID64_MAX_SECONDS_EXPIRE) seconds maximum for delta shift.

Latest and Greatest¶ ↑

Source code and documentation hosted on Github: github.com/trumenov/redis_int64_autoincrement

To get UUID64 from source:

git clone git://github.com/trumenov/redis_int64_autoincrement.git

License¶ ↑

This package is licensed under the MIT license and/or the Creative Commons Attribution-ShareAlike.

:include: MIT-LICENSE