Hey HN!
Rivet is an OSS game server management tool that enables game developers to easily deploy their dedicated servers without any infra experience.
We recently open-sourced Rivet after working on it for the past couple of years. I wanted to share some of my favorite things about our experience building this with the HN community.
My cofounder and I have been building multiplayer games together since middle school for fun (and not much profit [1]). In HS, I stumbled into building the entire infrastructure powering [Krunker.io](http://Krunker.io) (acq by FRVR) & other popular multiplayer web games. After wasting months rebuilding dedicated server infrastructure + DDoS/bot mitigation over and over, we started building Rivet as a side project.
Some interesting tidbits:
- ~99% Rust and a smidgeon of Lua.
- Bolt [2] – Cluster dev & management toolchain for super configurable self-hosted Rivet clusters. It’s way over-engineered.
- The entire repo is usable as a library. Our EE repo uses OSS as a submodule.
- Traefik used as an edge proxy for low-latency UDP, TCP+TLS, & WSS traffic.
- Apache Traffic Server is under-appreciated as a large file cache. Used as an edge Docker pull-through cache to improve cold starts & as a CDN cache to lower our S3 bill.
- ClickHouse used for analytics & game server logs. It’s so simple, I have nothing more to say.
- Serving Docker images with Apache TS is simpler & cheaper than running a Docker pull-through cache.
- Nebula has been rock solid & easy to operate as our overlay network.
- We use Redis Lua scripts for complex, atomic, in-memory operations.
- Obviously, we love Nix.
- We keep a rough SBOM [3].
- Licensed under Apache 2.0 (OSI-approved). We seriously want people to run & tinker with Rivet themselves. We get a lot of questions about this: [4] [5]
Some HN-flavored FAQ:
> Why not build on top of Agones or Kubernetes?
Nomad is simpler & more flexible than Agones/Kubernetes out of the box, which let us get up and running faster. For example, Nomad natively supports multiple task drivers, edge workloads, and runs as a standalone binary.
> [Fly.io](http://Fly.io) migrated off of Nomad, how will you scale?
Nomad can support 2M containers [6]. Some quick math: avg 8 players per lobby * 2M lobbies * 8 regional clusters = ~128M CCU. That’s well above PUBG’s 3.2m CCU peak.
Roblox’s game servers also run on top of Nomad [7]. We’re in good company.
> Are you affected by the recent Nomad BSL relicensing [8]?
Maybe, see [9].
> How do you compare to $X?
Our core goal is to get developers up and running as fast as possible. We provide extra services like our matchmaker [10], CDN [11], and KV [12] to make shipping a fully-fledged multiplayer game require only a couple of lines of code.
No other project provides a comparably accessible, OSS, and comprehensive game server manager.
> Do you handle networking logic?
No. We work with existing tools like FishNet, Mirror, NGO, Unreal & Godot replication, and anything else you can run in Docker.
> Is anyone actually using this?
Yes, we’ve been running in closed beta since Jan ‘22 and currently support millions of MAU across many titles.
[1]: https://github.com/rivet-gg/microgravity.io
[2]: https://github.com/rivet-gg/rivet/tree/main/docs/libraries/b...
[3]: https://github.com/rivet-gg/rivet/blob/main/docs/infrastruct...
[4]: https://github.com/rivet-gg/rivet/blob/main/docs/philosophy/...
[5]: https://github.com/rivet-gg/rivet/blob/main/docs/philosophy/...
[6]: https://www.hashicorp.com/c2m
[7]: https://www.hashicorp.com/case-studies/roblox
[8]: https://www.hashicorp.com/blog/hashicorp-adopts-business-sou...
[9]: https://news.ycombinator.com/item?id=37084825
[10]: https://rivet.gg/docs/matchmaker
[11]: https://rivet.gg/docs/cdn
[12]: https://rivet.gg/docs/kv
I'm particularly encouraged here by the tools and approaches chosen — Redis for matchmakers, ClickHouse for analytics/logs, Rust for speedy backend operations were tools I eventually came upon as best for the job after a long and painful process of iteration with inappropriate cloud dev tooling (with basically any datastore other than Redis you will run in to issues matchmaking).
High traffic/concurrency in matchmaking is a hard problem when you need fast, consistent matches. Existing industrial-sized matchmakers (Google's OSS OpenMatch, AWS GameLift, etc.) require locking in to a very specific format or spinning up an entire K8S cluster, which for game devops teams already stretched thing is a tall ask). And for all that effort, you may discover the performance characteristics of their approaches aren't what you need, or (as has happened to us with different game web service/API/middleware providers) they may choose to abruptly deprecate the service upon which you built.
Appreciate the dedication to making this available and the focus on helping gamedevs get up and running as fast as possible. Looking forward to playing around with Rivet and seeing where it might fit in our stack — & would love to talk shop on this with anyone since I've been tortured by / interested in these problems while trying to simultaneously run a game studio / make new games / keep everything online the last few years!