Gal Talmor
Gal Talmor

Reputation: 1014

Would it be a wise choice to put an Angular 2+ app with Universal on AWS Lambda?

I'm developing an Angular 2+ app which needs to also have server side rendering. I believe the best choice for the server side rendering is Angular Universal, since it is the "official" solution.

Now I'm wondering what kind of hosting should I use. I could run my private managed server on EC2 or use AWS Lambda, although it's not its actual purpose.

I do believe we will use Lambda for the application's API, but that's another story.

I will be happy to hear any other options as well, but do keep in mind I do need server side rendering, so just using a static server, like S3, will not be sufficient.

Upvotes: 2

Views: 392

Answers (2)

Yuri G
Yuri G

Reputation: 1213

From my experience with AWS Lambda (not vast, though), the processing, and hence response, times are pretty unpredictable.

So if you have a tough SLA (like we do) - not an option.

If you're pretty flexible within hundreds of milliseconds - why not go for it, but remember to calculate your costs thoroughly, considering extreme/stress cases, then implement constant monitoring & alerting (& caps, if possible, don't quite remember is it with Lambda) - just for sake of not being caught by a kind of financial surprise with using utterly shared-resource environment capable to grow with almost no limits.

All in all, at my opinion, Lambda (at least, in its current state) is good enough for quite sporadic, very short-living, stateless processing not very critical to fall under some tough response time threshold.

Upvotes: 2

Ashan
Ashan

Reputation: 19738

Using AWS serverless stack(Lambda, API Gateway) for new web application projects including Single Page Applications(Angular, React & etc.) would be a good investment for long run.

The clear benefits are

  • Cost saving ( Opex vs Capex for infrastructure)
  • High reliability
  • Fully Managed Microservices (Modern Architectures)

And few challenges will be

  • Getting developers familiar with new concepts on Serverless and Microservices
  • DevOps
  • Finding the optimal solutions architecture in AWS

I would highly encourage to use Severless Framework to improve developer productivity along with the plugins.

Upvotes: 1

Related Questions