February 04, 2021
There are lots of new features in this release. Here’s the new features that I’ve seen highlighted the most.
- Modular Packages
In prior versions, we’d just
npm install the entire
aws-sdk package and everything was in there. Now the sdk is split among multiple npm packages. Just install the packages that you need to use for your application. This is a big win for being able to get those code bundle sizes down.
- Middleware Stack
The Middleware Stack gives developers more control over the lifecycle of the requests sent via the aws-sdk. My internal mental reaction is similar to how I felt after hearing the AWS Lambda Extensions announcement. It seems interesting, but I’m not quite sure what I’d do with it. That doesn’t mean this isn’t an exciting feature to someone else.
- First Class TypeScript Support
TypeScript is growing in popularity, so it seems fitting that AWS would continue the trend. As someone who recently started using TypeScript, this is pretty exciting.
Let’s See Some Code!
Because I was curious about how everything might look in v3, I experimented by converting a minimally featured CRUD api to use the new version. Check out the README to see the high level architecutre of the app. And here’s the git diff when converting from the sdk v2 to v3.
util-dynamodb package here. Another example can also be found in my git diff mentioned above.
Post update March 7, 2021 Looks like there’s now a DynamoDB Document Client 😀.
Out of caution, I plan to wait for things to settle a bit more before doing upgrades on major business critical applications.
This has been a fun experiment to see what’s changed, what stayed the same, and what I can look forward to in the future. Overall, I felt like AWS did a great job with this rewrite.
What are your thoughts on the update? Have any fun use case ideas with the new middleware stack feature? Let me know!