Loop/Architecture/Redis: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 5: Line 5:
! Date !! Author !! Changes
! Date !! Author !! Changes
|-
|-
| Wed Sep 17 11:48:12 CDT 2014 || Rémy Hubscher || Braistorming about using Redis as a Key-Value data store
| Wed Sep 17 11:48:12 CDT 2014 || Rémy Hubscher || Brainstorming about using Redis as a Key-Value data store
|-
| Wed Sep 17 12:18:12 CDT 2014 || Alexis Métaireau || Adding information about how the data flows, and a general overview of the problems.
|}
|}
== What are the problems we're trying to solve? ==
Currently, Loop server uses exlusively redis to store data, it uses it via elasticache and has only one master and one replica.
The problems:
* Redis can reach capacity and we currently don't do anything about it (sharding is one potential answer to that concern);
* In case the redis master goes down, we don't have any mitigation plan.
== Data flow ==
We currently using redis to:
* Store long-lived data:
  * data identifying the user (data from the FxA / MSISDN  assertions);
  * simple push urls;
  * call-url associated data;
  * user sessions.
* Store short-lived data:
  * Call state information;
  * Calls information.
* Handle the pubsub between call parties in the call setup protocol (progressurl)
When a call takes place,
# The user registers on the server;
  * (read) If a session is passed, check it's valid;
  * (write) A simple push url is stored;
  * (write) If no session is passed, a new one is created.
# The user creates a call-url
  * (write) The session is touched.
  * (write) A new call-url is stored;
# The user checks what are the active calls:
  * (write) The session is touched.
  * (read) The list of calls is retrieved
# A new call is issued:
  * [Optional: (write) The session is touched in case a session exists];
  * (read) The simple push urls of the callee are retrieved;
  * (write) A new call is created.


== Architecting ElastiCache Redis Tier ==
== Architecting ElastiCache Redis Tier ==
Line 52: Line 96:




=== Links ===
=== Links / Resources ===


* http://aws.amazon.com/elasticache/details/
* http://aws.amazon.com/elasticache/details/
* http://www.8kmiles.com/billion-messages-art-of-architecting-scalable-elasticache-redis-tier-3/
* http://www.8kmiles.com/billion-messages-art-of-architecting-scalable-elasticache-redis-tier-3/
* http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/ManagingReplication.html#ManagingReplication.PromotingReplica
* http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/ManagingReplication.html#ManagingReplication.PromotingReplica
Confirmed users
120

edits