PTEN

Blog

Serverless, AWS architecture and AI agents: what I'd pick, why, and what it costs. My topics usually come from a technical problem I had to solve or something I had to explain. Serverless and event-driven in depth, architecture patterns in general, and AI agents running on serverless.

Filter by series or tag
Series
Tag

12 posts

  1. Terraform

    AWS OIDC for GitHub Actions: assume IAM roles without access keys, with Terraform

    AWS OIDC for GitHub Actions: your CI proves who it is with a signed token and assumes a temporary IAM role. No access keys, Terraform included.

  2. serverless

    Serverless Isn't Failure-Proof: 7 Resilience Patterns with Code

    Serverless resilience patterns on AWS with TypeScript code: retry with jitter, idempotency, timeouts, Circuit Breaker, DLQ and graceful degradation.

  3. DynamoDB

    DynamoDB filtered export: export one tenant without paying for the whole table

    DynamoDB filtered export to S3 in a multi-tenant SaaS: only a key condition on the partition key cuts the cost. Math, TypeScript code and limits.

  4. event-drivenPT · EN

    New EventBridge Custom Event Bus vs SQS FIFO: when to switch

    Rule of thumb: For a cross-team backbone, in a supported Region, with fast idempotent consumers and per-entity ordering within one publisher: new bus with per-account subscribers, no SQS FIFO in the middle.

    Context and trade-off

    Cross-team integration on EventBridge Classic, an SQS FIFO queue behind every consumer, an archive for replay and a resource policy that grows with every new account.

    What you gain

    Cross-account sharing through AWS RAM (Resource Access Manager), native retention and replay, and FIFO by EventGroupId, with fewer parts between teams.

    What you pay

    A 30 s ceiling on REQUEST_RESPONSE, head-of-line blocking during retries, ordering only within the publishing account, and no sa-east-1 yet.

  5. architecturePT · EN

    Invisible Coupling: When Your Microservices Become a Distributed Monolith

    Rule of thumb: Synchronous only where an answer is needed right now. Everything else becomes an async event, with a durable layer in between.

    Context and trade-off

    Microservices with their own deploys and green dashboards go down together when one service at the end of a synchronous chain chokes.

    What you gain

    One slow service becomes a growing queue, not a checkout timeout.

    What you pay

    Designing boundaries and the hot path, and running the resilience patterns (Circuit Breaker, Bulkhead, Outbox), each with its own cost.

  6. lambdaPT · EN

    Lambda Web Functions: when to switch from Event Functions, and what to do with no South America region

    Rule of thumb: Web Functions for I/O-bound APIs and SSR, with data in us-east-1 and CloudFront + OAC in front. A database pinned to sa-east-1 stays on Event Functions.

    Context and trade-off

    Web Functions runs your Node.js HTTP server directly on Lambda, billing for active CPU, but launched with no South America region.

    What you gain

    Up to 128 requests per environment, no adapter, paying for active CPU instead of time spent waiting on the database.

    What you pay

    Requests cost 50% more, fixed 2 GB, Node.js 24 on Arm64 only, and zero request state in global variables.

    Would change if: sa-east-1 joins the region list.

  7. lambdaPT · EN

    Lambda MicroVMs: shell access, lifecycle hooks and the best practices that matter

    Rule of thumb: Shell only on MicroVMs launched with SHELL_INGRESS. Randomness and init in /run, connection revalidation in /resume.

    Context and trade-off

    A MicroVM takes a shell and boots from a snapshot, so anything that must be unique can't be created at build time.

    What you gain

    Debugging from inside the MicroVM, and instances that aren't born with the same secret.

    What you pay

    Four hooks to implement and test, short-lived tokens with refresh, and separate build and execution roles.

  8. streamingPT · EN

    Is Amazon Data Firehose serverless? Kinesis vs Firehose, Flink and MSK on AWS

    Rule of thumb: Kinesis when there's no commitment to Kafka; MSK when the team already lives on Kafka.

    Context and trade-off

    Four streaming services on AWS, and “which one is best” is the wrong question: the choice comes down to context and ecosystem.

    What you gain

    Kinesis is simpler and native, and fits better with Lambda and the rest of serverless.

    What you pay

    Ordering is per shard, not global, and at-least-once delivery needs an idempotent consumer.

  9. resiliencePT · EN

    Is multi-cloud more resilient? The math says no

    Rule of thumb: Multi-AZ and multi-region on the same cloud first. Multi-cloud only for a business reason, and then active-passive, documented in an ADR.

    Context and trade-off

    After every big cloud outage, the pitch comes back: “Let's go multi-cloud, so if AWS goes down we stay up on Google.”

    What you gain

    Native managed services, the same IAM and the same tooling, for a fraction of the complexity.

    What you pay

    You stay exposed to the very rare event of the whole provider going dark.

    Would change if: Regulation, a contract or data sovereignty requires a second cloud.

  10. lambdaPT · EN

    AWS Lambda MicroVMs: run untrusted code with VM-level isolation (no infra to manage)

    Rule of thumb: Lambda Functions for the event-driven backbone; MicroVMs only for the steps that run untrusted code.

    Context and trade-off

    Container, VM or Lambda Function: none of them gave VM isolation, fast launch and per-session state at the same time.

    What you gain

    VM isolation with near-instant launch and state kept for up to 8 hours per session.

    What you pay

    No sa-east-1 yet, ARM64 only, capped at 16 vCPU and 32 GB.

  11. resiliencePT · EN

    High Availability Has a Price: Resilience Is a Decision, Not a Stack

    Rule of thumb: Choose between HA, multi-region and on-premise by the cost of each nine and by RTO/RPO, and record the accepted risk in an ADR.

    Context and trade-off

    Resilience is a business decision before it's a technical one, and the context behind each choice gets lost if nobody writes it down.

    What you gain

    The risk is mapped, owned and justified. Failure doesn't catch the team by surprise.

    What you pay

    Not everything gets HA: batch jobs, internal systems and dashboards can tolerate minutes or hours down.

  12. changed Aug 2026AI agentsPT · EN

    AWS MCP Server: self-host or managed, OAuth or SigV4, and how to set it up

    Rule of thumb: One server only, the managed AWS MCP Server. Knowledge is for those who just want to query docs, without an AWS account.

    Context and trade-off

    When the post came out, the answer was “it depends on the pain”. Three weeks later, the official setup guide started recommending a single server: duplicated tools confuse the agent.

    What you gain

    Less config, fewer conflicts, the same IAM leash.

    What you pay

    An agent that operates the account: start in a sandbox, with scoped IAM and a human in the loop for irreversible actions.

New posts, straight to your inbox

One serverless, architecture or AI agents topic on AWS per issue: what I'd pick, why, and what it costs. No spam.

Opens the subscription page in a new tab.