"be consistent" | |
PerlMonks |
Re: A distributed design challengeby cavac (Parson) |
on Jun 29, 2012 at 20:49 UTC ( [id://979181]=note: print w/replies, xml ) | Need Help?? |
You should have a central server that works on the account balance. Make it use UDP or persistent TCP connections. On the network side, it only has to support 3 actions, which namely are "reserve fund for bidding" (temporarly block that amount of money on the account), "bid has succeded" (remove the blocked amount from spending budget) and "bid has failed" (unblock money and release it for another bid request). For speed, you could devise some kind of hashing algorithm on the client side to determine which server manages which accounts. >Take a look at memcached. This is basically a similar system (just not specifically trimmed to your purpose). You might even be able to adapt it to your needs.
"You have reached the Monastery. All our helpdesk monks are busy at the moment. Please press "1" to instantly donate 10 currency units for a good cause or press "2" to hang up. Or you can dial "12" to get connected directly to second level support."
In Section
Seekers of Perl Wisdom
|
|