The scenario is given below.
Large number of data in mongo DB and the data growing per day is 10 ,000.
Requirements and Tips
1. Needed REST API which should perform in a proper manner.
2.REST API should be able to access frequently updating data as well as not frequently updating data. .
Ex: Latest released films of the day -frequently updating
Ex:User’s interested films -not frequently updating data
3.No limitation to scale up(horizontal or vertical) the system
-response time ,support to large user base,load balancing (DB Replication is ignored for demonstration purpose)
4.Multiple platform supports ,WEB and Mobile
5.Same user account can be used with different devices(Android ,IOS,Web)
Scale up the the database and make a distributed architecture
- Increase the performance of the server-ABC
- Indexing to most important fields
- Server XYZ was added to store region B related data,
- Maintaining history collection to move old data .
- A reference collection which has references for the data where it is stored (ex:ABC or XYZ)
Setup to build the API environment;
- Setup nginx on 80 port
- Setup Node API on 8080 port
- Install Redis cache and mongoDB
Implemeting API with expressJS
- Authentication with web token
- Signup and login
- Token usage for resources
please visit for the source code ,Source code.