I have to setup a server environment for a web application. I have to use aws, and so far it looks good for that purpose.
I need:
- a scalable Tomcat 7 webapp server
- session replication!
- a mongodb database cluster(?)
As far as I think it could work with:
- The scalable Tomcat 7 I can do easily with elastic beanstalk.
- The session replication could work with elasticache
- It seems like I have todo the mongodb cluster “manually”, so I created some ec2 instances todo so.
I have some problems with that.
- the costs would be quite high. The minimum setup would be 2 ec2 instances and one for the elasticache
- The only thing, which autoscales, is the elastic beanstalk, means that I have to take care of that, too. (Well, for the mongodb instances, I could use a balancer, too)
- In case of the mongodb ec2 instances, I need to setup each instance by myself
Do you have any idea how to:
- lower the costs (Especially in the beginning, it would be a little much, no?)?
- make the administration easier?
Autoscaling for your web server is easily done with Elastic Beanstalk, but you can use it independently. Check out the documentation for autoscaling here: http://aws.amazon.com/autoscaling/
It has couple of features that will help you save most of your computation costs;
Using Elastic Cache, can help you both in the session replication, but also to lower the load on your DB machine. You can cache there your frequent queries output (front page, main category page…), and get better performance, and use fewer DB instances. It supports Memecached clients, which makes it very easy to develop in almost any programming language.
You should check Couchbase instead of MongoDB (see comparison). It is more robust and more reliable in scale.