简体   繁体   中英

How to setup ReactJs, NodeJs, Redis application on AWS

I am newbie in AWS and totally confused about the deploy. here i have

React for front-end, Nodejs for API, Mongodb for database and redis for session store.

  1. Can i use 1 EC2 for every service? or
  2. Divide every service as different EC2
  3. Can i use Elastic Beanstalk Environment?

Which is better option for scaling and update without downtime in future?

Can I use 1 EC2 for every service?

Its depend on your case but the best approach is to utilize the underlying EC2 instance is to run multiple services on single EC2 for nodejs and front-end app, as nodejs container-based application take maximum advantage in this case. in this case, ECS blue-green deployment with the dynamic port of the container can help to scale with zero downtime.

Divide every service as different EC2

In nodejs based application this approach does not help you a lot where for Redis and mongo it make sense if you are planning for clustering and replica also these applications need persistent storage so will keep storage on each instance, so my suggestion is to keep redis and mongo DB in daemon mode and application in replica mode, as these are application that will do blue-green deployment not the redis or Db.

AWS provides two types of task to deal with such cases

REPLICA—

The replica scheduling strategy places and maintains the desired number of tasks across your cluster. By default, the service scheduler spreads tasks across Availability Zones. You can use task placement strategies and constraints to customize task placement decisions. For more information, see Replica.

DAEMON—

The daemon scheduling strategy deploys exactly one task on each active container instance that meets all of the task placement constraints that you specify in your cluster. When using this strategy, there is no need to specify a desired number of tasks, a task placement strategy, or use Service Auto Scaling policies. For more information

ecs_services

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM