Menu

A Telegram dating bot for Armenian students: a feed over 105,000 profiles in 18 ms on a single VPS
πŸ“°

A Telegram dating bot for Armenian students: a feed over 105,000 profiles in 18 ms on a single VPS

DEV Community: postgresΒ·Eduard GrigoryanΒ·about 10 hours ago
#X15cxSb6
#devtopostgresql#devto#dev#feed#profile
Reading 0:00
15s threshold

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.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.