22/04/2026
We're building a microservices platform in C++ on AWS Lambda. Every service ships with the same set of shared libraries β and we were packaging all of them, every single time. 30 services meant 1.5GB of nearly identical files on every release.
It was slow, wasteful, and honestly a bit embarrassing once we did the maths.
So we split it: one shared layer that all services reference, and a lightweight packager that only ships what's unique to each service. The whole thing works because every build comes from the same Docker image β so the shared parts are guaranteed to be identical.
A couple of scripts and a manifest file later β deployments dropped by 99%. Wrote up the full approach π
When you build AWS Lambda functions in C++ using the custom runtime (provided.al2), every deployment zip ships the compiled binary alongside every shared library it depends on β the AWS SDK, libcurl, zlib, libstdc++, and dozens of transitive system libraries. For a single function, the ~50MB zip i...