96 points · by sciurus · 10y ago · 48 comments
Say you're trying to measure/analyze the use of a feature like clicking a button. You want to record every time a user clicks the button, their user ID, and some attributes of the user (maybe in bucket A or bucket B of a test). Later you'd want to be able to answer questions like "how many times was this button pressed?" or "how many unique users pressed a button?" or "how many times did users in bucket A press the button?".
Is that an "appropriate" use for postgres? Or is that the kind of "metrics" that a DB like Dalmatiner would be more optimized for? Is there a nice overview of the various kinds of DBs out there and what use cases they're optimized for?
What DalmatinerDB was build of is handling high numbers of metrics like CPU usage, memory usage, etc, everything where for every point in time you have exactly 1 value. In that space it can handle millions of metrics (read millions of inserts) at the same time where a system like postgres would stat to have problems in my experience.
A "metric" doesn't imply multiple samples over time (although researching for this comment, there doesn't seem to be a strict definition)
https://docs.dalmatiner.io/en/latest/benchmarks/jpc.html
"8,500,000 and 9,000,000 metrics per second" on a 5 node cluster.
This is impressive.
The 1 node is impressive as well (and it shows how it scales):
1,500,000 metrics per second
No guarantee of storage
DalmatinerDB offers a 'best effort' on storing
the metrics, the ingress transport is UDP and
there is no log for writes (there is the ZIL if
enabled in ZFS) or forced sync after each write.
This means that if your network fails packets can
get lost, if your server crashes unwritten
data can be lost.
[1] https://github.com/dalmatinerdb/dalmatinerdb#no-guarantee-of...UDP is no longer used (this is outdated sorry for that), the connection is TCP now as it turned out over all the performance was better.
Dataloss can still occur since DalmatinerDB keeps a cache (which other metric stores might also do). A lot of that can be mitigated by using N=2 (or 3) to store data in multiple nodes that will reduce the chance of dataloss significantly. Keeping caches isn't uncommon however, to ensure full consistency it requires a kind of transaction from that goes from client to server to client, which is 'really' costly and I am convinced not worth it for metrics, a few seconds of lost metrics doesn't warrant the cost of that.
https://dataloopio.wordpress.com/2016/03/21/playing-with-dal...
A colleague of mine is working on his PhD about time series storage and created it.
What's the status of an official Ruby client?
"No guarantee of storage. DalmatinerDB offers a 'best effort' on storing the metrics"
https://github.com/dalmatinerdb/dalmatinerdb#no-guarantee-of...
That actually makes me even happier. :-)
I like to see new riak_core applications being made. For the most part it's a pretty clean framework to bootstrap something with.
I have a current particular interest in riak_core over the top of a pile of disk_log because I want something Kafka shaped, but where topics are cheap, and sloppy-leader-esque behavior is the default without destroying data. Optimizing for availability over everything else and guaranteed delivery of all ACK'd messages put into the system if the end of all logs have been reached (via continuation).