views:

123

answers:

2

Am just curious on how mobile service providers manage the data used to top-up airtime in your cell phone.

In my region, when you want to top-up airtime on your cellphone, you buy a "scratch" card that has a unique number which you key in on to your cellphone. If the number is valid the amount value of the card is added to your account as airtime.

By now am trying to imagine there must be billions if not trillions of rows holding the previous used numbers, i guess thats how the system get to know if the number you keyed in has been used previously or not. The system must be doing a lookup to some table and verify if the number is valid or not (am guessing).

My question is how do you well do you manage such huge amount of data in a table? What systems(databases) would be the best to handle this kind of a problem? An do you save this records forever? What is the best approach/technique/algorithm can you use to tackle this kind of a problem?

Gath

A: 

One approach is to look at this the other way around:

If you generate the serial numbers, and manage their distribution, you can limit the number of unclaimed numbers in circulation, which will remain relatively static, and give predictable performance when checking if the number is unclaimed or not.

Rowland Shaw
sound logical, but please go a bit deeper on your answer.
gath
+1  A: 

These scratch card numbers are usually generated offline in batches. The data then takes two routes.

1) The numbers are loaded into the telephony network balance top-up system

2) The numbers go into the desired distribution channel

The top-up system has two main interfaces, one for receiving top-up requests (scratch ard number and phone number/MSISDN) and one towards the phone networks realtime charging system which maintains the subscriber balance (in GSM that's an IN).

The top-up system knows only about the issued but not used scratch card numbers, that reduces the data volume to whatever is out in the field. As soon as an scratch card number is activated, the top-up system adjusts the balance and forgets the scratch card number (less the usual logging and so on).

This implies that scratch card numbers may be re-used after activation, there's no need to remember that a scratch card number has been activated before. Actually the numbers are usually fixed length, that requires some sort of re-use.

The data volume (issued but not used scratch card numbers) and non-real-time-requirements allow for some standard database system.

The approach/technique/algorithm used to tackle this kind of a problem may be described as "remember only what you need to know in order to do the job".

Bernd
+1, lets see if i got this straight, the top-up system receives a scratch number checks if exists in the Auto-generated batch pool, if yes activate it (top-up relevant account) and DELETE it from the batch. Its simple if you are not in the batch pool you are invalid.
gath
That's it in a nutshell
Bernd

related questions