8 Replies - 1455 Views - Last Post: 08 October 2012 - 02:51 PM Rate Topic: -----

#1 FourCrate  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 04-October 12

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?

Thanks for any input!

Is This A Good Question/Topic? 0
  • +

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

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9056
  • View blog
  • Posts: 33,998
  • Joined: 12-June 08

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

Posted 08 October 2012 - 11:00 AM

Moving to ASP.NET.
Was This Post Helpful? 0
  • +
  • -

#3 FourCrate  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 04-October 12

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

Posted 08 October 2012 - 11:11 AM

View Postmodi123_1, on 08 October 2012 - 11:00 AM, said:

Moving to ASP.NET.


Thanks, I was wondering if I should but wasn't sure as it isn't about any specific piece of programming code.
Was This Post Helpful? 0
  • +
  • -

#4 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3534
  • View blog
  • Posts: 10,941
  • Joined: 05-May 12

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

Posted 08 October 2012 - 01:56 PM

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?
Was This Post Helpful? 1
  • +
  • -

#5 FourCrate  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 04-October 12

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

Posted 08 October 2012 - 02:24 PM

View PostSkydiver, on 08 October 2012 - 01:56 PM, said:

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?
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9056
  • View blog
  • Posts: 33,998
  • Joined: 12-June 08

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

Posted 08 October 2012 - 02:28 PM

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.
Was This Post Helpful? 0
  • +
  • -

#7 FourCrate  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 04-October 12

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

Posted 08 October 2012 - 02:37 PM

View Postmodi123_1, on 08 October 2012 - 02:28 PM, said:

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?
Was This Post Helpful? 0
  • +
  • -

#8 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3534
  • View blog
  • Posts: 10,941
  • Joined: 05-May 12

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

Posted 08 October 2012 - 02:42 PM

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.
Was This Post Helpful? 2
  • +
  • -

#9 FourCrate  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 04-October 12

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

Posted 08 October 2012 - 02:51 PM

View PostSkydiver, on 08 October 2012 - 02:42 PM, said:

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...
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1