Ok, so - bandwidth and database usage.
The first is easy. You may want to try and determine what's your optimal values. Some things to keep in mind from the very start:
- Keep your protocol light. Check JSON - it's human-readable and yet compact enough. Or you may want to implement a binary load.
- You may want to try and throw some flow control in the mix:
- Client-side heuristics: What's my current write latency? Under X milliseconds, keep updating each 5 seconds. Over X, 10 seconds. Over 5x X, 30 seconds.
- Server-side Quality of Service (QoS): Processor load over X%? Push a message to the clients, tell them to update every 10 seconds instead of 5.
About the database - it can be tricky, but nothing is impossible. Some thoughts:
- Cache your data access; if you're asking for record N, and there was no update for it, no need to hit the database again - just read from a memory cache.
- Use in-memory objects to read/write, commit to database once the processor load is low, a time limit is reached, or N operations where processed.