node.js - How to scale up an EC2 web service from staging to production -


i'm new server-side development , hoping can fill in blanks or recommend appropriate tutorials me scale staging web service built using node.js v4.2.4 on single aws ec2 t2.micro instance production environment resilient down time.

in order avoid downtime , make optimal users in multiple regions (say europe , usa now), believe need following.

  1. create ec2 instances both europe , usa running same web service.
  2. create elastic load balancer points both ec2 instances if 1 goes down or experiences high load, automatically route other. downed instances should automatically restart if instance alive.
  3. create cloudfront points elb. both ec2 instances should able automatically push new content want cached cloudfront.
  4. create ec2 node.js database holds user authentication data. i'm playing around mongodb open other dbs.

questions:

a. correct far?

b. make sense host user database on separate ec2 instances actual web service?

c. user database has maximum uptime, expect need host on multiple instances. how should share database across instances? sharding for? when new account created, new db entry automatically appear in both copies of database.

d. plan support https. sensible add support @ end or cause problems?

e. else i've missed or need consider?

just add on iskore's answer:

b

isolating db ec2 instance provides better control on operations scaling storage , have idea in case of issues figure out problem is.

c

for ec2 instances located in 1 region can connect rds(in same region n.virginia) adding security group rds inbound rule allowing ec2 ip or ec2 security group access.

if application has user base spread out on planet, can use cross region read replicas serve read queries aws region close user. https://aws.amazon.com/blogs/aws/cross-region-read-replicas-for-amazon-rds-for-mysql/

d

https requires generating , adding certificates though.it's easy.

e anytime


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -