Sign in to follow this  

optimising costs when deploying mobile game+web platform

This topic is 479 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all,

 

I'm building a very simple multiplayer math game (two or more gamers, remotely playing to see who answers simple 2+2=X like equations the fastest).

 

I am using phonegap for this since I don't really need a graphical environment and I am not much of a Java lover.

 

I'm also starting to build a Django web platform where the gamers profiles and rankings will be.

 

Now the question:

 - since this is a server-client based game, to optimise costs, should I build the game server side backend together with the Django backend? Or should I have a different backend for the effect? 

 - I would profit from something like Google App Engine to host all of this, so what do you think would be easier/cheaper to deploy? 

 

 

Thanks in advance

Share this post


Link to post
Share on other sites

1) since this is a server-client based game, to optimise costs, should I build the game server side backend together with the Django backend? Or should I have a different backend for the effect? 
2) I would profit from something like Google App Engine to host all of this, so what do you think would be easier/cheaper to deploy?

 
1. Generally the best way to keep costs low for development it isn't really to think about costs, more about leveraging the tools you know to get the job done.  If you are most comfortable with those tools and they get the job done, use them. If you are more comfortable with other tools and those get the job done, use them instead.
 
2. I don't really see you giving an option for that, as you've only listed one provider.  You'll need someone or something to host your machines, and there are plenty of ISPs and Cloud providers out there.  What works better for you is up to you. Bigger, more complicated systems tend to cost more (both more time and more money) but they can scale well. Assuming you need minimal power, you don't need all the fancy stuff of scaling infrastructure and automated build and deployment and a single virtual server, you can find hosting with database and other server access for $5-$10 per month.

Edited by frob

Share this post


Link to post
Share on other sites

Thanks for the reply frob

 

I guess you're right. I am just afraid that if I don't leverage from the cloud providers giving you auto scaling, I will eventually create a bottleneck with the same Django backend handling both web browsing and game app client requests.

 

Do you have a few references for ISPs/cloud providers/MBaaS you would recommend?

Share this post


Link to post
Share on other sites

I can think of a few that are likely outside your ballpark, like Equinix, Ubiquity, 1&1, and the very popular Amazon and Google offerings. They're especially great if you can get all your stuff going inside Docker containers for easy deployment. While it makes for a system that is somewhat easier to work with on a large scale, it requires significant effort to create so I doubt it is what you are looking for.

 

There are thousands of places that offer basic LAMP hosting for minimal costs. For the time being that would probably be the better choice.

Share this post


Link to post
Share on other sites

yeah I might start with the easiest LAMP approach and change according to the user demand. 

 

I'm sure I could easily make my stuff working inside Docker, but how does that ease the deployment in those providers? Do they scale the container horizontally on their own? Based on which metrics?

 

Thanks for the feedback. I'll try to investigate and predict the websocket performance without automatic scaling in a single server (LAMP approach) and start from there...read somewhere from some benchmarks that one can easily go to several hundreds concurrent sockets without any bottleneck. That's a good number to start with.

Share this post


Link to post
Share on other sites

While it makes for a system that is somewhat easier to work with on a large scale, it requires significant effort to create so I doubt it is what you are looking for.

Oh, so true. I spent much of the last year wrestling with Amazon Elastic Beanstalk, a system that is supposed to make it easier to deploy Python web apps on Amazon Web Services (compared to doing it the 'normal' way). In truth, it's a bunch of undocumented scripts with zero technical support and some of the most obscure errors I've ever seen.

 

To the original poster...

If it's just a Django app, I'd recommend hosting on Webfaction - their support is excellent and the prices are reasonable. It's not quite as point-and-click as some of the cloud providers, but it's closer to the normal way of running a server and therefore easier to debug. Heroku is another option, which is sort of a half-way house between Webfaction and AWS/Google App Engine/etc.

 

It's not clear what kind of server you need but you can probably do it all with Django, and using websockets (called 'channels' in Django) if HTTP won't suffice and you need faster binary connections.

 

Worry about scaling later. The chance of you becoming so popular overnight that you absolutely have to be on a load-balancing auto-scaling system is minimal.

Share this post


Link to post
Share on other sites

Thanks Kylotan, I'll check those two providers.

 

After reading a bit more, I am actually planning to use Django together with Node.js, where the later just plays a role in socketing the clients to the game server. I'll try to do some socket benchmarks of my own in some VMs but as you both said, basic hosting should be enough, for now.

 

btw, have you tried Firebase? Would a BaaS fit here? Never tried one or even understand their concept.

Share this post


Link to post
Share on other sites

I've not tried Firebase but I do know of people using it for a game backend. BaaS is exactly the sort of thing we're talking about and the idea is just that someone else handles all the boring authentication and persistence stuff for you, at a price. Maybe someone here will have more experience that they can share, but in the absence of that, I can only advise reading the various docs and APIs and thinking about what would help you the most.

 

I'm not sure what you mean by "socketing the clients to the game server". Personally I wouldn't touch Node.js at all if I didn't already have a large body of Javascript code I needed to re-use.

Share this post


Link to post
Share on other sites

I've not tried Firebase but I do know of people using it for a game backend. BaaS is exactly the sort of thing we're talking about and the idea is just that someone else handles all the boring authentication and persistence stuff for you, at a price. Maybe someone here will have more experience that they can share, but in the absence of that, I can only advise reading the various docs and APIs and thinking about what would help you the most.

 

I'm not sure what you mean by "socketing the clients to the game server". Personally I wouldn't touch Node.js at all if I didn't already have a large body of Javascript code I needed to re-use.

well I mentioned Nodejs because from what I've read, most of the real-time apps use websocket tools with Nodejs like socketio and and socketcluster.

 

channels seem relatively new in Django...

Share this post


Link to post
Share on other sites

Personally if it were me:

 

I'd go mongo to keep it light on the server side (linux, unubtu, mac) and you can either host your own server in the beginning which is easy with a macminivault.com with your own max. I use Fusion and point ip's to my node.js, mongo, and windows server.

 

Development:

 

PhoneGap is slow, has so many security flaws and in my opinion, sucks. In my previous company we did a test on all the major hybrid SDK's and found Xamarin was the best option as far as speed, development, and security. It was for a major bank.
 

If you're targeting multiple platforms web, hybrid, or both I would use Xamarin. It's c#, you can keep your web code in the same solution and you have Core function ( app code ) and then UI specific ( Web Views or native ). I have a game i'm working on which keeps all game logic in the core and I have openGL running on ios and Android using mostly the same libraries.

 

Xamarin converts both platforms to native code, adds 9mb to the deployment. For game game that's not much. You can also use side loading, not to be confused with a flash card.

 

I prefer mongo for object databases. For the BackEnd I would use "Service Stack". It rights all the plumbing code for retrieving data from a web service, so you can focus on your core and not write tons of communications layers.

 

I would also check out "CouchBase" as you can query from any language and platform and they manage all of the data for yo. It's used by world-wide companies so they are stable.

Edited by nick5454

Share this post


Link to post
Share on other sites

This topic is 479 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this