• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

How to code an app like HQ?

 
Ranch Hand
Posts: 47
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Questions:

- 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?
 
Bartender
Posts: 1868
81
Android IntelliJ IDE MySQL Database Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may want to look into using Spring and/or Spring Boot which you can find more out about here https://spring.io/
Spring has support for both REST and Web Sockets plus it has a scheduler and batch which you can use to run tasks periodically as noted here https://spring.io/guides/gs/scheduling-tasks/ and here https://spring.io/guides/gs/batch-processing/

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.
 
Screaming fools! It's nothing more than a tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!