How do you make the feed of a Telegram dating bot respond in milliseconds with 105,000 profiles on one inexpensive VPS? We walk through it on our own project β a bot for university students in Armenia (ΥΥΏΥ₯ΦΥ΄Υ«Υ―, Mtermik) built with NestJS + Telegraf, PostgreSQL, Redis and Next.js: denormalization via a trigger instead of a JOIN, a lock order that prevents deadlocks, a Redis the bot can live without, and why our scaling limit turned out to be Postgres memory rather than CPU. We found all of this with load tests before launch, not on real users.
Why another dating bot
Almost every student in Armenia is on Telegram, while the big dating apps have no idea which profiles actually belong to people studying nearby. The idea is simple: only students in the feed, and every one of them verified β with a university email or a photo of a student ID.β¦