APPEND GO SLICE CHANGE OTHER SLICE VALUE

Array in go doesn’t like array in other language. The array’s size is fixed and cannot be changed. Dynamic sized array in go is slice. The basic info of array and slice can be found in here. Appending new element in slice is allowed and the size will be increased if required. But appending slice may cause other slice’s element changed.

AWS LAMBDA BASE64 ENCODED REQUEST BODY/RESPONSE BODY

In some case, the request body in lambda is base64 encoded string with isBase64Encoded flag. Most guides teach developer to decode the request body in lambda function. This post will discuss the root cause of this problem.

LAMBDA HIT 6MB LIMIT EVEN IF FILE SMALLER THAN 6MB

In AWS Lambda File Basic Concept one limitation of lambda is 6mb payload size limit. But you may want to send file smaller than 6mb like 5mb but failed. The reason is encoding buffer to base64 string in lambda callback.

AWS LAMBDA FILE BASIC CONCEPT

In these few years, more application chose to implement in serverless approach. Serverless execute code without managing servers and provide a easy way for concurrent execution. Serverless is suitable for running short-lived, event-driven function. Running RESTful API Server in serverless more common now. Apart from returning JSON response, returning binary file is also allowed in serverless.