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.
Write :
There would be a nightly batch refreshing call and charges details for all customers into Mongo DB
Read:
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.
Retention
Data needs to be retained for 1 year and then data needs to be Purged.
Volumetrics
Call
Avg Call items per day per customer = 20
So for 365 days and for all customer line items = 20 365 40 = 292 Billion
Data
Data usage line item per day per customer = 10
So for 365 days and for all customer line items = 10 365 40 = 146 Billion
Header
Customer_number
Customer Name
Customer Address
Customer Mobile Number
Bill period
Bill date
Tarif Plan name
Previous Dues
Payments
Current Charges
Total Amount Due
Due Date
Summary of Current Charges
- Monthly Rental
- Voice Call Charges
- SMS Charges
- Data Services
Subtotal
Taxes
Total Current Charges
Call Details
Date
Time
Called Number
Duration
Units
Amount
Data Usage details
Date
Time
Units in (MB)
Amount
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