I have an app idea where the design and is similar to HQ. I want to code with Java with a MySQL database. The reason I picked these two is because Java is a strong language and both are supported by Google App Engine.
However, coding a system like HQ is a big question mark. The server the app speaks with is so different from a "normal" server. I mean it's not a traditional server where the client ask for data when needed. It's rather the opposite.
For those whom haven't tried HQ, here is how it works:
After running the app for the first time, the user register an account. Two times per day, at a fixed time schedule, a user can sign up for a competition 10 minutes prior to start. While a user waits in a lobby, they can see how many people signed, updating live. There is also a chat for everyone. Usually there are around 400k users for a competition. The competitions take about 15 minutes close afterwards. The user have to wait until next competition before being able to do something in the app.
- What architecture do you think they are using? REST or web sockets or both?
- What process trigger a new competition? Is it a cron job?
- How can the server send so much data to so many persons simultaneously?
- How do the app know when a competition starts? Do they poll the server constantly or is this pushed to everyone with the app installed? I know the app sends a push notification but I thinking on when the app is open.
- Finally, how would You code an system like this?
MySQL is fine, but have you heard of MariaDB? This may be an even better solution and the MariaDB people say it can do pretty much everything that MySQL can and more plus it's compatible with MySQL.
P Marksson wrote:How can the server send so much data to so many persons simultaneously?
They probably have their servers at data centers and/or in a cloud environment distributed around the world.
It is totally possible to get some systems in data centers with more then two terabytes of ram, but you get what you pay for and this may cost a lot.
P Marksson wrote:How do the app know when a competition starts? Do they poll the server constantly or is this pushed to everyone with the app installed? I know the app sends a push notification but I thinking on when the app is open.
You may want to try changing a value in a database record and have a service poll that database on a regular basis.
On Android systems you could create a service to do this, which runs in the background.
If you are looking into Android application development you should be aware that many of the newer Android applications are programmed in Kotlin.
You may want to look into using microservices to break this project down into logical processes/programs or segments, where each logical process/program or segment is a microservice.
When Netflix went into microservices they reduced their program startup time by about two thirds.
“The strongest of all warriors are these two — Time and Patience.” ― Leo Tolstoy, War and Peace
Don't play dumb with me! But you can try this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!