This is a Javascript-based demo of the Redis Gears 2.0 Functions. A Redis Function is deployed that provides time slot counters at the 1 sec, 1 min, 5 min, 30 min and 1 day level for any given key. A REST API server implemented in Express JS provides client access to the function for increments and fetches of counters. Finally, a Javascript function is provided to simulate and time execution of random read/write operations on the counters.
A Redis Function library (server-side) provides the bulk of the functionality of this demonstration. That library provides 2 functions: increment and fetch. The increment function will update the associated timeslot counters (1 sec, 1 min, 5 min, 30 min, 1 day) for any given key. The fetch function will retrieve those counters for a key and a given time slot.
- Redis 2.0 Gears Functions, ExpressJS-based REST API server, simulator.
- Docker
- Docker Compose
git clone https://github.com/joeywhelan/ts-counter.git && cd ts-counter./start.sh./stop.sh100 iterations of random read/write operations at random time intervals (1 ms - 1 sec)
Ave Write Latency: 2.12 ms
Ave Read Latency: 1.82 ms

