Skip to content
/ qset Public

An underlying for LWW data structure. It is both fast and persistent

License

Notifications You must be signed in to change notification settings

kavehmz/qset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Lang GoDoc Build Status Coverage Status Go Report Card

qset

QSet is an implementation of what LWW can use as its underlying set to provide a conflict-free replicated data type.

This implementation merges two approaches which are implemented in lww repositories to gain both speed and persistence at the same time.

It introduced a new underlying structure which each Set will add the element to a Go map (fast part) and write the element in redis in an async way. It will also publish the element to a channel in redis.

the flow after start is like:

  • Subscribe to redis channel to get the latest changes and update the internal map.
  • Read the persistent data from Redis. Because subscription to channel started first we dont miss the changes during this step.
  • Set: Add the element to internal map and at the same time to redis and redis channel for other nodes to get the change.
  • Get/Len/List: Only check the internal maps for asnwer.

Converting data structure is done using Marshal and UnMarshal functions which must be provider by the user.

This implementation has the same time resolution limit as RedisSet that is minimum 1 millisecond.

About

An underlying for LWW data structure. It is both fast and persistent

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages