Keep the health centre's queue on a real Redis: INCR, TTL, job queues, caching, memory and AOF. 16 levels, played right in the browser with nothing to install.
Redis is a key and value store held in memory. SET writes one value under one key name, GET reads it back, and both take microseconds. At Puskesmas Kecamatan Sukamaju, the counter's tablet, the phone app, the waiting-hall TV and the pharmacy's computer all use one Redis on the mini PC under the counter. Every program in the book is run by the real Redis 8.10.2 through ioredis, and the log copies each command Redis received with its reply.
One Redis can be used by many clients at once. Redis runs their commands one at a time, but two commands from one client can have another client's command in between. Numbers in Redis are stored as text, and Redis has commands that change such a number in place, with no need for the client to read it first.
A key in Redis can be given an expiry. When its time is up, Redis deletes it by itself, and the next reader knows to fetch fresh data. TTL answers the time left in seconds: -1 means the key has no expiry, -2 means the key no longer exists.
Besides strings, Redis has several data types. A hash is one key holding many field and value pairs, much like one row of a record. Every key has one type, and a command for another type on that key is refused.
A sorted set keeps unique members, each with a number score, always ordered by score. It suits rankings: who has the most, who was fastest. A range is taken by position number, starting at 0.
A list in Redis is a row of values you can add to and take from at the left or right end, which suits a queue of jobs. Some list commands can wait: the connection that calls one stays quiet until there is something, then gets its answer at once.