help with linear scaling in XAP
Hi, I am solving a problem how to linear scale my OLTP application. Payment orders are generated in webservices or an application logic called from web forms. On my ordinary PC I can process a few orders per second. What if I need 1000 per second? I came accross XAP and read some documentation and samples. I conclude that I can easily put the PaymentProcessor in a "Processing Unit" which can be loadbalanced by XAP runtime. But I assume that it implies distributed transaction and it further implies central transaction manager (JINI) -> a potential bottleneck and expensive RPC calls too. Does it also imply that I should mark account's name getter with SpaceRouting annotation? Is there any other way how to linear scale such kind of application e.g. without expensive distributed transactions? I'm a newbie here, maybe I miss some important feature of XAP or EDG...
In a nutshell here is a demonstrative "pseudocode":
class Account { String name; int balance; }
class PaymentOrder { String receptorName; String donorName; int amount; }
class PaymentProcessor { // autowired // works over hibernate AccountDao accountDao;
@Transaction
void processPayment(PaymentOrder order) {
Account donor = accountDao.getByName(order.donor, READ_EXCLUSIVE);
Account receptor = accountdAo.getByName(order.donor, READ_EXCLUSIVE);
if (donor.balance - order.amount < MIN_GLOBAL_BALANCE) throw new InsufficientMoneyException();
if (receptor.balance + order.amount > MAX_GLOBAL_BALANCE) throw new AccountOverflowExecption();
donor.balance = donor.balance + amount;
receptor.balance = receptor.balance + amount;
accountDao.update(donor);
accountDao.update(receptor);
} // end of transaction
}
Thank you very much for your help and hints.
PS. Sorry for my english.
Edited by: Martin Smid on Aug 21, 2008 10:44 AM
Edited by: Martin Smid on Aug 21, 2008 10:46 AM
{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2547]{quote}