We have been asked to design a solution for a leading cellular company with more than 40 Million customers to cater to the need of showing up the call and charges details.
There would be a nightly batch refreshing call and charges details for all customers into Mongo DB
Mongo DB needs to support data for an online system.
- Customer can search based on From date and To date
- Customer can select one or multiple past bills (Bill Date) to see the call details
There are multiple billing cycle and the customer can choose to part of any billing cycle.
The customer can change the billing cycle once year.
Data needs to be retained for 1 year and then data needs to be Purged.
Avg Call items per day per customer = 20
So for 365 days and for all customer line items = 20 365 40 = 292 Billion
Data usage line item per day per customer = 10
So for 365 days and for all customer line items = 10 365 40 = 146 Billion
Customer Mobile Number
Tarif Plan name
Total Amount Due
Summary of Current Charges
- Monthly Rental
- Voice Call Charges
- SMS Charges
- Data Services
Total Current Charges
Data Usage details
Units in (MB)
Points to Ponder
- Do we keep the header information and call details in same collection or different?
- In case of different collection what is the best way to join the different collection at mongo level or at application level
- Should Call and Data details be in same collection or different.
- Should the billed and current call and Data details be in same collection or different
- What pattern should be used for these collections and the reason for using same