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...
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...