master

Build a key value API that returns the time stamp of insertion when you insert a key.

  1. Given the key only, return the value of the latest time stamp.
  2. Given a key and time stamp return the value of the nearest time stamp in the past or equal for the key
  • Maybe Hash Addressing with Chaining
  • Time constantly increments
  • Inserts happen in order so data can be stored in order
  • This is sort of like commit log or event store/stream

key -> bucket

-----
|   | -> [ [timestamp, value], , , ]
-----
-----
|   |
-----
-----
|   |
-----

Because data is already sorted we can hash the key, to find the correct bucket. Then perform a binary search to find the value closest to the desired timestamp.