If each of your vouchers is in its own entity group then, as far as I understand your question, you will not need to use sharded counters.
To do the decrementing, you can create a task pipeline to decrement each of the subsequent vouchers, and because the vouchers are in different entity groups then the tasks can run in parallel. But why do you need to keep the voucher numbers consistent like this? Does it really matter if there are gaps? Writing financial apps on app engine is non trivial. Transactions are only available within entity groups. If you don't design your entity groups correctly then you will get write contention when you try do multiple updates to the same entity group at the same time which will prevent your app from scaling. Take a look at http://blog.notdot.net/2009/9/Distributed-Transactions-on-App-Engine Also something to watch out for: App engine is best used when there are a high number of reads and relatively fewer writes. Financial apps tend to have lots of writes within transactions which could catch you out if you didn't anticipate the cost of all those writes. Dale On May 1, 7:59 am, kavishme <[email protected]> wrote: > hi > i m new to GAE and also to python. > Currently i m developing a financial accounting application in which user > does about 100 voucher entries each day. the voucher numbering is > automatically. but if user deletes a voucher in back date then all > subsequent numbers on vouchers has to be decremented. > one way is to fetch each subsequent voucher from datastore and decrement its > number but that would be very time consuming. > > can this be done in any other way. > > i read about counter sharding but i did not understood it. can my problem be > solved by counter sharding -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
