To give a different choice, try a non-connected but bi-directional protocol such as a message queue (of which my preference would be ZeroMQ) where you can push changes to the client, and if the client happens to be disconnected, it'll get them when it next connects, and you can push updates to all connected clients very easily. (there are plenty of topology scenarios you can support with a message-passing architecture).
You will care if you have a lot of clients all polling the server for updates, so if you're looking to have several clients, its best to think of this from the start.
Why Rewrite What you can Get Off the Shelf?
Why not use RedDwarf Server (formerly Project DarkStar)?
RedDwarf Server is an open source middleware solution for developing the server-side of massively multiplayer online games. It is the official community fork of Project Darkstar, an open source project supported and managed by Sun Microsystems. - from RedDwarf's Wikipedia article
RedDwarf's domain seems down today (2013-06-12), but there's still a wiki, and they are migrating to a GitHub repo.
RedDward presents its philosophy and goals as:
- Make server-side game code reliable, scalable, persistent, and fault-tolerant in a manner that is transparent to the game developer.
- Present a simple single-threaded event-driven programming model to the developer. The developer should never have his or her code fail due to interactions between code handling different events.
(from the RedDwarf Tutorial)
Not that this doesn't mean that server-code is single-threaded, but that it is abstracted from the game developer's perspective. The RedDwarf Tutorial provides a lot more information on what RedDwarf can do and clarifies many of its design decisions.
One point of concern for you, though, was that the multi-node capability wasn't fully implemented last time I check (ca. 2011).
From Scratch
That shouldn't stop you from attempting to do most of these things from scratch, if you value the learning experience. However, this is a major effort and will be rather time-consuming, and as, you noted in your question, some of these issues are rather low-level in the tech stack to deal with and will greatly increase the complexity of the code you'll have to maintain.
But anyways, regarding your 3 options, your first one seems the best to me, if you were to go for a home-made implementation. Option 2 (using HTTP servlets) seems only adapted for some games, though I guess it could be a relatively decent alternative to implement something yourself while still delegating to the a middleware, and you could benefit from many web server additions for handling the load (cache modules, etc...). Option 3 (using JMS + JEE) indeed seems overengineered, but it's hard to know for sure without knowing what you have in mind.
And if you're here to try to learn, then obviously Option 1 will cover a lot of ground. But it's going to be a rather uphill battle.
Best Answer
When there is a single server entry point, web requests are generally served in a first-in-first-served manner.
If the system architect is aware that some requests should have higher priority than other requests, he may employ a Bulkhead Pattern (either temporarily for an expected traffic spike, or as part of the stable architecture), where a dedicated entry-point is added for that traffic, to be handled by dedicated resources (put in a different queue, run on a different CPU or machine).
For example, if all traffic goes to
http://www.example.com/my_service
, "privileged" clients will be instructed to usehttp://vip.example.com/my_service
, where they will be handled by a dedicated server, which may run the same code as the normal server, or may run dedicated code.A more elaborate option is to configure the load balancer to dispatch certain client IPs to a separate server, which takes the control completely out of the client's hands.
There is no standard way for some client to get priority on some server arbitrarily, mainly because if there was such a way, wouldn't all of the clients be implemented that way? Who wants less than premium service?