Which AWS services for mobile app backend?

时间:2017-08-05 11:14:03

标签: amazon-web-services amazon-s3 amazon-ec2

I'm trying to figure out what AWS services I need for the mobile application I'm working on with my startup. The application we're working on should go into the app-/play-store later this year, so we need a "best-practice" solution for our case. It must be high scaleable so if there are thousands of requests to the server it should remain stable and fast. Also we maybe want to deploy a website on it.

Actually we are using Uberspace (link) servers with an Node.js application and MongoDB running on it. Everything works fine, but for the release version we want to go with AWS. What we need is something we can run Node.js / MongoDB (or something similar to MongoDB) on and something to store images like profile pictures that can be requested by the user.

I have already read some informations about AWS on their website but that didn't help a lot. There are so many services and we don't know which of these fit our needs perfectly.

A friend told me to just use AWS EC2 for the Node.js server + MongoDB and S3 to store images, but on some websites I have read that it is better to use this architecture:

We would be glad if there is someone who can share his/her knowledge with us!

2 个答案:

答案 0 :(得分:3)

If you want a very high scalable application, you may be need to use a serverless architecture with AWS lambda. There is a framework called serverless that helps you to manage and organize all your lambda function and put them behind AWS Gateway. For the storage you can use AWS EC2 and install MongoDB or you can go with AWS DynamODB as your NoSql storage. If you want a frontend, both web and mobile, you may be want to visit the react native approach.

I hope I've been helpful.

答案 1 :(得分:1)

  • 运行代码:你可以使用lambda,但要小心:你的好处 不必担心服务器,有时候缺点是lambda 不合理地慢。如果你真的需要它,那么你需要它在EC2上 具有自动缩放功能。如果你正确地调整它就像一个魅力。
  • 存储数据:DynamoDB如果你想要它真的很快(单个数字 毫秒,无论负载和数据库大小,并根据最佳 实践。它需要适当的架构或将花费你一大笔钱, 否则在EC2上使用MongoDB。
  • 如果你需要RDBMS然后RDS(好处: 可扩展性,可用性,没有维护的麻烦)
  • 缓存:它们同时具有Redis和memcached。
  • S3:存储静态资产。
  • 我不建议CloudFront,市场上还有另一个CDN更好 价格/可能性。
  • API网关:是的,如果您有API。
  • 根据您的应用,您可能需要SQS。
  • 如果您想使用google / fb / etc验证您的用户身份,Cognito是一项很好的服务。
  • CloudWatch:如果你是公制 - 上瘾,那么它不适合你,也许是独立的EC2 会更好。但是,对于大多数人来说,CloudWatch绝对可以。
  • 创建所有必要的警报(CPU过载等)。
  • 您应该使用角色 允许从lambda / AWS访问您的S3 / DB。
  • 您不应该使用root帐户,而是创建一个单独的用户。
  • 创建结算闹钟:你会知道你是否会打破预算。
  • 创建lambda函数来备份您的EBS卷(以及您可能需要备份的任何其他内容)。如果备份稍后启动就没有问题,所以 Lambda还可以。
  • 偶尔运行Trusted Adviser。
  • 最好使用CloudFormation堆栈进行设置:如果/需要的话,您将能够轻松地在另一个区域部署相同的基础架构,同时管理基础架构也相对容易。代码比手动构建时。