-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add timestamps for json representation for GC #3
Comments
I was thinking one could choose logically or time-ordered tags for On 01/25/2012 07:09 PM, Reid Draper wrote:
|
Not sure I follow, could you give an example? |
Let's say you use snowflake for unique ID generation. Snowflake is On 01/25/2012 07:18 PM, Reid Draper wrote:
|
Ah, I see, cool idea. What about the two-phase set? I've almost thought about removing it in knockbox, to be honest. |
It makes sense for certain ephemeral structures (say, purchase orders), On 01/25/2012 07:43 PM, Reid Draper wrote:
|
Regarding using k-ordered timestamps for tag, I'm afraid it's a bit of a large dependency. Suppose you want to use CRDTs in javascript on the browserside, or you just don't want your CRDT library to depend on an external ID generation service. It seems there should also be an additional "normal" timestamp field, that can be used across all CRDT libs without assumptions about infrastructure such as snowflake. Unfortunately logically ordered timestamps don't help for what I think is going to be the most common pruning predicate, keeping garbage around longer than your longest expected partition. |
Or you could use unix epoch seconds, or use iso8601 timestamps, etc, What bothers me is that you might use timestamps for your tags. Then I don't want to define the tags to be a specific kind of timestamp, On 01/25/2012 08:29 PM, Reid Draper wrote:
|
Timestamp + hostname might be good enough for the cases I'm thinking, at least if it's at millisecond resolution. I suppose it also wouldn't be hard to have an incrementing counter for the library, so tags are time + hostname + counter. I definitely like the idea of predefined timestamp/GC schemes. I'm (hopefully) going to have some time this weekend to dive back into knockbox, and GC is high on my TODO list. |
I like that idea. I'm cool with implementing a flake-like at the library [unix_time, host, pid, unique] and for lww-sets, just unix-time. Floats OK for times? Note, unix time can jump backwards, stop, hiccup, etc... we expose Obviously there will be a (gc obj) function to force garbage collection, For users who want to use their own tag strategy, they can easily extend --Kyle On 01/25/2012 08:44 PM, Reid Draper wrote:
|
What are your thoughts on where to store pruning parameters, ie. # of items to keep and/or # of seconds to keep? My gut says it's fine to have the library just decide this, but I could imagine some use-cases where you'd want to be able to have the object carry around this information, as it might be specific for the object. Thoughts? |
I would do both; if provided, you use, say "gc_max_items" and --Kyle On 02/01/2012 08:13 PM, Reid Draper wrote:
|
+1 to that idea |
I don't have a suggestion (yet), but wanted to put this issue down while I was thinking about it. Currently the JSON representation for these types, like the or-set, don't have the timestamp information that is needed to perform garbage collection.
The text was updated successfully, but these errors were encountered: