# Notebook 7: Redis, ClickHouse and Cassandra, the stores the design docs add # run at: 2026-11-18 21:26 UTC # runner: Linux-7.0.0-1016-aws-x86_64-with-glibc2.43 | 4 vCPU # PostgreSQL: 18.7 (Debian 18.7-1.pgdg13+2) # MySQL: 8.4.13 # MongoDB: 8.0.38 # Redis: 7.4.12 ## Redis: a leaderboard of 100,000 players in a sorted set memory for the sorted set: 9.6 MB 10,000 ZINCRBY, one round trip each: 12511 ops/s, 0.080 ms each ZREVRANGE top 10: 0.212 ms -> player:11605=100045, player:52494=100036, player:4988=100022 ... ZREVRANK player:42: rank 67405 in 0.099 ms ## Redis: a fixed-window rate limit, 5 requests per window request 1 -> count 1 -> allowed request 2 -> count 2 -> allowed request 3 -> count 3 -> allowed request 4 -> count 4 -> allowed request 5 -> count 5 -> allowed request 6 -> count 6 -> rejected request 7 -> count 7 -> rejected TTL on the key: 2 s; waiting 3 s ... key exists after the window: False -> the next request starts a new window # ClickHouse: 24.8.14.39 ## ClickHouse: 10,000,000 order lines, then a report that reads two columns INSERT ... SELECT of 10,000,000 rows in one statement: 4.2 s column created_at on disk 37.26 MiB uncompressed 37.10 MiB ratio 1.0x column customer_id on disk 8.02 MiB uncompressed 74.19 MiB ratio 9.3x column note on disk 592.07 KiB uncompressed 120.56 MiB ratio 208.5x column order_id on disk 41.27 MiB uncompressed 74.19 MiB ratio 1.8x column price_cents on disk 3.95 MiB uncompressed 74.19 MiB ratio 18.8x column qty on disk 194.42 KiB uncompressed 37.10 MiB ratio 195.4x column sku on disk 142.99 KiB uncompressed 13.99 MiB ratio 100.2x revenue by SKU since 2026-10-01, top 3: [('sku-499', 444315.9), ('sku-99', 444051.0), ('sku-399', 444025.9)] in 8 ms rows read: 870400, bytes read: 15273984 ## ClickHouse: one row per INSERT against one batch 200 single-row INSERTs: 0.24 s, 200 parts on disk (merges paused to show it) 1 INSERT of 200 rows: 0.004 s, 1 part on disk # Cassandra: 5.0.9 ## Cassandra: chat messages, partitioned by (conversation_id, bucket) 100,000 messages across 1,000 conversations written in 10.7 s latest 20 messages of conversation 42 (one partition): 20 rows in 3.3 ms, newest first: message 99042 query by sender_id (not part of the key): rejected -> "Cannot execute this query as it might involve data filtering and thus may have unpredictable performance. If you want to execute this query despite the performance unpredictability, use ALLOW FILTERI