A GopherCon 2025 talk by Garrett Denis, principal engineer at School, covering how they replaced slow PostgreSQL LIKE queries for typeahead/mention completion with a Redis-backed prefix trie. The approach precomputes all prefixes for user first and last names, stores them as Redis sorted sets, and uses Lua scripts for lookups. Group membership filtering is handled via Redis set intersections, and intermediate results are cached to speed up repeated queries. The solution brought response times consistently under 40ms. Key gotchas discussed include data sync challenges between PostgreSQL and Redis (no distributed transactions), growing memory usage, and limitations for advanced filtering beyond simple prefix matching.
•7m watch time
22 Impressions