i*****a 发帖数: 572 | 1 Design a service that keeps track of mobile users as they check in at
different locations. This service will get informed of each check-in in real
time (a user/location pair) and must be able to answer the following
queries in real time:
1. Where is user U right now?
2. What users are at location L right now?
The following requirements apply:
1. A user can only be at one location at a time. If user U checks in at
location X and then at location Y, they are no longer at location X.
2. A check-in only valid for at most 2 hours. If user U checks in at
location X and then does nothing for 2 hours, they are no longer at location
X.
The service should have durable enough storage that you can restart it
without losing all of your data It should not store everything in memory.
what kind of DB will you use and how data will be organized and any indexes.
If storage is spread out over multiple databases(locations), how is that
done?
scalability/availability consideration, how will be distribute multiple
servers. what happens when the traffic goes 10x all of sudden. What happens
if one of the server goes down. | p*****2 发帖数: 21240 | | j**********r 发帖数: 3798 | 3 Cassandra with TTL storage and a location index. |
|