Building with a traditional Postgres stack You start with two tables and an index on user_id . 1234567891011121314CREATE TABLE todos ( id SERIAL PRIMARY KEY, user_id BIGINT NOT NULL, text TEXT NOT NULL, completed_at TIMESTAMPTZ ); CREATE INDEX ON todos(user_id); CREATE TABLE todo_stats ( user_id BIGINT PRIMARY KEY, completed_count … Continue reading Rama in five minutes