G
G
GrizZzly2015-02-22 13:31:19
PostgreSQL
GrizZzly, 2015-02-22 13:31:19

Rails, what is the correct way to get data from multiple clients and display it?

Good afternoon, I am writing an application on Rails, I need to display a map with markers on the page. Marker coordinates are asynchronously transmitted from mobile clients (android application) in a certain way and they need to be stored (cache) somehow. Contain: public key, latitude, longitude. Except for displaying markers, no data is needed.
What is the best way to store this temporary data? If we limit ourselves to the cache (Redis), then there is a problem with sending data to the cache (from the mobile application), or rather, with the authentication of such connections. Storage in the database itself is redundant, because. the data is frequently updated, but this will greatly simplify the integration with the Rails application.
System features: from 100 simultaneously connected clients of the mobile application, frequency of sending: 1 time per 3 seconds, load on the web application: up to a thousand clients. Ruby on rails 4.2, Postgresql 9.3.5, leaflet+OSM map, no third party APIs used.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vsuhachev, 2015-02-23
@vsuhachev

It is not clear what confuses you in the Redis option? Create a controller that accepts a token + coordinates, performs authorization and saves data in Redis.
Then you create a controller that reads coordinates from Redis at the request of maps with markers and issues all new markers for the requested time interval.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question