Should I run MongoDB on my EC2 instance?

I'm just starting out with Amazon EC2 and trying to figure out how databases work. If I have a site with high traffic and you want to load the balance of traffic across multiple instances, I assume that these instances will need to extract and store data in a separate separate instance to avoid fragmentation of data on multiple computers.

Should I then install and run mongoDB on my own instance and connect all other instances to this single data store? Or do I just need to run mongo and my http server in one instance?

I would like to hear some of your best practices.

+4
source share
1 answer

It may not be necessary while you are developing, but you should do it when you go to production.

Moreover, if you use production data, you might want to run a set of replicas in order to have a backup, if something fails, do not lose your data and do not interrupt your service.

Databases are hungry for memory, so to share it with other processes is a bad idea. On the application server, you probably need more processor than memory, so you can use high processor instance types (c.medium, c1.xlarge) and use high memory types for your DB (m2.large, etc.) (High performance copies are cheaper)

In addition, from an architectural point of view, it is better to be able to scale the number of application servers regardless of the database. If you put application servers and databases on the same computer, this can lead to problems if you later have to switch to another.

+4
source

Source: https://habr.com/ru/post/1389450/


All Articles