Skip to main content

Posts

Build Once, Promote the Digest: Shipping Lambda Container Images Across Environments

When a change passes in staging and ships to production, what exactly was shipped? If each environment runs its own build, the honest answer is "the same commit, built again", and that is not the same artifact. For a container-image Lambda function, the unit you test and promote should be one image digest, with a tag acting only as a label for it. An earlier post, Why CI/CD Still Fails When the Pipeline Turns Green , covers manual steps and rollbacks in general. This guide covers the artifact itself: how to make sure production runs the bytes that staging tested. A rebuild per environment ships a different artifact with the same name A second build can differ from the first in ways the commit hash does not show. A base image tag may have moved, a package restore may resolve differently, or a build tool may have been updated. AWS documents this for Lambda base images: their tags are mutable and move to each newly patched image, while a digest never changes and therefore gi...
Recent posts

SQL Server Row-Level Security for Multi-Tenant Apps: Predicates, SESSION_CONTEXT and What Still Leaks

Choosing between shared tables, a schema per tenant and a database per tenant is covered in Designing Tenant Isolation Before the Data Model Becomes Expensive to Change . This guide picks up after that decision, for the case where tenants share tables on SQL Server or Azure SQL and row-level security (RLS) is the second layer behind the application's own filtering. The main question is what RLS actually guarantees: it removes the forgotten WHERE TenantId = @id , but it does not remove noisy neighbors, per-tenant restore problems or every kind of leak. Two predicate types, four write operations RLS uses an inline table-valued function as a predicate, enforced by a security policy. The two predicate types behave differently: Predicate Applies to Behavior Filter SELECT, UPDATE, DELETE Silently removes rows. The application never learns they exist Block AFTER INSERT, AFTER UPDATE, BEFORE UPDATE, BEFORE DELETE Fails the operation with an error You need both kinds for t...

Scheduled Jobs That Overlap Their Own Retries: Retry Age, Occurrence Keys and Claims with Leases

If a nightly job's target is down at its scheduled time, when does EventBridge Scheduler stop trying, and what happens to the invocation afterward? Many teams never answer this, because the defaults seem to answer it for them. They do not answer it well: Scheduler's defaults were written for a generic target, not for the period of your job. The basics of context attributes, IAM roles and dead-letter queues are covered in EventBridge Scheduler Pitfalls: Context Attributes, Retries and Dead-Letter Design . This guide goes deeper on two decisions that post only touches: how long to retry, and how to make a retried occurrence safe. The default retry window is longer than many job periods By default, Scheduler keeps trying to deliver an event for 24 hours and up to 185 attempts, with exponential backoff between attempts. If you configure no dead-letter queue (DLQ), the event is dropped once the attempts run out. Delivery is at-least-once. Together these defaults have three conse...

REST API Pagination: Design the Continuation Link Before You Choose Offset or Keyset

When a list endpoint starts returning too many rows, the first question is usually "offset or keyset?" That question comes second. The first is: can the pagination strategy change later without breaking a single client? If the answer is no, the SQL is the smaller decision, because the response shape has already locked you in. This guide is a decision analysis for C#, SQL Server and REST APIs, built on documentation from Microsoft. No benchmarks are claimed. Paging is a contract change before it is a query change Microsoft's API guidance recommends supporting paging whenever a collection could grow large, and Azure's own API tooling notes that designing pagination up front avoids a later breaking change when continuation links have to be added. That matches how clients behave. A client handed a bare array has no way to know a second page exists, so it silently processes a truncated list. Three criteria, in order: Can the client discover that more data exists? ...

Can S3 Be a System of Record? Durability, Consistency and Conditional Writes

Can a bucket be your system of record? The answer depends on which failure you are worried about. Eleven nines of durability answers "will the bytes survive hardware loss?" It says nothing about two writers racing on one key, or a job that overwrites last night's good file with tonight's bad one. This guide separates those failures and maps each to an S3 control, based on AWS documentation. Four questions decide it, and durability answers only one Before choosing S3 over a database, ask: Will stored bytes survive infrastructure failure? The durability question. Will a reader see the latest write? The consistency question. When two writers collide, who wins, and does the loser find out? The concurrency question. Can a person or a buggy job destroy good data, and can it be recovered? The retention question. S3 answers the first two by default. The last two are answered only if you configure or code for them. That gap is why "S3 is a database" is...

Lambda Container Images and Architecture Mismatches: Build for One Platform, Verify Before Deploy

If a Lambda function can be cheaper by changing one field, why does the change sometimes fail at deploy time or on the first invoke? For container-image functions, the field is not the hard part. The architecture is now a property of two separate things, the function configuration and the image, and the pipeline has to keep them in agreement. Whether arm64 is worth it for a given function, including the price difference and the compatibility checklist, is covered in AWS Lambda ARM64 Container Images: Should You Build for Graviton or x86_64? . This guide covers the part after that decision: making sure what you build is what you deploy. A container function has two architecture declarations Where What it declares Default when unspecified Function configuration The Architectures setting: exactly one value x86_64 The image The platform it was built for, decided by the build host, base image and build flags Whatever machine ran the build The Lambda documentation says the ...

Lambda in a VPC: What the NAT Gateway Really Costs and How to Avoid It

What does a Lambda function pay for the privilege of being inside a VPC? Nothing at first. The cost arrives when the function needs to reach something outside the VPC, which usually means a NAT gateway, and a NAT gateway carries two separate meters. This guide is a decision analysis built on AWS documentation and pricing pages, with the questions in order: does the function need VPC access at all, what does it call once it is attached, and does each of those calls need a public path or a private one? Start by asking whether the function needs the VPC By default, a Lambda function runs in a Lambda-managed VPC that has internet access. Attaching a function to your own VPC restricts it to that VPC's resources unless you arrange outbound access yourself. The usual reason to attach is a private resource, such as a database or an internal API. If a function only calls public AWS APIs and a few third-party endpoints, attaching it creates a networking problem it did not have before. T...