How would an ASP .NET web application handle constant user requests?

Posted 08 October 2012 - 10:58 AM

I want to make a text based MMORPG in C# and ASP .NET. The game will involve constant, continuous updates for example the character/skill experience a player has. My question is, how would I store/update those skill experience variables?

Would I update the SQL Server database every single time a change is made to the "experience points" variables or would I only update the database at certain time intervals? What state management would be best to store such data that is continously updating and is private to each user? How might the requirements/techniques need to be changed if the website/web application becomes extremely popular with heavy traffic?

You'll need to persist the state data. Be in it a database or some other file area. The reason for this is twofold:
- what happens to the player state if the web front end app crashes/hangs?
- what happens when load balancing needs to happen and a request is going to serviced by a different front end box than the box that has the player state just in memory?

You'll need to persist the state data. Be in it a database or some other file area. The reason for this is twofold:
- what happens to the player state if the web front end app crashes/hangs?
- what happens when load balancing needs to happen and a request is going to serviced by a different front end box than the box that has the player state just in memory?

Thanks for your reply.
If the app crashes/disconnected etc. than I expect that all the temporarily stored player data will be lost before it is saved in the database. So you are saying that I will have to update the database everytime there is a change (changes which will be happening constantly). Wouldn't this have a bad effect on the server traffic as data comes and goes to the client from the server?

I would figure the complex information that is being generated is generated on the server and the client's view is updated after the fact.

That's right, that's what I think would happen. The server would also generate code in reponse to requests by the users/players so there is a bidirectional flow of data which I think would be a strain on the server. Is there any way to improve performance or is this the only way to go about it?

Good databases can handle thousands of updates per second, middling ones can handle hundreds of them per second. It is very unlikely you are writing complete 4K-10K records for every update, you will only be updating 16-128 bytes of any given record at a time. Something that should well be within the realm of the capabilities of your network and database.

Also consider that this is a text based MMORPG on the web. Humans have upper limits on their typing speed. Then there is the network latency that will slow the humans down some more. So unless you allow bots to abuse your game, then I don't think you have to fear about pushing your database are network to be worried about the data traffic.

Even if you were paying by the amount of data sent to/from your database, I believe that even Amazon Web Services doesn't start charging you until you start breaking the 1GiB barrier within a month. Can your users generate enough database updates to break 1GiB? They will have to type in the entire contents of the Encyclopedia Britannica within a month. Of course, this all goes out the airlock if you aren't using normalized relational database, or if your object oriented database is really dumb about doing record updates.

Good databases can handle thousands of updates per second, middling ones can handle hundreds of them per second. It is very unlikely you are writing complete 4K-10K records for every update, you will only be updating 16-128 bytes of any given record at a time. Something that should well be within the realm of the capabilities of your network and database.

Also consider that this is a text based MMORPG on the web. Humans have upper limits on their typing speed. Then there is the network latency that will slow the humans down some more. So unless you allow bots to abuse your game, then I don't think you have to fear about pushing your database are network to be worried about the data traffic.

Even if you were paying by the amount of data sent to/from your database, I believe that even Amazon Web Services doesn't start charging you until you start breaking the 1GiB barrier within a month. Can your users generate enough database updates to break 1GiB? They will have to type in the entire contents of the Encyclopedia Britannica within a month. Of course, this all goes out the airlock if you aren't using normalized relational database, or if your object oriented database is really dumb about doing record updates.

Thanks so much for this Skydiver! This has been great reassurance for me. I will just start experimenting with demo sites to begin with and experiment with performance etc. I know there are so many other factors that affect speed so will see what has what effects. The database I will use will be SQL Server and I know that's a good one. Also due to the fact that it is text based, I think I can get away with large amounts of text...