Skip to content

Instantly share code, notes, and snippets.

@jd jd/gist:9325172
Last active Aug 29, 2015

Embed
What would you like to do?
# Current
__TOOZ_GROUP_LIST = [ group list ]
_TOOZ_GROUP_<foo> = { "member": { "last_seen": <time>, "capabilities": "foobar" } }
create_group => WRITE,(READ,WRITE,RETRY) => O(1)
get_groups => READ => O(1)
join_group => (READ,WRITE,RETRY) => O(1)
leave_group => (READ,WRITE,RETRY) => O(1)
get_members => READ => O(1)
get_members_capabilities => READ => O(1)
update_capabilities => (READ,WRITE,RETRY) => O(1)
heartbeat => (READ,WRITE,RETRY) for each group => O(n_groups)
# Proposed 1
__TOOZ_GROUP_LIST = [ group list ]
_TOOZ_GROUP_<foo> = [ member list ]
_TOOZ_MEMBER_<foo> = { <group_id>: "mycapabilities" } # (with a TTL set on that on that key)
create_group => WRITE,(READ,WRITE,RETRY) => O(1)
get_groups => READ => O(1)
join_group => (READ,WRITE,RETRY),(READ,WRITE,RETRY) => O(1)
leave_group => (READ,WRITE,RETRY),(READ,WRITE,RETRY) => O(1)
get_members => READ,READ*members => O(members_in_group)
get_members_capabilities => READ,READ*members => O(members_in_group)
update_capabilities => (READ,WRITE,RETRY) => O(1)
heartbeat => (READ,WRITE) => O(1)
# Proposed 2
__TOOZ_GROUP_LIST = [ group list ]
_TOOZ_GROUP_<foo> = { "member": "capabilities", … }
_TOOZ_MEMBER_<foo> = "I AM ALIVE" # (with a TTL set on that on that key)
create_group => WRITE,(READ,WRITE,RETRY) => O(1)
get_groups => READ => O(1)
join_group => (READ,WRITE,RETRY) => O(1)
leave_group => (READ,WRITE,RETRY) => O(1)
get_members => READ,READ*members => O(members_in_group)
get_members_capabilities => READ,READ*members => O(members_in_group)
update_capabilities => (READ,WRITE,RETRY) => O(1)
heartbeat => (READ,WRITE) => O(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.