I see a lot of new, veteran, and non-JavaScript developers confused about the 2 styles of writing Promises in JavaScript. I wanted to cover what both style offers, why you’d use one or the other, and why you typically should choose one and not mix both together. Promises are a deep topic, so this isn’t a guide on the various ways Promises work, but it does include the basics.
(more…)Blog
-
3 Bugs This Week
Ensuring tech blogs don’t become the Instagram for Coders where we portray everything in our coding lives as perfect…
I had 3 bugs this week.
(more…) -
Large Step Function Data – Dealing With Eventual Consistency in S3
Introduction
Step Functions have a 32kb limit of data. I thought “just use S3” was simple, but there are some important details you need to know if you intend to update the data, and/or delete the data and read it many times. Below, we’ll cover how you can use S3 to solve this problem, and what bugs will occur if you’re not careful, and how to prevent those bugs from happening.
TL;DR; Updating an existing file on S3 and then reading it won’t always return what you just wrote; it may take a few seconds. Generate an MD5 hash of your file contents, and ensure any downstream services (Lambda, Batch, etc) utilize that MD5 hash. This will confirm if they have the latest version of the file; if not, simple fail with a specific error and have the Step Function wait a second and retry.
(more…) -
How AWS Changes Concurrency for Your Programming Language of Choice
I find it interesting the perspective difference between those who use servers and those who use Serverless, specifically around concurrency.
For example those who use servers talk about Node.js cluster module via pm2/forever, or Python asyncio / pool.
Yet on AWS… you don’t use those things. Even on ECS, using pm2/forever is kind of dumb. They have servers and containers… if a container crashes, just spawn another one. Need more? Spawn more servers and containers. Not limited to CPU core. Same for Python.
(more…)