AWS Key Issues

I am new to AWS and it has so many products (EC2, Load Balancer, EBS, S3, SimpleDB, etc.) and so many documents that I cannot figure out where I should start.

My goal is to be prepared for scalability.

  • Suppose I want to set up a simple web server that accesses a database in mongolab. I guess I need one instance of EC2 to run it. At the moment I need something more (EBS, S3, etc.)?

  • At some point, my application reached enough traffic, and I have to scale it. I was thinking of starting a new copy (instance) of my EC2 machine. But then he will have a different IP. So, how is traffic distributed between EC2 instances? Is it automatic? Should I hire a load balancer to distribute traffic? And then I have to pay for 2 copies of EC2 and 1 LB? At the moment I need something more (ex: Elastic IP)?

+6
source share
1 answer

Welcome to the Sony Santos Club,

AWS is a very powerful architecture, but with this power comes responsibility. I, and apparently many others, have learned a tough way to build applications using AWS.

You ask where to start? This is actually a very good question, but you probably won't like my answer. You need to read and do research on all the technologies offered by Amazon and even other providers such as Rackspace, GoGrid, Google Cloud and Azure. The Amazon is not easy to succeed, but it is not intended to be truly, its main focus is to be very customizable and have a very extensive api. But back to your question.

  • To start a simple web server, you need to run an EC2 instance; this instance is launched by default on a drive named EBS. Essentially, an EBS drive is a regular hard drive, except that you can do many other interesting things with it, for example, remove it from one server and transfer it to another. S3 is more of a file storage system, more useful if you have a bunch of images or if you want to keep a lot of backups of your databases, etc., but this is not a requirement for a simple web server. Just starting an EC2 instance is all you need, everything else will happen behind the scenes.

  • If the application reaches a lot of traffic, you have two options. You can scale your machine by turning it off and running it with a large copy. Generally speaking, this is the easiest task, but you will reach the point that you wonโ€™t be able to handle all traffic with 1 instance, even with a larger size, and you decide that you need two OR you need a more fault-tolerant application that will remain online in the network case of failure or update.

    If you create a second instance, you will need to perform some form of balancing. I recommend using the Amazons Elastic Load Balancer as easily customizable, and its integration with the cloud is better than using Round Robin DNS or an application like haproxy. Elastic balancing loads are not expensive, I believe that they cost about $ 18 per month + data that is transferred between the loadbalancer.

    But no, you no longer need to scale your site. 2 instances of EC2 and ELB will do the trick.

Additional questions that you did not ask, but probably should have.

  • How often does an EC2 instance experience a hardware failure and crash my server. What if this happens?

    This happens often, usually in batches. Sometimes I go for months without any problems, then I get several server crashes at the same time. But its defiant that you should plan, I did not at the beginning, and I paid for it. Make sure that you are creating scripts and that your backups and backup plan are ready to crash your server. Be fine if it is a down or load balanced solution from day one.

  • What is the hardest part about scalability?

    Testing Testing Testing Testing ... Never accept anything. Also be prepared for sudden bursts in your movement. You should be ready for anything, if your page goes from 1 to 1000 people per night, are you ready for this? Have you experienced what you โ€œthinkโ€?

Good luck and have fun ... I know what I have :)

+12
source

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


All Articles