Luciano Mammino ๐Ÿ“™ Node.js Design Patterns

Luciano Mammino ๐Ÿ“™ Node.js Design Patterns

@loige.co

AWS Serverless Hero & MVP. Senior Architect fourTheorem, author of ๐Ÿ“• http://nodejsdp.link & โœ‰๏ธ http://fstack.link Node.js, JavaScript, Rust ๐Ÿฆ€ & Cloud โ˜๏ธ

2.1K followers885 following1K posts

Luciano Mammino ๐Ÿ“™ Node.js Design Patterns reposted

What if your AWS containers could start 10ร— faster without changing your code? ๐Ÿ‘€ Eoin and I ran 1,320 ECS task executions to find out. Spoiler: SOCI lazy loading is seriously impressive, especially with large images. Also, #AWS Bites #podcast is BACK! ๐ŸŽ™๏ธ

What if your AWS containers could start 10ร— faster without changing your code? ๐Ÿ‘€ Eoin and I ran 1,320 ECS task executions to find out. Spoiler: SOCI lazy loading is seriously impressive, especially with large images. Also, #AWS Bites #podcast is BACK! ๐ŸŽ™๏ธ

We tested 44 configurations: #Fargate vs #EC2, #ARM vs #x86, #gzip vs #zstd, and more. The benchmarks are open source, and there are some interesting surprises and trade-offs. Unlike our podcast release schedule, these containers are FAST. ๐ŸŒ๐Ÿš€ awsbites.com/155-how-we-m...

awsbites.comHow We Made AWS Containers Start Up to 10ร— Faster!What if you could make your AWS containers start up to 10ร— faster without changing your application code? In this episode of AWS Bites, Eoin and Luciano explore...

Luciano Mammino ๐Ÿ“™ Node.js Design Patterns reposted

Big update to Crafting Lambda Functions in Rust! ๐Ÿฆ€๐Ÿš€ Chapter 10 is out: Tower-powered middleware for AWS Lambda. Think tracing, error handling, headers and rate limiting, without the boilerplate in every handler. And there's a brand-new cover! ๐ŸŽจ๐Ÿ”๏ธ

Big update to Crafting Lambda Functions in Rust! ๐Ÿฆ€๐Ÿš€ Chapter 10 is out: Tower-powered middleware for AWS Lambda. Think tracing, error handling, headers and rate limiting, without the boilerplate in every handler. And there's a brand-new cover! ๐ŸŽจ๐Ÿ”๏ธ

Luciano Mammino ๐Ÿ“™ Node.js Design Patterns reposted

Sometimes my pull requests end up with dozens of comments and the interface starts breaking down. Between hiding comments and no easy way to keep track of what I've read, I miss important details. I've asked folks at GitHub for an Outlook-style view, and I finally decided to build my own.

Luciano Mammino ๐Ÿ“™ Node.js Design Patterns reposted

I've used #Docker for 10+ years and I thought I knew how image layers work. Then I asked one innocent question: if layers are just tar archives stacked on top of each other, how can a layer DELETE a file from a previous one? ๐Ÿงต loige.co/hidden-desig...

loige.coThe hidden design compromises of Docker layersHow Docker and OCI image layers represent filesystem changes, why deleting a file needs special whiteout entries, and what happens if you create a file called .wh.foo.

I've used #Docker for 10+ years and I thought I knew how image layers work. Then I asked one innocent question: if layers are just tar archives stacked on top of each other, how can a layer DELETE a file from a previous one? ๐Ÿงต loige.co/hidden-desig...

loige.coThe hidden design compromises of Docker layersHow Docker and OCI image layers represent filesystem changes, why deleting a file needs special whiteout entries, and what happens if you create a file called .wh.foo.
View full thread

I've used #Docker for 10+ years and I thought I knew how image layers work. Then I asked one innocent question: if layers are just tar archives stacked on top of each other, how can a layer DELETE a file from a previous one? ๐Ÿงต loige.co/hidden-desig...

loige.coThe hidden design compromises of Docker layersHow Docker and OCI image layers represent filesystem changes, why deleting a file needs special whiteout entries, and what happens if you create a file called .wh.foo.
View full thread

If you found this useful (or just learned something weird about Docker today ๐Ÿ˜„), please share the article with a friend or colleague who works with containers. It really helps! And if you already knew about whiteouts, congrats: you were several "layers" ahead of me ๐Ÿ‡

I've used #Docker for 10+ years and I thought I knew how image layers work. Then I asked one innocent question: if layers are just tar archives stacked on top of each other, how can a layer DELETE a file from a previous one? ๐Ÿงต loige.co/hidden-desig...

loige.coThe hidden design compromises of Docker layersHow Docker and OCI image layers represent filesystem changes, why deleting a file needs special whiteout entries, and what happens if you create a file called .wh.foo.
View full thread

Which raises the obvious question: what if my file is literally called .wh.foo? Linux is fine with it. OCI layers can't represent it. So of course I tried it with BuildKit... ๐Ÿงช It builds. It runs. It works on my machine. Then you push it, and foo disappears everywhere else ๐Ÿ™ƒ

