No Database No Retention No Party

submited by
Style Pass
2024-04-24 14:30:04

One month ago I wrote this article You don’t need a database, a queue, a distributed system: Go is enough. and I posted it on HackerNews.

At a certain point, there were from 80 to 150 contemporary games and everything was good: no errors, the Golang backend was behaving in the best way. ( 🎉 wohooo 🎉)

The solution is quite trivial: we need a db, need login, need a leaderboard, we need a way to incentivize competition between users, and a ranking system. And that is exactly what we have done! And again, Golang comes with a special treat:

Building a leaderboard is expensive and difficult to maintain it updated. So once we get it, we need to cache it. So, here is how you can implement a simple route cache (in memory) with TTL:

I am having so much fun using this stack and implementing it all in this artisanal way. And I am looking forward to the moment the scale will force me to rewrite it all!

Leave a Comment