Reactive Backend Architecture for Location-Based (GPS) Game

Rafael Faita
Javarevisited
Published in
8 min readOct 16, 2020

--

Context

Some time ago, a friend came to me and asked a question: “How could I create an architecture for a GPS Game, as Pokémon GO?”.

At that moment, I started to think about millions of aspects, and my mind was blown. But when I calmed down, I started to think about how we could accommodate this kind of architecture and the result of my thoughts are here in this article.

The only fixed premise that I had in mind has: “Use the reactive paradigm. You want to learn this kind of programming flow for a long time, and now is the moment to learn this”.

Big Picture

Like in all my articles, I like to start with the big picture of architecture.

Backend architecture

Business Summary

The game probably will end with complex business rules, but to the context you, I pick the happy path of the game:

1 — When the client logs in to the server, it opens a dual channel of communication with the server

2 — Every X seconds the client sends the current position(latitude, longitude)

3 — When the server receives the position, the server replicates the information to three components:

--

--