Front-End

Dispatching Custom Events for Front End Analytics Application

When we have a web analytics application that collects front end event data such as Tealium, Adobe Analytics and so on, we can dispatch an custom event whenever user does action on the page. For example, we can dispatch a custom event to indicate the user clicked certain button on …

AWS

How to Run Lambda Function Every 30 Seconds

To schedule a lambda function to run at a regular interval, we can use CloudWatch Events. The problem is that the shortest interval is 60 seconds with CloudWatch Event scheduled job. What if we want to run a function under 60 seconds interval? Using a sleep function to loop the …

Node.js

JavaScript Workout

I made a JavaScript workout with a md file in my GitHub repo. Check out the work out here. The idea of this is to list a short JavaScript programming questions that you would encounter every day as a JavaScript developer. If you know how to do these, you don’t …

AWS

AWS CDK ERROR: There is already a Construct with name ‘XYZ’

When I was running AWS CDK, I got this error and couldn’t really find the answer when I googled it. This error might happen for different reasons, but I worked out what was wrong with my CDK code after a few hours of googling and trying out different things. I’m …

AWS

How To Optimise Memory Allocation For Lambda Functions

In terms of computing, the lambda has only one parameter to tune, memory allocation. We can allocate any amount of memory between 128MB and 3008MB to your function today. The amount of memory you allocate is proportional to the amount of CPC allocated for the function. The lambda pricing is …