-
Notifications
You must be signed in to change notification settings - Fork 331
Description
Problem
According to docs the current implementation stores all anonymous events in Redis
This has two significant downsides:
- A single point of failure ( One redis writer has a limit of how much traffic it can handle )
- huge ram cost
As you pointed out in the documentation:
REDIS RAM = 1 Event Size * Events per month
1 event ~= 2 Kbyte
10 000 000 events per month ~= 20GB RAM per month
10M events / month is really not that much.
its ~ 231 events per minute or 3.4 events per second.
Large scale tracking load is mesured in thousends of events per second.
At this point redis ram consumption will explode.
Solution
Implement Retroactive User Recognition is a background task, no need to store those events in a hot cache like redis.
Instead they can be stored in any cloud storage as files ( under a path containing the user anonymous id )
This solves the ram consumption problem.
And once a user is identified
a background process can update the records according with the identified user.
In this scenario redis will only contain the coordinating info ( and can be updated asyncronuesly )