In the article: โ€ข how layers work as tar-based changesets โ€ข why deletes never shrink your image โ€ข whiteouts & opaque dirs โ€ข 4 experiments that break a Dockerfile โ€ข the design compromises behind it all (spoiler: AUFS) Hack or elegant pragmatism? Tell me what you think! ๐Ÿ‘‡

I've used #Docker for 10+ years and I thought I knew how image layers work. Then I asked one innocent question: if layers are just tar archives stacked on top of each other, how can a layer DELETE a file from a previous one? ๐Ÿงต loige.co/hidden-desig...

loige.coThe hidden design compromises of Docker layersHow Docker and OCI image layers represent filesystem changes, why deleting a file needs special whiteout entries, and what happens if you create a file called .wh.foo.

Tar can say "here's a file". It can say "here's a new version of that file". But it has no way to say "remove this file from the archive below me". So the OCI image spec has a trick: to delete foo, a later layer ships an entry called .wh.foo ๐Ÿซฅ

That's a "whiteout". As far as tar is concerned, it's just a weirdly named regular file. It's the OCI unpacker that sees the name and says: "ah, you actually want foo gone". There's even a stranger one: .wh..wh..opq, which hides everything a directory inherited from earlier layers.

View full thread

The pattern that ties it all together: one config module, validated at startup, fail fast. The rest of the code never touches process.env directly. Full guide (validation with Zod, security, NODE_DEBUG and friends): nodejsdesignpatterns.com/blog/nodejs-...

nodejsdesignpatterns.comEnvironment Variables in Node.jsLearn how to use environment variables in Node.js with process.env, the native --env-file flag, validation, and security best practices.
View full thread

Now the uncomfortable part: env vars are a mediocre home for secrets. - child processes inherit them by default - they show up in docker inspect - readable from /proc/PID/environ - crash reporters love to capture the whole environment Prefer a secrets manager in production.

View full thread
View full thread
View full thread

Luciano Mammino ๐Ÿ“™ Node.js Design Patterns reposted

๐ŸŽ‰ Big news: Node.js is changing its release schedule for the first time in 10 years. From October 2026, less to remember and easier to know what's Current or LTS. Here's everything you need to know ๐Ÿงต๐Ÿ‘‡

View full thread

Luciano Mammino ๐Ÿ“™ Node.js Design Patterns reposted

Replying to @loige.co

The article shows the new API side-by-side with the old one for every feature, plus a companion GitHub repo with every snippet ready to clone and run. I hope you'll like it ๐Ÿ™‚ nodejsdesignpatterns.com/blog/whats-n...

nodejsdesignpatterns.comWhat's new in Node.js 26Node.js 26 ships the Temporal API by default, Map upsert helpers, Iterator.concat, V8 14.6 and Undici 8. A code-heavy tour with practical examples.

Luciano Mammino ๐Ÿ“™ Node.js Design Patterns reposted

Node.js 26 shipped this week ๐ŸŽ‰ My birthday is close, so I'm officially calling it an early birthday present from the Node.js team. ๐Ÿ˜‚ This release doesn't look flashy at first glance, but the additions are genuinely useful in everyday code. I wrote a code-heavy tour, here's what stood out ๐Ÿงต

Node.js 26 shipped this week ๐ŸŽ‰ My birthday is close, so I'm officially calling it an early birthday present from the Node.js team. ๐Ÿ˜‚ This release doesn't look flashy at first glance, but the additions are genuinely useful in everyday code. I wrote a code-heavy tour, here's what stood out ๐Ÿงต

View full thread

Node.js 26 shipped this week ๐ŸŽ‰ My birthday is close, so I'm officially calling it an early birthday present from the Node.js team. ๐Ÿ˜‚ This release doesn't look flashy at first glance, but the additions are genuinely useful in everyday code. I wrote a code-heavy tour, here's what stood out ๐Ÿงต

View full thread

Iterator.concat() composes lazy iterables into a single iterable without ever materializing intermediate arrays. One catch though: it's sync-only. For async iterables you'll need a small concatAsync helper, and the article includes a one-liner you can paste in.

Node.js 26 shipped this week ๐ŸŽ‰ My birthday is close, so I'm officially calling it an early birthday present from the Node.js team. ๐Ÿ˜‚ This release doesn't look flashy at first glance, but the additions are genuinely useful in everyday code. I wrote a code-heavy tour, here's what stood out ๐Ÿงต

Temporal is finally stable and enabled by default. You can drop Moment.js / Luxon / date-fns. The global Temporal handles dates, time zones, and DST math correctly out of the box. If you've ever shipped a "remind me in one day" feature that drifted by an hour twice a year, this is for you.

Luciano Mammino ๐Ÿ“™ Node.js Design Patterns reposted

@rustaceans.bsky.social hey John & Elley, big fan of your newsletter here! I hope you'll consider my last article loige.co/writing-midd... for your next issue :) It's a pretty long one but hopefully it covers Tower in a way that can be useful even to folks who don't target AWS Lambdas (yet).

loige.coWriting middlewares for Rust Lambda functionsHow to write reusable middleware for Rust Lambda functions using tower, the generic middleware engine that already underpins the AWS Lambda Rust runtime. Includes a complete DynamoDB-backed IP rate li...