So, I've just decided to build my own fantasy sports web site.
You know the type of site where you can pick players from your favourite league and depending on how they do you get a certain amount of points in your team. There are fantasy teams for all types of leagues and sports, I'm sure you know what I'm talking about.
I haven't settled for a specific sport or league just yet because I want the basics to fit to different types of team-based sports.I have a few expectations on it myself. If you can come开发者_如何学编程 up with any other I'll be glad to hear them.
- I expect the site to be dynamic and have many visits during a game, but almost only static content otherwise.
- Player points should be updated in real-time during a game.
- I would need a list that shows each game being played and the points of every player in that game. It should also show minutes played, goals, assists etc.
- Each registered user would be able to see the points and players of his/hers team updated in real time.
- I need the site to scale so that if I start with 1000 teams I could end up with 5 million.
- I probably won't be needing language support right now, but who knows in the future.
Based on these prerequisites what would be best to use in terms of language (php, .NET, drupal or other cms's), database (mysql, sqlserver, xml) and other techniques?
Maybe it doesn't really matter what I use?I guess the dynamic and real time update of each player's points is where I need help the most.
Thanks in advance!
/Niklas
EDITED
I could use an array with the following data for a specific game week:- Player ID
- Minutes played
- Sport specific points(goals, assists, penalties, yellow cards, man of the match bonus) etc.
- Total points in current game week
When the game is over I'd add these to a DB and sum this data with any previous game weeks. Plus player value, number of teams that has selected this player, etc.
You are probably going to have to go down the custom route for your "Game" code - rather than using a CMS, although depending on your experience, you may be able to leverage a framework (e.g CodeIgniter) to speed up some of your DEV time. This type of site would be pretty language agnostic, however it would depend on the actual numbers of users you are looking at as to the most scalable solution / set of techniques to deploy.
One of the biggest considerations you are going to have to look at would be the design of the data model, and the platform that this sits on.
If you want to be processing near to realtime updates, you are going to want to focus your efforts on making the DB queries / processing the most efficient possible.
One big consideration that you have not discussed here is caching. There is some data on your site that I am sure will be static for long periods of time (such as weekly totals etc), and there is data that will be very much real time (but only during match days).
However, during match days you will have a lot more traffic than non match days, and you will therefore have a lot of requests for the same data in a short period of time. Therefore, employing a good caching strategy will save you masses of CPU power. What I am thinking of, is to calculate a player's score and then cache for 1 minute at a time, therefore each time that specific player is requested, you are retrieving from a cache, rather than recalculating each time.
精彩评论