-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
serverless-application-model
The AWS Serverless Application Model (AWS SAM) transform is a AWS CloudFormation macro that transforms SAM templates into CloudFormation templates.
Prior to Lambda Containers we had to build a Lambda Layer using a myriad of techniques. The result was always something in the /opt directory, yet finding the right balance of what to put in that directory has always been a pain. For example, if your gem uses FFI (like ruby-vips) how do I build a layer, test it, and make sure that same layer is available for local development? Often times this required engineering some Docker & AWS SDK coordination. Not a simple process when means it could easily break or slow down testing upgrades to either the gem or supporting layer.
The Ruby community is no stranger to this practice. Thanks to Ruby Heros like Luis Lavena, many of our popular gems have precompile Windows binaries. Today other projects like Nokogiri are now supporting precompiled gem packages for several platforms. This makes gem installs easier for both Lambda zip and containers by avoiding layers or container deployed system dependencies. It also makes our bundle installs much much faster. This time adds up for both development and our build pipelines.
Here are some of the highlights from the mysql2-lambda project on how I built this gem for Lambda.
Since this project is for Lambda, we used the base image provided by AWS SAM CLI.
There is a great tool called ldd which lists dynamic dependencies. In my case the mysql2 gem did not statically link all dependencies. This is why I had to use patchelf to fix a few.
Welcome to my 3rd post in a long running series on Lambda & Containers. If you are a Rubyist new to Lambda and the Serverless Application Model (SAM), consider looking over this Ruby Microservice Workshop.
Related posts
-
Superpower REST API DX with Serverless ⚡ and DevOps Best Practices on AWS (🐍 Python Version)
-
Turbocharge your Lambda Functions with AWS Lambda Powertools for Python
-
Optimizing Costs in the Cloud: Embracing a FinOps Mindset
-
Billing for SaaS with EMF and CloudWatch Metric Streams
-
Serverless Site Health Check Notification System