TL;DR
β‘ Opt for SST for new, simpler projects, rapid delivery, owning NextJS infra, or when having limited AWS expertise.
βοΈ Go with CDK when integrating with or migrating existing infrastructures, for large enterprise projects, or when dealing with intricate infrastructures.
Why β
If you're wondering which serverless framework to adopt for your next AWS project in 2023, you're in the right place.
Whether you're starting from scratch or working on an intricate enterprise infrastructure, this comparison dives deep into the pros, cons, and best use cases for the top contenders.
Stick around and let's ensure your next choice is an informed one π§ .
The contenders π₯
Here are our three contenders
1 - Serverless + AWS CDK + Lift: An integration that amps up the traditional Serverless Framework with Lift's static frontend construct and CDK's robust infra definition.
π‘ Have a look here to understand how the three are bridged together
2 - AWS CDK: AWS's native toolkit, offering a high-level, typesafe approach to AWS resources.
3 - SST: A TypeScript first framework streamlining serverless apps on AWS, from debugging to deployment.
Now let's dive right into our data-driven face-off between the frameworks. See how they stack up against each other across pivotal criteria. π₯
Comparison Table π
Criteria | Description | 1οΈβ£ Serverless Framework + CDK | 2οΈβ£ AWS CDK | 3οΈβ£ SST |
---|---|---|---|---|
Stars / Downloads | 45k β - 1.2M downloads/week | β 10k β - 1.6M downloads/week | 17k β - 35k downloads/week | |
Release frequency | 1 / month | 7 / month | β 36 / month | |
Ease of contribution | Codebase complexity and accessibility, communication with maintainers | "JS codebase Complex codebase" | β Slow processes hard to dev locally | π Easy to chat with the team (Discord) Codebase Typescript + accessible PRs are very slow to merge |
IaC Type-safety | Typescript definitions for all resources | "Base is YAML, but typescript support with @serverless/typescript. Serverless Framework resources are not natively typed." | β Fully typed | β Fully Typed |
Lambda Definition | Ease to define a lambda resource and its triggers | β Config file per lambda Triggers for many services + cron | π‘ Lambda configuration is verbose. No abstraction for lambda triggers, need to define them manually. | β Both inline and verbose lambda configuration are available. Trigger definitions for API Gateway, Eventbus, SQS |
Other Resources Definition | Ease of defining resources such as S3, DynamoDB, EventBridge, SQ | π΄ referencing serverless provisioned resources is hard CDK / serverless stacks are dissociated | β | β |
Framework flexibility | Extending the capabilities of the framework to fit your need | β possible with plugins | β low level framework, you can do what you like | π still a work in progress fallback to full cdk (losing other features) |
Static Frontend Deployment | Existing solution to deploy a static website | β Lift | π requires rebuild or use of less popular construct | β StaticSite in SST |
Next.js App Deployment | Existing solution to deploy NextJs server | π amplify plugin serverless-nextjs not maintained | π amplify π΄ cdk-nextjs (not well maintained) | β NexjsSite in SST |
DevX / Debugging lambdas | Ease of debugging lambda executions | π | β | β live debugging |
Debugging deployment | Ease of debugging fails during deployment | β | β | π SST adds a layer of liability |
AWS Features completeness | amount of supported features | π few releases, few contributors to implement new features | β | π‘ small delay (~1week) |
Multiple Runtime Deployment | Support for deploying multiple AWS Lambda runtimes | β | β | β |
Multi-stack Definition | Ability to define multiple stacks in a single file | β 1 serverless.ts per stack | β | β |
Nested Stacks Support | Support for AWS CloudFormation nested stacks | β | β | β |
Documentation | quality of the frameworks documentation | π yaml, no ready-to-use snippets but still quite complete | π‘ | π‘ |
Our recommendation π₯
Opt for SST if one of:
- Starting a fresh project of low to moderate complexity
- Prioritizing rapid delivery of value
- Implementing NextJS without Vercel
- Limited AWS expertise and need a more guided approach
Go with CDK if one of:
- Integrating with or migrating an existing infrastructure
- Engaging in large corporate projects deeply integrated with the company's Information System
- Handling intricate and detailed infrastructures.
Wrapping Up π
Deciding between SST and AWS CDK comes down to the unique needs of your project. As the serverless landscape evolves, so does our understanding.
Join the discussion, bring your experiences to the table, and please challenge our criterions! Let's journey together towards a more informed decision-making process in the serverless world. π¬π
Top comments (7)
SST doesn't support multi-account and multi-region deployments currently which AWS CDK natively does. Please be thorough with your research before publicly advocating solutions that might lock people in and limit their usability. For reference, refer this issue - github.com/sst/sst/issues/1299.
We based our analysis on a comprehensive, yet selective, list of criteria. If someone has a specific need that isnβt covered by these, they should conduct their own research. π€
We didnβt include multi-account deployment, but your input will certainly help others make more informed choices. Thank you π!
How do you compare 3 frameworks by excluding a core feature which the other two support? Doesn't makes sense!
Your βcoreβ feature might not be essential for everyone. Weβve been deploying serverless apps for years without needing it.
We didnβt mention the SST console, which is a βcoreβ feature for SST, but hey, whoβs keeping track? π
In the end everyone should pick the best for their use case, we just help people decide π
Well, you put in a point called "AWS Features completeness" and put in "small delay (~1 week)". Considering AWS's official tooling allows these features and SST doesn't even after 2 major versions, it's definitely nowhere close to feature complete.
Coming to SST Console, yes, it's a good feature, you should've added it and also added that it will be moved into a separate paid product.
If you do not clarify the limitations of a platform against another you're not helping anyone. Hopefully that makes sense.
Hey, your comment is very valid and I respect your willingness to share your experience with all. Maybe putting it across more subtly will encourage the author as well. No one can learn everything, and readers should take everything with a pinch of salt.
SST give a solution for websocket communication without websocket server?