Using web service from about 100000 users in the same time -
i have web service called about...let 100000 users in same time (within 3 hours). services reads , updates sql database using entity framework 4.1. here code
[webmethod] public bool addvotes(string username,string password,int votes) { bool success= false; if (membership.validateuser(username, password) == true) { dbcontext context = new dbcontext(); appusers user = context.appusers.where(x => x.username.equals(username)).firstordefault(); if (user != null) { user.votat += votes; context.savechanges(); success = true; } } return success; }
the web service called android mobiles(as said maybe 100000 maybe more maybe less that`s not important right now). there deadlock possibility or possibility things go wrong?
what happen when reading database , when updating. 1 of answers said: updating field vote per each user. if there problem how advice me correct it.
thank in advance :)
this should fine.
the reason far can tell, thing happens when method called on behalf of user vote count (votat
) in row in database increased. long touching own row, , not row might touched 1 of 99999 other users, there no contention between users, , should scale well.
Comments
Post a Comment