I am working on one project that is similar to JIO cinema or Netflix. I have designed MySQL database for storing information of channels, VOD(Video on demand such as Movie or series episodes), seasons , series and user. It may also include information related to packages and subscription.
Now my requirements are to track user activities, including
- Tracking which user is currently watching which VOD or which Channel.
- Determining how many users are watching a particular channel.
- Identifying the most-watched VOD.
- Calculating the amount of time user spend on platform. etc.
To achieve this I need to store user activity and viewing logs, I am currently considering following options and have some concerns.
- Storing user activity logs in MongoDB,
then the possible schema will be
{
userId : (refers to the MySQL database user table)
channelId : (refers to the MySQL database channel table)
startTime :
endTime :
}
I am not sure is it good to store such dependent data in different database , and what consequences we may face in future.
-
Storing user activity logs in MySQL
If I store user-activity logs in MySQL it self then after some time as users will increases it will grow exponentially (userActivityLogs table to be specific) which will ultimately slow down performance. -
Should I move existing database structure to MongoDB and store payment related information which required consistency in MySQL ? If so how should I approach this ?
I researched various blogs that explains how Netflix System works and found that they use a Cassandra database for storing Viewing activity information which is NoSQL database
Here is a reference links
Netflix backend System design
, Netflix’s Viewing Data
, Slideshow
Can someone explain in an abstract way(if possible some using some simple example) how I can store such logs or suggest any other approaches I can use ?