Can I put my java server in the cloud?

Posted on 2014-08-10
Last Modified: 2014-08-16
If I make an RTS game server, I shouldn't have, like my last one, the server Threads sitting on my office floor machine? I can run multiple server Thread instances in the cloud? For a couple of cents a server?
Or mass game server numbers in the same cloud? - or all on one flat-rate monthly account?

Question by:beavoid

    Author Comment

    So, basically, the answer is yes.

    Would my game be classified as an EE application? It is a Java class with datagrams and sockets as a connected server at an IP address.
    Cloud server space is just accessed from Java code, just like calling a function method within a class?
    If I program my game locally in my office, will converting the server Threads to the cloud be straightforward?
    Should I program the whole thing from the cloud as step 1?
    LVL 86

    Expert Comment

    , I shouldn't have, like my last one, the server Threads sitting on my office floor machine?
    You can, perhaps, think of the new scenario as being in 'the cloud' (though that's often associated with just storage) but all that's changed is the location of the server.

    It's not a J2EE app as such, it's just a client server Java app so you will need hosting that allows you to run an app in a  JVM
    LVL 26

    Accepted Solution

    There's 2 types of 'clouds' you could use.

    The simpler to understand one is a cloud of servers - Amazon's EC2 is the classic example (  In that model you rent a complete server from them - generally by the hour.  This is exactly like having a computer in your office.  You can login to it, copy files to it, run applications on it etc.  The only thing you don't have is physical access to it - you do everything through remote connections.  But it's a full server.  You pick the operating system (Linux, Windows etc.) and install everything on it that you need - in your case at least Java.  Then you copy your application to it and run it.

    Because in this model you're dealing with a normal computer (just at a distance) if your application runs on your local office machine it will also run, without any changes on the remote computer.

    The second type of cloud provides the ability to run an application without you setting up a server at all.  The classic example of this is Google app engine (  Here the model is different.  You upload just your Java application and Google decides what machine(s) to run it on it, handles the operating system etc.  You are dealing with a much higher level abstraction.  It's as if I said "email me your Java app and I'll run it on my servers for you".  You don't know what operating system I'm using or how to setup a firewall to protect it etc.  If you go for this model, you don't have as much control over how the application is run, but you also don't need to do as much work upfront.  However, you may find you need to make some changes to the design of your application - since it's not running in exactly the same way that it would run on your office computer.

    Personally I've used EC2 and find it very straightforward.  Google has also entered that space now ( and the prices are very competitive between the two services - which makes for good deals for users like you.  I've not personally used Google app engine so I can't help with the details of how you setup a Java app inside the engine.  But since it's from Google there's mountains of examples and docs out there.

    Hope that helps explain the landscape a bit better,


    Author Comment

    Is processing payments within a user-account, for certain account aspects relevant here, or is that for SQL?
    I'd like my site's users to pay for access to certain features, actually, pay to enter a state of readiness for inclusion in a game. Does that influence a decision here, or is that completely within my game's pre-game setup? Another question, but I'm just curious for a quick mention?
    LVL 26

    Assisted Solution

    It doesn't matter where you servers are running for how somebody will pay.  The basic mechanism is essentially:

    a) Player wishes to unlock feature A for $5
    b) You send them to a site (e.g. paypal or a credit card processing site or iTunes etc. etc.) where they complete the transaction
    c) Paypal sends you a confirmation that user X paid $5 to your server(s)
    d) You add something into your database showing that user X now has unlocked feature A
    e) When the game client loads, it calls to your server to ask what features the player has unlocked and gives them a different experience.
    f) If the client tries to take an action that hasn't been paid for, the server blocks it.  [So a hacked client can't use a feature that wasn't paid for]

    Hope that helps,


    Author Closing Comment


    I assume payment verification is relatively simple?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Suggested Solutions

    Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
    Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
    Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
    This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now