lazyengineering / faststatus

Simple API for sharing if a resource is free, busy, or very busy
MIT License
1 stars 2 forks source link

Datastore for Status over time #9

Open jessecarl opened 8 years ago

jessecarl commented 8 years ago

While the simple data store for current status fits most use cases, the ability to look at the change in status over time may be useful for some cases.

The best option would be to simply use a time-series database like InfluxDB. But, because that implementation is trivial, and this project is mostly for exercise, fun, and exploring self-contained, minimal services, an implementation built on Bolt is probably more appropriate.

jessecarl commented 8 years ago

One possible approach is to create a singly-linked list embedding the Resource type for working with the data in the application. Storing that data, another type embedding the Resource along with an optional Next key in one bucket, where keys are a simple hash of the Resource, and storing the head hashes as values in a different bucket with the original IDs as the keys. It may not be nearly as effective, and is absolutely not as easy to query as a real database, but it will be fun to build.