Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Efficient design for a auto refresh mobile app

I was presented this problem few days back. Requirement was to design a mobile app which serves sports content to the user (say soccer). The app will allow the user to subscriber to specific team. Based on user's team selection, the apps serves only content related to that team on the user's home screen. Of course user has option to see content for all teams (via menu options).

Special focus was on how would the content on user's home screen get refreshed automatically and should also take into consideration that user has (or has not) subscribed to a specific team.

To the last question, I suggested following 2 solutions:

1) The app can send tiny requests to the server which would only contain user's identifier, user's team selection. Based on the team selection in the input request, the server would return only the content related to the team.

2) If the content volume is less and the number of distinct teams are few then broadcast all the information and let the app do the necessary filtering (of course this is less efficient compared to #1).

Sharing this on forum to get other possible design decisions. In case this is not the right forum, please answer in comments and I'll post in appropriate forum.

Thanks

like image 332
mukeshkumar Avatar asked May 05 '16 10:05

mukeshkumar


People also ask

What makes a good mobile app design?

The difference between good app design and a poor one is usually the quality of its user experience. Fast loading times, ease of use, and overall customer satisfaction during an interaction should be integral parts of your design. Great app design is clearly laid out, efficient to use, and aesthetically pleasing.

How do I automatically refresh apps on Android?

Here's how: Go to Settings > General > Background App Refresh. From the list of apps shown, use the toggle to turn Background App Refresh on or off for each app.


1 Answers

Basically when you want to do an auto-refresh system you have only two way :

1 : The client send request(s) periodically. This is enough if :

  1. The interval of refreshing is not too short
  2. You don't expect your application to run for millions of people
  3. Computing the result don't cost too much

This can be implemented with just a naïve use of some query on a database server-side. Of course if you need some more performance you can have some intermediary layers.

2 : Pushing result from servers : this is a bit trickier to architecture properly but here is somme good points :

  • You send only new data to clients
  • Performance wise it's the best

However the limits are more important :

  • Handling lost of connexions is a bit harder
  • You need to catch every events that update the datas in order to push your refresh to the clients.

But because there are more than you that need this architure solution exists : here is the one that fits the best for you in the Javaworld :

JMS : Java Message Service, which is a Message Oriented Middleware (MOM).

JMS is a specification with different implementation, personnaly i would go for activeMQ which is the Apache one. Here is a topic about that : Which JMS implementation do you use?

If you don't/can't use JMS then just remember this : Messare-Oriented-Middleware. Google that should help you to find what you need.

like image 94
Walfrat Avatar answered Sep 30 '22 19:09

Walfrat