<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shantanu Gonade on Medium]]></title>
        <description><![CDATA[Stories by Shantanu Gonade on Medium]]></description>
        <link>https://medium.com/@shantanu568?source=rss-46cf39bc224------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*AEp2zuFsHYsG8HL0GObE5g.png</url>
            <title>Stories by Shantanu Gonade on Medium</title>
            <link>https://medium.com/@shantanu568?source=rss-46cf39bc224------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 04:50:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shantanu568/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building a FIFO Waitlist on DynamoDB Alone — No Queue Service Required]]></title>
            <link>https://towardsaws.com/building-a-fifo-waitlist-on-dynamodb-alone-no-queue-service-required-ec093e45cb58?source=rss-46cf39bc224------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec093e45cb58</guid>
            <category><![CDATA[dynamodb]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[event-driven-architecture]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Shantanu Gonade]]></dc:creator>
            <pubDate>Tue, 22 Sep 2026 07:32:05 GMT</pubDate>
            <atom:updated>2026-09-22T07:32:05.834Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*KYKRb2kaKHTWMF4oVJ3q4A.gif" /></figure><p><em>A system-design walkthrough of a waitlist that lives entirely inside a single-table DynamoDB design: positional ordering, O(1) “what’s my number” lookups, automatic promotion — and the one place its own position-allocation logic quietly repeats a mistake we covered earlier in this series.</em></p><p>Git Repo: <a href="https://github.com/shantanu-gonade/terrapin-events">https://github.com/shantanu-gonade/terrapin-events</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*BkhjFFjBaGYRctcHFa9pBQ.gif" /></figure><p>Waitlists are one of those features that look trivial in a wireframe and turn into a small distributed-systems problem the moment you think about it for more than five minutes. “If the event is full, add the user to a list. When a spot opens up, give it to whoever’s been waiting longest.” Fine. Now: how does a user check their position? What happens when three people cancel at once? What if two people join the waitlist in the same millisecond — who’s #6 and who’s #7? What happens if the person at the front of the line doesn’t respond to “you’re in, but only for the next 24 hours”?</p><p>The “obvious” architecture for a FIFO queue is, well, a queue — SQS FIFO, or a Step Functions state machine with a wait state, or a dedicated ordering service. TEMS doesn’t use any of those for its waitlist. Everything — the queue, the positions, the promotion logic, the 24-hour acceptance window — lives in the same single DynamoDB table that holds events, users, and registrations. No additional AWS service. This article is a walkthrough of how that’s built, where it holds up, and where the design’s own assumptions start to creak.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ERgUoY9-B20jpy4fTo2Y1A.png" /></figure><h3>The data model: positions as sort keys</h3><p>The core trick is that DynamoDB sort keys are stored and queried in lexicographic order, and a FIFO queue is, structurally, just “things in order.” If you encode a waitlist position as a zero-padded string and use it as part of the sort key, Query with ScanIndexForward: true gives you the front of the line, and ScanIndexForward: false gives you the back — for free, with no additional indexing.</p><p>TEMS’s waitlist items look like this:</p><pre>{<br>  PK: `EVENT#${eventId}`,<br>  SK: `WAITLIST#${String(position).padStart(5, &#39;0&#39;)}`,  // e.g. WAITLIST#00006<br>  GSI1PK: `USER#${userId}`,<br>  GSI1SK: `WAITLIST#${eventId}#${String(position).padStart(5, &#39;0&#39;)}`,<br>  registrationId,<br>  userId,<br>  position,<br>  joinedAt: &#39;2026-02-14T18:32:00.000Z&#39;,<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZW8qTH1Hh2iKpTCzyrtOxw.png" /></figure><p>Two access patterns fall out of this for free:</p><ul><li><strong>“Who’s next in line for event X?”</strong> → Query on PK = EVENT#{eventId}, SK begins_with WAITLIST#, ScanIndexForward: true, Limit: 1. The lowest-numbered WAITLIST# item is the front of the queue.</li><li><strong>“What’s my position for event X?”</strong> → Query on GSI1PK = USER#{userId}, GSI1SK begins_with WAITLIST#{eventId}#. One item, one read, no scan.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KlL5iCSpUsKo50eRA0jqCA.png" /></figure><p>The zero-padding (00006 vs 6) is what makes the lexicographic sort match numeric order — without it, “10” would sort before “2” as a string, and your queue would be FIFO in name only. It’s a small detail, and it’s the kind of small detail that, if you get it wrong, doesn’t throw an error — it just quietly produces a queue that’s <em>almost</em> in order, which is far worse than one that’s visibly broken.</p><h3>Joining the queue — and a familiar shape of bug</h3><p>Here’s the function that adds someone to the waitlist, simplified from backend/services/registrations/business-logic/waitlist-manager.ts:</p><pre>async function addToWaitlist(eventId: string, userId: string, registrationId: string) {<br>  const position = await getNextWaitlistPosition(eventId);<br><br>  await docClient.send(new PutCommand({<br>    TableName: TABLE_NAME,<br>    Item: {<br>      PK: `EVENT#${eventId}`,<br>      SK: `WAITLIST#${String(position).padStart(5, &#39;0&#39;)}`,<br>      GSI1PK: `USER#${userId}`,<br>      GSI1SK: `WAITLIST#${eventId}#${String(position).padStart(5, &#39;0&#39;)}`,<br>      registrationId,<br>      userId,<br>      position,<br>      joinedAt: new Date().toISOString(),<br>    },<br>    // note: no ConditionExpression — same pattern we saw in Article 2<br>  }));<br><br>  await docClient.send(new UpdateCommand({<br>    TableName: TABLE_NAME,<br>    Key: { PK: `USER#${userId}`, SK: `REGISTRATION#${registrationId}` },<br>    UpdateExpression: &#39;SET #status = :status, waitlistPosition = :position&#39;,<br>    ExpressionAttributeNames: { &#39;#status&#39;: &#39;status&#39; },<br>    ExpressionAttributeValues: { &#39;:status&#39;: &#39;WAITLISTED&#39;, &#39;:position&#39;: position },<br>  }));<br><br>  await atomicIncrementWaitlist(eventId, 1);<br>}</pre><p>And here’s getNextWaitlistPosition, from backend/services/registrations/business-logic/capacity-check.ts:</p><pre>async function getNextWaitlistPosition(eventId: string): Promise&lt;number&gt; {<br>  const result = await docClient.send(new QueryCommand({<br>    TableName: TABLE_NAME,<br>    KeyConditionExpression: &#39;PK = :pk AND begins_with(SK, :prefix)&#39;,<br>    ExpressionAttributeValues: { &#39;:pk&#39;: `EVENT#${eventId}`, &#39;:prefix&#39;: &#39;WAITLIST#&#39; },<br>    ScanIndexForward: false, // descending — highest position first<br>    Limit: 1,<br>  }));<br><br>  if (!result.Items?.length) return 1;<br>  return (result.Items[0].position as number) + 1;<br>}</pre><p>If the second article in this series gave you déjà vu reading that, good — it should. getNextWaitlistPosition is a <em>read</em> (find the current max position) that informs a <em>later write</em> (put an item at max+1), with no DynamoDB-level guarantee tying the two together. Run the same audit lens from Article 1 on it:</p><ol><li>Position 5 is the current end of the line. Alice and Bob both tap “Join Waitlist” for the same event within milliseconds of each other.</li><li>Alice’s request calls getNextWaitlistPosition, queries, sees max position = 5, computes 6.</li><li>Bob’s request calls getNextWaitlistPosition <em>before Alice’s write lands</em>, sees the same max position = 5, also computes 6.</li><li>Alice writes WAITLIST#00006.</li><li>Bob writes WAITLIST#00006 — same PK, same SK, no ConditionExpression. Bob’s PutCommand silently <strong>overwrites</strong> Alice’s item.</li><li>Both UpdateCommands against the <em>registration records</em> succeed (they’re different USER# partitions, so no conflict there) — both Alice’s and Bob’s registration rows now say waitlistPosition: 6.</li><li>atomicIncrementWaitlist(eventId, 1) runs twice, so waitlistCount goes from 5 to 7.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_69Cc-o3vrY54HesD_f_Vg.png" /></figure><p>The result: the table now contains <strong>one</strong> WAITLIST#00006 item (Bob’s), but <strong>two</strong> registration records claiming waitlistPosition: 6, and a waitlistCount of 7 describing a queue that, if you walk it via WAITLIST# items, has only 6 entries.</p><p>Compare this to the double-registration bug from Articles 1 and 2. There, the bug was <em>invisible</em> — two registration rows silently existed where one should, and nothing about the user experience changed until check-in day. Here, the bug is the opposite: Alice’s registration record is frozen at “you’re #6 in line,” and as the real queue moves on without her — promotions happen, reorderWaitlist shuffles positions for everyone whose WAITLIST# item still exists — her cached position number never updates, because she has no WAITLIST# item for any reorder logic to find and touch. She’ll refresh the waitlist page and see “#6” forever, while people who joined after her get promoted. That’s a support ticket waiting to happen, and a much faster one than the Article 1 bug — someone <em>will</em> notice their position number is stuck.</p><p>It’s worth pausing on the symmetry here: in both cases, the <strong>atomic counter is completely correct</strong>, and that’s exactly the problem. atomicIncrementWaitlist and atomicIncrementRegistered use DynamoDB’s ADD update expression, which really is atomic — the counter faithfully records “how many times has a join/register operation completed.” What it <em>doesn’t</em> — can’t — record is whether each of those operations corresponded to a distinct, successfully-persisted item. The counter and the table silently disagree the moment two operations collide on the same identity (here, the same position number; in Article 1, the absence of any identity constraint at all), and nothing about either operation’s “success” status would tell you that happened.</p><h3>The fix is already in the same file</h3><p>Here’s the part I like: the fix for getNextWaitlistPosition doesn’t require a new pattern. It requires using the pattern that atomicIncrementWaitlist <em>already uses</em>, one function away.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-xDUbCsD_ZXHsig1frjzow.png" /></figure><p>Instead of “query for the max, add one, hope nothing changed in between,” allocate the next position with an atomic counter:</p><pre>async function getNextWaitlistPosition(eventId: string): Promise&lt;number&gt; {<br>  const result = await docClient.send(new UpdateCommand({<br>    TableName: TABLE_NAME,<br>    Key: { PK: `EVENT#${eventId}`, SK: &#39;METADATA&#39; },<br>    UpdateExpression: &#39;ADD waitlistSequence :inc&#39;,<br>    ExpressionAttributeValues: { &#39;:inc&#39;: 1 },<br>    ReturnValues: &#39;UPDATED_NEW&#39;,<br>  }));<br><br>  return result.Attributes!.waitlistSequence as number;<br>}</pre><p>ADD on a numeric attribute is a genuinely atomic increment-and-return — two concurrent calls are guaranteed to receive <em>different</em> values, no race window, no retry loop needed. Alice gets 6, Bob gets 7, both writes land at distinct sort keys, both registration records point at real queue entries, and waitlistSequence and waitlistCount tell the same story. (One wrinkle: waitlistSequence should be a monotonically-increasing allocator, separate from waitlistCount, which decreases on promotion/removal — otherwise you’d eventually recycle position numbers that reorderWaitlist has already reassigned. A second counter attribute on the same METADATA item is cheap.)</p><p>The broader point: this codebase already <em>knows</em> how to do atomic allocation correctly — it’s right there in atomicIncrementRegistered and atomicIncrementWaitlist. The bug isn’t a knowledge gap. It’s that the same correct pattern wasn’t applied consistently to every place that needed it. That’s a much more common — and more findable — class of issue than “the developer didn’t know about conditional writes,” and it’s worth specifically grep-ing your own codebase for: find every place you’ve solved a “next sequence number” or “is this unique” problem correctly, and check whether there’s a sibling function solving the <em>same</em> problem differently, two files over.</p><h3>Promotion: walking the front of the queue</h3><p>When a registration is cancelled, an EventBridge rule routes the RegistrationCancelled event to a dedicated handler:</p><pre>// backend/services/registrations/handlers/promote-waitlist.ts<br>export async function handler(<br>  event: EventBridgeEvent&lt;&#39;RegistrationCancelled&#39;, RegistrationCancelledDetail&gt;<br>) {<br>  const { eventId } = event.detail;<br>  await promoteFromWaitlist(eventId);<br>}</pre><p>promoteFromWaitlist is where the FIFO ordering pays off — finding “whoever’s been waiting longest” is the same Query shape as getNextWaitlistPosition, just reversed:</p><pre>const next = await docClient.send(new QueryCommand({<br>  TableName: TABLE_NAME,<br>  KeyConditionExpression: &#39;PK = :pk AND begins_with(SK, :prefix)&#39;,<br>  ExpressionAttributeValues: { &#39;:pk&#39;: `EVENT#${eventId}`, &#39;:prefix&#39;: &#39;WAITLIST#&#39; },<br>  ScanIndexForward: true, // ascending - lowest position = longest wait<br>  Limit: 1,<br>}));</pre><p>If someone’s waiting, promoteFromWaitlist:</p><ol><li>Generates a QR code for the now-promoted registration.</li><li>Sets promotionDeadline = now + 24 hours.</li><li>Updates the registration record: status: PROMOTION_PENDING, attaches the QR code and deadline, removes waitlistPosition.</li><li>Deletes the WAITLIST# item for the promoted user.</li><li>Runs both atomic counters: waitlistCount — 1, registeredCount + 1.</li><li>Calls reorderWaitlist(eventId) to shift everyone behind them up by one.</li><li>Publishes a WaitlistPromoted event — which, per Article 1, the notification service needs to treat as potentially-duplicate when it sends the “you’re in!” email.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mb8pU5D4Xtt9d-aMMdQy5Q.png" /></figure><p>This is architecturally clean: the <em>decision</em> of who gets promoted is a single indexed query, not a scan, and it’s correct regardless of how many people are in the queue — Limit: 1 with the right sort order means the cost of “find the front of the line” doesn’t grow with the line’s length.</p><h3>The reorder problem</h3><p>Step 6 — reorderWaitlist — is where this design’s scaling boundary lives. After a promotion (or a voluntary removeFromWaitlist), every remaining waitlist entry’s position needs to shift down by one, so the queue stays densely numbered (1, 2, 3, … with no gaps). TEMS does this by re-querying the entire waitlist for the event and, for every item whose position needs to change, running a sequential delete-old / put-new / update-registration-record sequence:</p><pre>async function reorderWaitlist(eventId: string) {<br>  const all = await docClient.send(new QueryCommand({<br>    TableName: TABLE_NAME,<br>    KeyConditionExpression: &#39;PK = :pk AND begins_with(SK, :prefix)&#39;,<br>    ExpressionAttributeValues: { &#39;:pk&#39;: `EVENT#${eventId}`, &#39;:prefix&#39;: &#39;WAITLIST#&#39; },<br>    ScanIndexForward: true,<br>  }));<br><br>  for (let i = 0; i &lt; (all.Items?.length ?? 0); i++) {<br>    const item = all.Items![i];<br>    const newPosition = i + 1;<br>    if (item.position === newPosition) continue;<br><br>    await docClient.send(new DeleteCommand({ TableName: TABLE_NAME, Key: { PK: item.PK, SK: item.SK } }));<br>    await docClient.send(new PutCommand({<br>      TableName: TABLE_NAME,<br>      Item: { ...item, SK: `WAITLIST#${pad(newPosition)}`, GSI1SK: `WAITLIST#${eventId}#${pad(newPosition)}`, position: newPosition },<br>    }));<br>    await docClient.send(new UpdateCommand({<br>      TableName: TABLE_NAME,<br>      Key: { PK: `USER#${item.userId}`, SK: `REGISTRATION#${item.registrationId}` },<br>      UpdateExpression: &#39;SET waitlistPosition = :p&#39;,<br>      ExpressionAttributeValues: { &#39;:p&#39;: newPosition },<br>    }));<br>  }<br>}</pre><p>For a campus event with a waitlist of, say, 15 people, a promotion triggers up to 14 sequential delete+put+update sequences — call it ~42 DynamoDB operations, each a few milliseconds. Comfortably inside a single Lambda invocation, comfortably inside any reasonable timeout, and the user-facing effect (everyone’s position number ticks down by one) is correct and immediate.</p><p>Now imagine this is a concert. Ten thousand people are on the waitlist. One person cancels. reorderWaitlist re-queries all ten thousand WAITLIST# items, then performs up to 9,999 sequential delete+put+update sequences — roughly 30,000 operations, one promotion. At DynamoDB’s per-request latencies, that’s not a “few milliseconds” operation anymore; it’s a Lambda that either times out or burns a very large amount of read/write capacity for a single cancellation, and it gets <em>worse</em> the more popular the event is — exactly when you need it to hold up best.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*24UZtHeQGy8VKesdpBNyGg.png" /></figure><p>This is the honest tradeoff of positional, densely-numbered queues: <strong>O(1) reads (“what’s my position,” “who’s next”) in exchange for O(n) writes on every change to the front of the queue.</strong> It’s an excellent trade when n is bounded by “how many students would realistically wait for one campus event” (tens to low hundreds) and a poor one when n is “how many people want concert tickets.” If you’re building this pattern and you’re not sure which world you’re in, that’s the question to answer first — not “DynamoDB vs. SQS” in the abstract, but “what’s the realistic maximum waitlist depth for one item, and can I afford O(n) writes at that depth, on every promotion?”</p><p>If the answer is no, the usual escape hatches are: stop maintaining dense positions at all (give users a relative “~340 people ahead of you” estimate computed lazily, rather than an exact, always-correct integer); use a sparse numbering scheme (allocate positions with gaps — multiples of 1000 — so most insertions/removals don’t require renumbering neighbors, at the cost of needing an occasional full renumber); or move the queue itself to a service designed for high-throughput ordered processing (SQS FIFO, or a Kinesis stream) and treat “position” as an eventually-consistent projection rather than a live, transactionally-updated field.</p><h3>The 24-hour clock: what reclaims a slot?</h3><p>Once promoted, a user has 24 hours to accept before their promotionDeadline passes. acceptPromotion (in backend/services/registrations/handlers/acceptPromotion.ts) checks that deadline:</p><pre>if (new Date(registration.promotionDeadline) &lt; new Date()) {<br>  throw new Error(&#39;PROMOTION_EXPIRED&#39;);<br>}<br>// ... set status: REGISTERED, remove promotionDeadline, publish PromotionAccepted</pre><p>This correctly stops a <em>stale accept</em> from succeeding — someone can’t sit on a “you’re in!” email for a week and then claim the spot after the event organizer has moved on. But there’s a second question this code doesn’t answer, because it’s not the kind of question a validation check <em>can</em> answer: <strong>if the deadline passes and the user never calls acceptPromotion at all, what reclaims that slot for the next person in line?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZiaHtB4_Di4tOEOvPLu8YQ.png" /></figure><p>This is worth sitting with, because it’s a genuinely common shape of gap in time-boxed-offer systems, and it’s invisible in exactly the way the Article 1 bug was invisible: every happy-path test passes. The demo works — you promote someone, they accept within the hour, done. Nothing about a passing test suite or a working demo exercises “and then nobody does anything for 24 hours.” The only way this gap shows up is in production, in week three of the semester, when someone gets promoted off a waitlist for Friday’s event, doesn’t check their email until Saturday, and — if nothing is watching for expired PROMOTION_PENDING registrations — their slot simply… stays assigned to them. Not reclaimed. Not re-offered to whoever was behind them. The event shows as “full” with one seat that will never be filled.</p><p>The fix, if it’s needed, is a scheduled sweep — an EventBridge Scheduler rule (or a rate()-based EventBridge rule, the older mechanism) running every few minutes, querying for PROMOTION_PENDING registrations whose promotionDeadline has passed, transitioning each to a terminal EXPIRED (or equivalent) status, decrementing registeredCount, and re-running promoteFromWaitlist for the freed slot — handing the offer to the <em>next</em> person in line, with their own fresh 24-hour clock. Architecturally it’s a small Lambda on a schedule; the work is almost entirely “remember that this needs to exist,” which is precisely the kind of thing a structured audit — asking “what component is responsible for X” for every X that <em>should</em> have one — is good at surfacing, whether or not it ever finds a gap.</p><h3>Decision framework: when does this design make sense?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ZfeuJWEXtl6HenKgbKolw.png" /></figure><p>TEMS sits comfortably in the first column: campus events have bounded, predictable waitlist depths, and “what’s my position” is a real UX feature students look at. The design is appropriate <em>for this problem</em> — which is a more useful conclusion than either “DynamoDB-only queues are an anti-pattern” or “DynamoDB-only queues are great,” neither of which is true in general. The two things worth fixing — getNextWaitlistPosition’s race condition, and confirming a sweep exists for expired promotions — are both small, targeted changes that preserve the overall design rather than replace it.</p><p><em>This is the final piece in a series on what a structured AI architecture audit found in a “production-ready” serverless event platform. </em><a href="https://medium.com/towards-aws/i-asked-an-ai-to-audit-my-production-ready-serverless-app-it-found-a-myth-and-a-race-condition-27ab4c16a359"><em>The first article</em></a><em> covers an EventBridge deduplication myth and the double-registration bug it helped hide; </em><a href="https://medium.com/towards-aws/stop-relying-on-eventbridge-to-dedupe-your-events-a-practical-guide-to-idempotent-dynamodb-writes-7fe1dfb1b777"><em>the second</em></a><em> walks through three ways to fix that bug with idempotent DynamoDB writes.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec093e45cb58" width="1" height="1" alt=""><hr><p><a href="https://towardsaws.com/building-a-fifo-waitlist-on-dynamodb-alone-no-queue-service-required-ec093e45cb58">Building a FIFO Waitlist on DynamoDB Alone — No Queue Service Required</a> was originally published in <a href="https://towardsaws.com/">Towards AWS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Relying on EventBridge to Dedupe Your Events: A Practical Guide to Idempotent DynamoDB Writes]]></title>
            <link>https://towardsaws.com/stop-relying-on-eventbridge-to-dedupe-your-events-a-practical-guide-to-idempotent-dynamodb-writes-7fe1dfb1b777?source=rss-46cf39bc224------2</link>
            <guid isPermaLink="false">https://medium.com/p/7fe1dfb1b777</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[event-driven-architecture]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[Shantanu Gonade]]></dc:creator>
            <pubDate>Thu, 18 Jun 2026 05:51:10 GMT</pubDate>
            <atom:updated>2026-06-18T05:51:10.359Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Three ways to make a DynamoDB write safe to retry — from a five-line conditional expression to a full request-caching utility — using a real double-registration bug as the running example.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c_OiAGXiqDGiERsfDSJ-3A.png" /><figcaption>Stop Relying on EventBridge to Dedupe Your Events — a practical guide to idempotent DynamoDB writes</figcaption></figure><p>If you’ve worked with serverless architectures for more than about a week, you’ve internalized “at-least-once delivery” as a phrase. API Gateway retries. SQS retries. EventBridge retries. Step Functions retries. Your own frontend retries, because the user tapped a button twice on bad wifi. Retries are not an edge case in distributed systems — they’re the <em>normal</em> case, and the question is never “will this handler run more than once for the same logical request,” but “what happens when it does.”</p><p>This article is a practical, code-first walkthrough of three ways to answer that question for DynamoDB writes, using a real bug from a production-deployed serverless app (<a href="https://github.com/shantanu-gonade/terrapin-events.git">TEMS</a>, a university event management platform) as the running example: a registration endpoint that could create two registration records for the same student and the same event, because nothing in the data model enforced that it couldn’t.</p><p>We’ll cover:</p><ol><li>The anti-pattern (what TEMS had, and why it looked fine)</li><li><strong>Technique 1</strong> — deterministic claim keys + conditional writes</li><li><strong>Technique 2</strong> — TransactWriteItems for multi-item atomicity</li><li><strong>Technique 3</strong> — AWS Lambda Powertools’ Idempotency utility</li><li>How to actually test for the race condition</li><li>A decision framework for picking between the three</li><li>Common pitfalls</li></ol><blockquote>All code is TypeScript, using <strong>@aws-sdk/client-dynamodb v3 </strong>and <strong>@aws-sdk/lib-dynamodb.</strong></blockquote><h3>The anti-pattern</h3><p>Here’s the shape of the original handler (simplified from <a href="https://github.com/shantanu-gonade/terrapin-events/blob/main/backend/services/registrations/handlers/register.ts">backend/services/registrations/handlers/register.ts</a>):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f5385c93d01d50e42b395e3577127b22/href">https://medium.com/media/f5385c93d01d50e42b395e3577127b22/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BlWHIN2QwTW-MGRectfuMA.png" /><figcaption><strong>The read-then-write anti-pattern:</strong> two concurrent Lambda invocations both clear the “already registered?” check before either write lands, producing two valid registration records.</figcaption></figure><p>If you’ve reviewed a few hundred Lambda handlers, this one doesn’t ring alarm bells on a skim. There’s an idempotency check. There’s a duplicate-registration check. There’s even a generated ID that <em>looks</em> like it could be a stable identifier.</p><p>The problem is that every one of those checks is a <strong>read followed, at some later point, by a write</strong> — with no mechanism preventing a second concurrent execution from performing the exact same reads (and getting the exact same “all clear”) before the first execution’s writes land. Two requests arriving close together both pass step 3, both generate a different registrationId in step 4, and both write successfully in step 4 — because nothing about steps 4 says “but only if no other item with this (eventId, userId) pair already exists.” There’s no such item to check, because the IDs are different.</p><p>The fix isn’t “add more checks.” It’s: <strong>make the write itself reject duplicates, so timing stops mattering.</strong></p><h3>Technique 1: Deterministic claim keys + conditional writes</h3><p>The core idea: instead of generating a random ID and hoping nobody else generates a colliding one, derive a DynamoDB key <em>deterministically</em> from the thing that must be unique — here, the (eventId, userId) pair — and let DynamoDB’s ConditionExpression do the uniqueness enforcement.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e2f24dcb5027ee82def53e25ebe2c82f/href">https://medium.com/media/e2f24dcb5027ee82def53e25ebe2c82f/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HWLM3_VXVKljCGXjNUSU0A.gif" /><figcaption><strong>Technique 1:</strong> deterministic claim key: EVENT#{eventId} / REGCLAIM#{userId} is the race surface. Exactly one PutCommand wins the attribute_not_exists check; all others get ConditionalCheckFailedException.</figcaption></figure><p>Now the handler becomes:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3de3ca3d1d4002ac528bcd022c66b047/href">https://medium.com/media/3de3ca3d1d4002ac528bcd022c66b047/href</a></iframe><p>Two concurrent requests for the same (eventId, userId) now race on a <em>single conditional PutCommand</em> — and DynamoDB guarantees exactly one of them wins. The loser doesn’t retry the whole flow blindly; it looks up what the winner created and returns that. The result is idempotent regardless of how many times the request is retried, by whom, or how close together.</p><p>This is cheap (one extra item, one extra write), fast (no transactions needed for <em>this</em> part), and — importantly — <strong>the claim item itself is useful data</strong>. EVENT#{eventId} / REGCLAIM#{userId} is exactly the kind of item you’d want for an efficient “is this user registered for this event” check (a GetItem by exact key, versus the Query + FilterExpression the original isUserRegistered used).</p><h3>Technique 2: TransactWriteItems for multi-item atomicity</h3><p>Technique 1 solves “can two registrations be created for the same pair” — but the TEMS handler writes to <em>multiple</em> items per registration: the USER#…/REGISTRATION#… record, the EVENT#…/REGISTRATION#… record (a denormalized copy for event-centric queries), the atomic counter increment, and optionally the idempotency record. If the Lambda crashes between any of these writes — and Lambda <em>can</em> be terminated mid-execution, that’s just reality — you can end up with a claim recorded but no registration, or a registration but no counter increment.</p><p>TransactWriteItems lets you bundle up to 100 write operations (Put / Update / Delete / ConditionCheck) into a single all-or-nothing operation: either every item succeeds, or none do.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b10f76895e219df93360ff40ddeff79f/href">https://medium.com/media/b10f76895e219df93360ff40ddeff79f/href</a></iframe><p>If the conditional check on the claim item fails, the <em>entire transaction</em> fails with a TransactionCanceledException — none of the other four writes happen. No partial state, ever. Catch that exception, look up the existing registration (via the claim item, which still tells you the registrationId of whoever won), and return it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lEh9gz_20iVaSUuK90vy2A.png" /><figcaption><strong>Technique 2:</strong> TransactWriteItems: all five writes (claim, two registration records, counter increment, idempotency record) commit atomically. The claim&#39;s conditional check gates the entire transaction.</figcaption></figure><p>One important caveat: TransactWriteItems is more expensive than individual writes — each item in the transaction consumes capacity as if written individually, <em>plus</em> there’s overhead for the transaction coordination itself (roughly double the write capacity units of an equivalent non-transactional write). For a registration flow, that’s a trivial cost relative to the correctness you’re buying. For a high-throughput hot path writing thousands of times per second, it’s worth benchmarking — but “I’m worried about the cost of a transaction” is rarely the right reason to ship a data-integrity bug.</p><p>The RegistrationCreated event publish to EventBridge happens <em>after</em> the transaction commits, not inside it — PutEvents isn’t part of DynamoDB’s transaction model. That’s fine: if the transaction succeeds but the subsequent PutEvents call fails, you’re back to “the event might not have been published,” which is a separate (and separately solvable, e.g. via the transactional-outbox pattern using DynamoDB Streams) problem from “did I create two registrations.”</p><h3>Technique 3: AWS Lambda Powertools Idempotency utility</h3><p>Techniques 1 and 2 are “DIY” — you design the claim key, you write the condition, you handle the failure path. For many handlers, especially ones where the <em>entire response</em> should be cached and replayed (not just a uniqueness check), <a href="https://docs.powertools.aws.dev/lambda/typescript/latest/utilities/idempotency/">AWS Lambda Powertools for TypeScript</a> provides a drop-in makeIdempotent() wrapper with a DynamoDB-backed persistence layer.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/de2dc3657ea094e14c20cb261d86067d/href">https://medium.com/media/de2dc3657ea094e14c20cb261d86067d/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6DdAyiqfMxDBW5nT9u34hw.png" /><figcaption><strong>Technique 3: </strong>Powertools Idempotency: the utility manages the full lifecycle (INPROGRESS → COMPLETED → EXPIRED), coalesces in-flight duplicates, and caches the complete response — including generated fields like the QR code.</figcaption></figure><p>What you get beyond Techniques 1 and 2:</p><ul><li><strong>Full response caching</strong>, not just a uniqueness flag — a retried request gets back the <em>exact same response</em> the original got, including generated fields like the QR code.</li><li><strong>In-flight coalescing</strong> — if request B arrives while request A (same key) is still executing, Powertools can make B wait for A’s result rather than racing it.</li><li><strong>TTL and status management</strong> (INPROGRESS, COMPLETED, EXPIRED) handled for you, including cleanup of stale “in progress” records if a Lambda times out mid-execution.</li></ul><p>The trade-offs: it’s a separate DynamoDB table (or at least a clearly-scoped item collection) with its own IAM permissions (dynamodb:GetItem, PutItem, UpdateItem, DeleteItem on that table/collection), and — as currently shipped — the TypeScript utility’s persistence layer is DynamoDB-backed, so if your idempotency store needs to live elsewhere, this isn’t the tool. For TEMS, where everything already lives in one DynamoDB table, it’s a natural fit, and it directly replaces the hand-rolled, optional, check-then-write IDEMPOTENCY# pattern from the original handler — this time with the key <strong>required</strong>, derived from (eventId, userId) server-side rather than trusted to an optional client-supplied string.</p><h3>Testing for the race condition</h3><p>A unit test that calls the handler once and asserts it works will pass on both the buggy and fixed versions — the bug is entirely about <em>concurrency</em>, so the test has to create concurrency.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/faedebf3ca757fc5c36ea4c167f2c9f7/href">https://medium.com/media/faedebf3ca757fc5c36ea4c167f2c9f7/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TLS4V1mQIyfc_hHXtre0Hg.png" /><figcaption><strong>The concurrency test in action:</strong> against DynamoDB Local, the original handler produces 2+ distinct registrationId values; after Technique 1 or 2, all 10 concurrent calls converge on exactly one.</figcaption></figure><p>Against DynamoDB Local or a real (test/dev) table, this test fails reliably on the original code — you’ll see registrationIds.size come back as 2, sometimes more under load — and passes reliably once Technique 1 or 2 is in place, because the conditional check resolves the race deterministically rather than probabilistically. TEMS’s existing test suite (backend/__tests__/registration-service/) already exercises the waitlist and cancellation handlers with this kind of setup; the idempotency fix needs the same treatment for the registration path — a concurrency test is the only kind of test that actually validates the fix.</p><h3>Decision framework</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lGkQfge2Y1uOZBGoEQxBfA.png" /><figcaption><strong>Decision framework:</strong> claim key + conditional write for simple uniqueness; TransactWriteItems when multiple items must succeed or fail together; Powertools when you need full response replay and in-flight coalescing.</figcaption></figure><p>In practice, these aren’t mutually exclusive — TEMS’s fix uses <strong>all three</strong>: a claim item as part of a transaction (Techniques 1+2) for the core uniqueness guarantee at the data layer, with Powertools Idempotency wrapping the handler for response-level replay and making the previously-optional idempotencyKey a required, server-derived value.</p><h3>Common pitfalls</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EbBaJHxli8l5NO0STSGkUQ.png" /></figure><ul><li><strong>TTL design on idempotency/claim records.</strong> If a claim record never expires, a permanently-cancelled-then-recreated event could be blocked from re-registering a user who legitimately should be allowed back in (e.g., they cancelled and want to re-register). Decide what “idempotency window” actually means for your domain — TEMS’s original (unused) idempotency record had a 24-hour TTL, which is reasonable for “don’t double-submit this form,” but the <em>claim</em> item for “is this user registered” should track the registration’s lifecycle, not a fixed TTL — delete or update it when the registration is cancelled.</li><li><strong>Conditional expressions on the wrong attribute.</strong> attribute_not_exists(PK) only works if PK is genuinely guaranteed to not exist for “no claim yet.” If your claim item shares a PK with other item types under the same key (common in single-table designs), make sure the condition is checking the <em>combination</em> that’s actually unique — attribute_not_exists(PK) on an item where PK alone is shared across many SK values won’t do what you want; the condition needs to be evaluated on the specific (PK, SK) the Key parameter targets, which it is by default — just double check your key schema actually makes (PK, SK) the right uniqueness boundary.</li><li><strong>Forgetting the loser’s path.</strong> A conditional write failing is not an error condition to bubble up to the user as “registration failed” — it’s the <em>expected, successful</em> outcome for a duplicate request. Make sure that path returns a normal success response (the existing registration), not a 4xx/5xx.</li><li><strong>Publishing events before the transaction commits.</strong> PutEvents to EventBridge should happen <em>after</em> a successful TransactWriteItems, never before and never inside (it can’t be, technically, but it’s worth saying explicitly) — otherwise a failed transaction can still result in a “RegistrationCreated” event for a registration that doesn’t exist.</li><li><strong>Assuming this fixes “exactly-once” everywhere.</strong> This fixes exactly-once <em>creation</em> of a registration record. Consumers of RegistrationCreated (the notification service, the waitlist promoter) can still receive that event more than once — because EventBridge is at-least-once, as covered in <a href="https://medium.com/towards-aws/i-asked-an-ai-to-audit-my-production-ready-serverless-app-it-found-a-myth-and-a-race-condition-27ab4c16a359">the first article in this series</a> — and need their own idempotency story for <em>their</em> side effects (e.g., “has a confirmation email already been sent for this registrationId?”). Idempotent writes at the source don’t make downstream consumers idempotent for free.</li></ul><h3>Applying this to TEMS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UIMbmOHyXUPI1rlJfuKfmQ.png" /></figure><p>The concrete change set for TEMS’s register.ts:</p><ol><li>Make idempotencyKey a required argument in the GraphQL schema (registerForEvent(eventId: ID!, idempotencyKey: String!)), generated client-side as a UUID per registration <em>attempt</em> (regenerated on each user-initiated tap, not per network retry — so retries of the <em>same</em> tap share a key, but a deliberate second attempt after an error gets a fresh one).</li><li>Replace the two unconditional PutCommands and the standalone atomicIncrementRegistered call with a single TransactWriteCommand containing: the REGCLAIM#{userId} conditional put, both registration record puts, and the counter update.</li><li>Wrap the handler in Powertools’ makeIdempotent(), keyed on (eventId, idempotencyKey), so retried requests get byte-identical responses (same QR code, same registrationId) without re-running any of the business logic.</li><li>Add the concurrency test from above to the registration-service test suite, and run it against DynamoDB Local in CI.</li></ol><p>None of this requires a new table, a new service, or a schema migration beyond adding one GraphQL argument’s nullability. It’s roughly a one-day change — which is, frankly, the most sobering part of the whole exercise.</p><p><em>This is the second article in a series on what a structured AI architecture audit found in a “production-ready” serverless app. The </em><a href="https://medium.com/towards-aws/i-asked-an-ai-to-audit-my-production-ready-serverless-app-it-found-a-myth-and-a-race-condition-27ab4c16a359"><em>first article</em></a><em> covers the EventBridge deduplication myth that made this bug easy to miss; the next looks at how the same app’s FIFO waitlist — built entirely on DynamoDB, no queue service involved — handles its own version of this problem at smaller stakes.</em></p><p>Git Repo: <a href="https://github.com/shantanu-gonade/terrapin-events.git">https://github.com/shantanu-gonade/terrapin-events.git</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7fe1dfb1b777" width="1" height="1" alt=""><hr><p><a href="https://towardsaws.com/stop-relying-on-eventbridge-to-dedupe-your-events-a-practical-guide-to-idempotent-dynamodb-writes-7fe1dfb1b777">Stop Relying on EventBridge to Dedupe Your Events: A Practical Guide to Idempotent DynamoDB Writes</a> was originally published in <a href="https://towardsaws.com/">Towards AWS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The EventBridge Myth That Hid a Double-Registration Bug and a Race Condition in My Serverless App]]></title>
            <link>https://towardsaws.com/i-asked-an-ai-to-audit-my-production-ready-serverless-app-it-found-a-myth-and-a-race-condition-27ab4c16a359?source=rss-46cf39bc224------2</link>
            <guid isPermaLink="false">https://medium.com/p/27ab4c16a359</guid>
            <category><![CDATA[event-driven-architecture]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Shantanu Gonade]]></dc:creator>
            <pubDate>Wed, 17 Jun 2026 08:03:46 GMT</pubDate>
            <atom:updated>2026-06-17T15:25:38.983Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How a routine architecture review turned up a team myth about EventBridge and a double-booking bug hiding in plain sight — and why the two were the same problem wearing different hats.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RfoWEj9yQOTrlea2iwQ6Cg.gif" /><figcaption>I Asked an AI to Audit My “Production-Ready” Serverless App. It Found a Myth and a Race Condition.</figcaption></figure><p>Three weeks ago, I closed out a 14-week build of <a href="https://github.com/shantanu-gonade/terrapin-events.git"><strong>TEMS</strong></a> (Terrapin Events Management System) — a serverless event management platform for the University of Maryland. Students browse and register for campus events, organizers manage capacity and waitlists, admins approve events and watch a metrics dashboard. Under the hood: a single-table DynamoDB design, an AppSync GraphQL API, Cognito auth, EventBridge wiring eight backend services together, 54 Lambda functions, the works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mY_8HisfLG95ViSine3ccg.png" /><figcaption><strong>TEMS high-level architecture:</strong> AppSync → Lambda → DynamoDB, with EventBridge wiring eight backend services and Cognito handling auth. 54 functions, one custom bus, one table.</figcaption></figure><p>The completion report I wrote for myself said what every completion report says:</p><blockquote><em>- 100% of planned features implemented</em></blockquote><blockquote><em>- AWS Well-Architected Framework compliance</em></blockquote><blockquote><em>- Production-grade security and scalability</em></blockquote><blockquote><strong><em>Project Status: COMPLETE AND PRODUCTION-READY</em></strong></blockquote><p>I believed it. I’d written tests. I’d followed the patterns from the AWS docs I’d read. I’d even left myself meeting notes during the build with little architecture decisions and “why we did it this way” rationales — including one note that EventBridge would “automatically deduplicate events within 24 hours,” so a few rough edges in the registration flow weren’t a big deal.</p><p>Then, mostly out of curiosity, I pointed an AI architecture audit at the codebase and asked it to compare three things against each other: what the docs <em>claimed</em>, what the code <em>actually did</em>, and what AWS’s current (2026) guidance recommends for each pattern.</p><p>It came back with a numbered list of findings. Two of them stopped me cold — not because they were exotic, but because they were the kind of thing a senior reviewer catches in five minutes and a solo developer (me, several months deep in feature work) walks past a hundred times without seeing.</p><p>This is the story of those two findings, and why they turned out to be the same bug.</p><h3>The setup: as-described vs. as-built vs. best-practice</h3><p>Before the findings, a quick word on the audit itself, because the <em>shape</em> of it is as useful as the content.</p><p>I didn’t ask for a generic “review my AWS architecture” pass — that tends to produce a list of platitudes (<em>“consider adding monitoring,” “review your IAM policies”</em>) that are true of literally every AWS account on Earth. Instead, I gave it three things to triangulate:</p><ol><li><strong>What the project documentation claims</strong> — architecture docs, meeting notes, the completion report.</li><li><strong>What the code actually does</strong> — every serverless.yml, every handler, the GraphQL schema, the DynamoDB table definition.</li><li><strong>What AWS currently recommends</strong> — for each pattern in use (EventBridge, DynamoDB single-table design, idempotency, CQRS-style read models).</li></ol><p>Then I asked it to flag every place those three things disagreed, with file and line citations for every claim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kNyUyjf8POIFQCidG9Me8g.png" /><figcaption><strong>The audit’s three-way triangulation:</strong> what the docs <em>claim</em>, what the code <em>does</em>, what AWS <em>currently recommends</em>. Every finding lives in the gaps.</figcaption></figure><p>That last part matters. An AI that says “your event-driven architecture could be more robust” is not useful. An AI that says <em>“</em><em>register.ts:161-199 writes two </em><em>PutCommands keyed on a freshly generated </em><em>registrationId, with no </em><em>ConditionExpression enforcing uniqueness on </em><em>(eventId, userId) — here&#39;s the AWS doc on conditional writes that addresses this&quot;</em> is useful, because you can go open that file and check it yourself in thirty seconds. Good audits — human or AI — are falsifiable. If you can&#39;t verify a finding against the actual repo, throw it out.</p><p>With that framing, here’s what came back.</p><h3>Finding 1: “EventBridge automatically deduplicates events”</h3><p>Buried in my own meeting notes from the week I wired up the registration flow was this line, paraphrased: <em>EventBridge automatically deduplicates events, so duplicate </em><em>RegistrationCreated events within a 24-hour window won&#39;t cause problems downstream.</em></p><p>I have no idea anymore where I picked that up. Maybe I was thinking of SQS FIFO queues and their 5-minute deduplication window. Maybe I half-remembered something about EventBridge Pipes. Either way, it had the structure of a fact: specific (24 hours), plausible (AWS services <em>do</em> dedupe things sometimes), and — crucially — comforting. If it’s true, a bunch of edge cases I hadn’t fully thought through just… go away.</p><p>The audit’s response was blunt: <strong>Amazon EventBridge provides at-least-once delivery and has no native event-level deduplication.</strong> None. Not in 24 hours, not ever. If a producer calls PutEvents twice with logically identical payloads, EventBridge will happily deliver both, to every matching rule, as two separate events. (There&#39;s PutEvents request-level retry behavior if <em>the API call itself</em> fails and you retry it, but that&#39;s a different thing from &quot;the same business event was generated twice by my own application code,&quot; which is the case that actually matters here.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DX8WRcfDcHAFJtdfiQo8mQ.gif" /><figcaption><strong>EventBridge at-least-once delivery:</strong> two identical PutEvents calls produce two deliveries to every matching rule. There is no 24-hour deduplication window — that&#39;s SQS FIFO, and even that&#39;s 5 minutes.</figcaption></figure><p>For TEMS specifically, that means every consumer of RegistrationCreated, WaitlistAdded, WaitlistPromoted, and friends — published from register.ts:224-242 and waitlist-manager.ts onto our custom bus (TemsEventBus, with a 30-day replay archive and a DLQ behind it) — has to assume it might receive the <em>same logical event twice</em> and either be naturally idempotent (a second &quot;send confirmation email&quot; is harmless-ish, if annoying) or actively de-duplicate (a second &quot;decrement available capacity&quot; is not harmless at all).</p><p>On its own, this is a “fix the docs, add a code comment” finding. Mildly embarrassing, low stakes. I’d have fixed the meeting note, added a // NOTE: EventBridge does NOT dedupe — see &lt;link&gt; comment near the PutEventsCommand calls, and moved on.</p><p>Except the audit’s very next finding was about the registration handler. And once I read it, the meeting-note myth stopped being mildly embarrassing and started looking like the <em>reason</em> the second bug had survived this long.</p><h3>Finding 2: the double-registration bug</h3><p>Here’s a simplified version of what register.ts does when a student registers for an event (real file: <a href="https://github.com/shantanu-gonade/terrapin-events/blob/68604c25503e6397173aa7c923ece11aeb4f459e/backend/services/registrations/handlers/register.ts">backend/services/registrations/handlers/register.ts</a>):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3bb8573cf214ea5da9471717ee63fd45/href">https://medium.com/media/3bb8573cf214ea5da9471717ee63fd45/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yb6bjT0xmZlDI0o2zvzBrw.png" /><figcaption><strong>The race window:</strong> Requests A and B both pass the isUserRegistered read-check before either write lands. Both generate unique registrationIds. DynamoDB accepts both unconditionally. One student, two records, two QR codes.</figcaption></figure><p>Read in isolation, every individual piece looks <em>reasonable</em>. There’s an idempotency check! There’s a “already registered” check! There’s an atomic counter increment using DynamoDB’s ADD update expression, which really is atomic! It reads like code written by someone who knew about these problems and was actively guarding against them. (It was. That someone was me, four months ago, clearly aware idempotency was a thing — just not finishing the thought.)</p><p>But walk through what actually happens when a student double-clicks “Register” — or, more realistically, taps it once on flaky dorm wifi, the request hangs, they tap again:</p><ol><li><strong>Request A</strong> arrives. No idempotencyKey (the frontend doesn&#39;t currently send one — it&#39;s optional, remember). isUserRegistered runs its Query, finds nothing, returns false. Capacity check passes. A is now mid-flight, about to write.</li><li><strong>Request B</strong> arrives a few hundred milliseconds later, before A’s PutCommands have landed. isUserRegistered runs <em>again</em> — and because A hasn&#39;t written yet, B <em>also</em> gets false. Capacity check passes again.</li><li><strong>Both requests</strong> generate their own fresh registrationId via nanoid(16). Both write two PutCommands each — USER#{userId}/REGISTRATION#{id} and EVENT#{eventId}/REGISTRATION#{id} — with completely different sort keys, because the IDs are different random strings. <strong>Nothing in DynamoDB rejects this.</strong> There&#39;s no ConditionExpression. There&#39;s no uniqueness constraint anywhere that says &quot;a given (eventId, userId) pair may only have one active registration row.&quot;</li><li><strong>Both requests</strong> call atomicIncrementRegistered(eventId, 1). This part <em>is</em> atomic — it&#39;s a DynamoDB UpdateItem with ADD registeredCount :inc — so the counter correctly goes up by 2. Correctly, for the wrong reason: it&#39;s accurately counting two registrations that should never have both existed.</li><li><strong>Both requests</strong> publish a RegistrationCreated event to EventBridge.</li></ol><p>End state: one student, two registration records, two QR codes, two confirmation emails, and an event capacity counter that’s now off by one in the direction of “oversold.” Do this across a popular event during a registration rush — say, the first ten minutes after a big lecture’s extra-credit event opens up — and you get a slow leak of phantom registrations that nobody notices until check-in day, when the room is fuller than the headcount predicted and a few students’ QR codes scan into a now-”full” event that capacity-checks are blocking new registrants from.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pA_lAwtwirY1IwSfmlTw-Q.png" /><figcaption><strong>End state after a successful double-registration:</strong> two rows in DynamoDB, a capacity counter incremented by 2, two RegistrationCreated events on the bus, and two confirmation emails in the student&#39;s inbox.</figcaption></figure><p>The race window is small — milliseconds — but it doesn’t need to be wide. It needs to be <em>non-zero</em>, and it needs traffic. A campus event platform at registration-rush time has both.</p><h3>Where the two findings meet</h3><p>Here’s the part that actually changed how I think about this codebase.</p><p>The “fix” for the double-registration bug is, fundamentally, <em>idempotency at the write layer</em>: make it so that no matter how many times “register user X for event Y” is requested, at most one registration record can ever exist for that pair. That’s a DynamoDB-side guarantee — a conditional write or a transaction — and it’s completely independent of anything downstream.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AZGOJvOMggOTxF7dOk_Vaw.png" /><figcaption><strong>The EventBridge Myth:</strong> Think AWS handles your event deduplication automatically? Think again. Why &quot;at-least-once&quot; delivery means you need strict write-layer idempotency.</figcaption></figure><p>The myth said: <em>“don’t worry about duplicate events, EventBridge will collapse them within 24 hours.”</em> If I’d genuinely believed that and stopped there, I’d have been solving the wrong layer entirely — even in a world where EventBridge <em>did</em> dedupe events, that would do nothing to stop the DynamoDB writes in steps 3 and 4 above from happening twice. The duplication isn’t an EventBridge problem. It’s not even really a “two Lambda invocations” problem. It’s that <strong>the database has no opinion about whether a given </strong><strong>(eventId, userId) pair is allowed to appear more than once</strong>, and nothing upstream of the database closes that gap.</p><p>The myth didn’t <em>cause</em> the bug. The bug would exist with or without it. But I think the myth is a big part of why the bug survived a full build cycle, a test suite with &gt;80% coverage, and a “production-ready” sign-off — because every time some part of my brain noticed “hm, this registration flow doesn’t have a hard uniqueness guarantee,” another part of my brain had a half-remembered, comforting, <em>wrong</em> answer ready: <em>that’s fine, it gets cleaned up downstream.</em> Nothing gets cleaned up downstream. There is no downstream cleanup. There never was.</p><p>That’s the actual lesson, more than either finding individually: <strong>a wrong belief about how your infrastructure behaves doesn’t just cost you when you act on it directly — it costs you every time it talks you out of fixing something else.</strong></p><h3>The fix (briefly — full tutorial is next)</h3><p>The shape of the fix is: give every (eventId, userId) pair a single, deterministic &quot;claim&quot; item —</p><pre>{<br>  PK: `EVENT#${eventId}`,<br>  SK: `REGCLAIM#${userId}`,<br>  // ...<br>}</pre><p>— and write it with ConditionExpression: &#39;attribute_not_exists(PK)&#39;, ideally inside the same TransactWriteItems call that creates the two registration records and the idempotency record. The second concurrent request&#39;s conditional write fails with a ConditionalCheckFailedException, the handler catches that and returns the <em>existing</em> registration instead of creating a new one, and the race window closes — not because it got narrower, but because DynamoDB itself now rejects the collision regardless of timing.</p><p>There’s also a more turnkey option: AWS Lambda Powertools’ <a href="https://docs.powertools.aws.dev/lambda/typescript/latest/utilities/idempotency/">Idempotency utility</a>, which wraps a handler with makeIdempotent() and a DynamoDB-backed persistence layer, handling the claim-record lifecycle, TTLs, and in-flight request coalescing for you. Making idempotencyKey a <em>required</em> argument (instead of optional, as it is today at register.ts:31 and in the GraphQL schema&#39;s registerForEvent(eventId: ID!, idempotencyKey: String)) is part of this too — an idempotency mechanism that callers can opt out of by simply not passing a key isn&#39;t really a guarantee, it&#39;s a suggestion.</p><p>I’m walking through both approaches — deterministic conditional writes <em>and</em> the Powertools utility, with before/after code and a way to actually test for the race condition — in the companion piece: <strong>Stop Relying on EventBridge to Dedupe Your Events: A Practical Guide to Idempotent DynamoDB Writes </strong>soon<strong>.</strong></p><h3>What I’d tell you if you’re about to run this audit on your own project</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JK2A8aP_XSfsWhxGLIqD1Q.png" /><figcaption><strong>The EventBridge Myth:</strong> Think AWS handles your event deduplication automatically? Think again. Image 08-square.png breaks down why &quot;at-least-once&quot; delivery means you need strict write-layer idempotency.</figcaption></figure><p>A few things I’d do differently next time, and would suggest if you try this on your own codebase:</p><ul><li><strong>Ask for citations, not opinions.</strong> “Is this secure?” gets you a essay. “Show me every IAM policy with a Resource: &#39;*&#39; and the line number&quot; gets you a punch list. The second one is useful at 11pm before a launch.</li><li><strong>Separate “as described” from “as built” from “current best practice,” explicitly.</strong> A surprising amount of value in this audit came from the gap <em>between</em> my docs and my code — not from either one alone. My own completion report claimed 5 backend services; the code has 8. That’s not a security issue, but it’s a signal that the docs were written from memory, not from the repo — which made me trust the <em>other</em> claims in those docs less, including the EventBridge note.</li><li><strong>Verify anything time-sensitive against current docs, especially for fast-moving services.</strong> AWS behavior and tooling changes. The Lambda Powertools Idempotency utility I’m using in the next article didn’t always look like it does now. An audit’s value decays; treat findings as a snapshot, not gospel, and re-check the load-bearing ones.</li><li><strong>The boring findings are often connected to the interesting ones.</strong> I almost filed the EventBridge note under “fix the comment, move on.” It turned out to be load-bearing for a much bigger miss. If an audit turns up something that smells like “minor docs inaccuracy,” ask what <em>decisions</em> were made on the assumption that the inaccurate thing was true.</li></ul><p>TEMS is still “production-ready” in the sense that matters most: it’s a real system, serving a real use case, and I know exactly what’s wrong with it and how to fix it — which is a state most production systems never quite reach. The completion report needed an asterisk, not a rewrite. But I’m glad I asked the question before someone’s registration silently doubled during finals week.</p><p><em>TEMS is a serverless event management platform built on AWS Lambda, AppSync, DynamoDB, EventBridge, and Cognito. This is the first in a short series on what a structured AI architecture audit found in a “finished” project — next up, the idempotency fix in detail, and a look at how the same FIFO waitlist that handles oversold events is built entirely on DynamoDB.</em></p><h3>A Note of Appreciation</h3><p>This project, and this write-up, wouldn’t exist without the people who supported it along the way.</p><p>To <a href="https://www.linkedin.com/in/drtonydbarber/"><strong>Dr. Tony D. B</strong></a>. — thank you for your guidance, your patience, and for holding the work to a standard that made it worth doing properly. Your feedback shaped not just the system, but how I think about building one.</p><p>To <a href="https://www.linkedin.com/in/rohin-vaidya/"><strong>Rohin Vaidya</strong></a>, <a href="https://www.linkedin.com/in/sanskar-vidyarthi/"><strong>Sanskar Vidyarthi</strong></a>, <a href="https://www.linkedin.com/in/affansyedmuhammad/"><strong>Syed Muhammad Affan</strong></a> and <a href="https://www.linkedin.com/in/vishalrameshpatil/"><strong>Vishal Patil</strong></a> — thank you for your contributions, your collaboration, and for showing up consistently through every phase of this build. The best parts of TEMS reflect what we figured out together.</p><p>I’m grateful to all of you for the time, thoughtfulness, and care you brought to this. It meant more than I can neatly put into a completion report.</p><p>Git Repo: <a href="https://github.com/shantanu-gonade/terrapin-events">https://github.com/shantanu-gonade/terrapin-events</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27ab4c16a359" width="1" height="1" alt=""><hr><p><a href="https://towardsaws.com/i-asked-an-ai-to-audit-my-production-ready-serverless-app-it-found-a-myth-and-a-race-condition-27ab4c16a359">The EventBridge Myth That Hid a Double-Registration Bug and a Race Condition in My Serverless App</a> was originally published in <a href="https://towardsaws.com/">Towards AWS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I’m an Android Engineer. I got an AWS Solutions Architect Cert. Here’s why?]]></title>
            <link>https://towardsaws.com/im-an-android-engineer-i-got-an-aws-solutions-architect-cert-here-s-why-060a16d280ca?source=rss-46cf39bc224------2</link>
            <guid isPermaLink="false">https://medium.com/p/060a16d280ca</guid>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[aws-certification]]></category>
            <dc:creator><![CDATA[Shantanu Gonade]]></dc:creator>
            <pubDate>Tue, 16 Jun 2026 17:08:23 GMT</pubDate>
            <atom:updated>2026-06-16T17:08:23.329Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/924/0*1T6bLzjNMwxwh0MU" /><figcaption>The Bridge: mapping Android architecture to AWS cloud architecture, side by side</figcaption></figure><p>For about a year, the same question kept coming back, usually with a slightly puzzled tilt to it: <em>why is an Android engineer studying AWS?</em> I was 3.7 years into writing Kotlin at Samsung — OEM-level Android, Compose, MVVM, coroutines, the works — and here I was, drawing VPC diagrams and memorizing DynamoDB capacity modes for the Solutions Architect — Associate exam. From the outside it looked like a detour. “Go deeper on Android,” people said. “That’s your lane.”</p><p>I want to tell you about the realization that made me ignore that advice, because it turned out to be the opposite of a detour. Studying cloud architecture made me a measurably better Android engineer — and the reason is something I now believe most people on both sides of the mobile/backend line miss.</p><h3>The moment it clicked</h3><p>The honest origin story isn’t glamorous. It started with a retry.</p><p>I was debugging a sync bug in a feature that talked to a backend I hadn’t built. The client would fire a write, the write would occasionally fail, and my retry logic would dutifully fire it again — and sometimes the user would end up with the operation applied <em>twice</em>. I’d written the client the way a mobile engineer writes a client: assume the request either succeeds or fails, and if it fails, try again. Clean. Reasonable. Wrong.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/0*1qGpRvpAfhp1TRcf" /><figcaption>A mobile retry bug caused by missing idempotency — why a successful server write got duplicated by a client retry.</figcaption></figure><p>Because the thing I hadn’t internalized was what happened on the <em>other side of the wire</em>. The request had succeeded — the server had committed it — and only the response had been lost on a flaky connection. My retry wasn’t recovering from a failure; it was duplicating a success. The fix wasn’t in my Kotlin. It was in understanding that the backend needed to be idempotent, and that my client needed to send a key the server could use to recognize “I’ve already seen this one.” That’s a distributed-systems concept, and I was treating it as a networking annoyance.</p><p>That bug embarrassed me a little, and embarrassment is a good teacher. I realized I’d been doing something subtly limiting for years: I treated the backend as a vending machine. I put a request in, I got a response out, and the inside of the machine was somebody else’s problem. But my app’s behavior — how it retried, how it paginated, how it cached, how it degraded offline — was entirely shaped by a system I refused to reason about. Mobile is increasingly full-stack. Mobile DevOps — the CI/CD, the release infrastructure, the build pipelines I work in every day — <em>lives in the cloud</em>. I kept bumping into the backend and choosing to look away. The cert was me deciding to look.</p><h3>The realization underneath the realization</h3><p>Here’s the part I didn’t see coming. I expected studying AWS to teach me about the backend. It did. What I didn’t expect was that it would re-explain <em>my own job to me</em> — because senior Android architecture and cloud architecture are, structurally, the same mental model wearing different clothes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*u2k3a0M4pqykRIC7yAnw0Q.gif" /><figcaption>Animated map of all 7 Android-to-AWS architecture parallels, from ViewModel/Lambda to Hilt/Infrastructure-as-Code</figcaption></figure><p>The skill underneath both isn’t “Android” and it isn’t “AWS.” It’s drawing boundaries: between state and effects, between producers and consumers, between the read path and the write path, between what you declare and what the framework assembles. Once I saw that, the AWS material stopped feeling foreign and started feeling like my own architecture diagrams with the labels swapped. Let me walk the parallels, because this is the actual payload of the post.</p><h3>Parallel 1 — the stateless state holder</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/0*5zDn_7ClggPOJ-UM" /><figcaption>Parallel 1: Android ViewModel vs. AWS Lambda — both stateless handlers that turn input into output</figcaption></figure><p>In modern Android, a ViewModel exposes an immutable UiState and holds no long-lived mutable state of its own. The UI sends events up; the ViewModel reduces them into a new state and emits it down. It’s a function from input to output with a thin lifecycle wrapper. That’s <em>why</em> it’s the easy part of the app to unit-test — you hand it an input, you assert on the output, no environment to stand up.</p><p>A Lambda handler is the same shape. It holds no durable state between invocations; it takes an event in, derives a response, and returns. Anything it needs to persist goes <em>out</em> to a store. It’s testable for exactly the same reason a ViewModel is: input in, output out.</p><pre>// Android — ViewModel as a stateless-ish state holder<br>class CartViewModel(private val repo: CartRepository) : ViewModel() {<br>    private val _uiState = MutableStateFlow(CartUiState())<br>    val uiState: StateFlow&lt;CartUiState&gt; = _uiState.asStateFlow()<br>    <br>    fun onAction(action: CartAction) {<br>        when (action) {<br>            is CartAction.AddItem -&gt; _uiState.update { it.copy(items = it.items + action.item) }<br>            // events in → new immutable state out. No hidden mutable state.<br>        }<br>    }<br>}tyt</pre><pre>// AWS - Lambda handler: same shape, different runtime<br>export const handler = async (event: AddItemEvent): Promise&lt;CartResponse&gt; =&gt; {<br>  // event in → response out. No durable state held between invocations.<br>  const updated = applyAddItem(event.cart, event.item);<br>  await ddb.put({ TableName: TABLE, Item: updated });   // persistence goes OUT<br>  return { cart: updated };<br>};</pre><p>Look at the two and the resemblance is almost rude. Both refuse to hold long-lived mutable state. Both push persistence to the edge. Both are pure-ish cores wrapped in a platform-managed lifecycle. The day I saw the Lambda and the ViewModel as the same object, AWS stopped being a new subject.</p><h3>Parallel 2 — model data for the queries you actually make</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/0*N9zqNba56kKDfQqx" /><figcaption>Parallel 2: Room offline-first database vs. DynamoDB single-table design — model your schema for the queries you run</figcaption></figure><p>Offline-first Android puts a local Room database as the source of truth: the UI reads from Room, a sync layer reconciles Room with the remote, and the app stays usable on a subway with no signal. The non-negotiable rule of doing this well is that you model your tables for the queries the screens actually run — not for some clean normalized picture of the domain. If a screen needs “the last message per conversation, sorted by time,” you shape the data so that’s one cheap query, not a join you reassemble in Kotlin.</p><p>DynamoDB single-table design is that rule with the volume turned up. There are no joins; you list every access pattern up front and design partition/sort keys so each one is a single, cheap query, then add a read-model cache for the hottest paths. Same discipline, same trap: people who model DynamoDB like a relational schema hate it, exactly like people who model Room around entities instead of screens end up with sluggish lists and N+1 reads.</p><p>Both are the same instruction: the questions you’ll ask of the data are the design input. The schema falls out of the questions, not the other way around. I’d been doing this on the client for years without naming it. AWS gave me the name and showed me it scales all the way up.</p><h3>Parallel 3 — decouple the producer from the consumer</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/0*q09qJKtPVNnhu-xP" /><figcaption>Parallel 3: Kotlin Flow vs. AWS EventBridge/SQS — decoupling producers from consumers with backpressure and queue-based load leveling</figcaption></figure><p>Compose architecture runs on unidirectional data flow: events down, state up, with Kotlin Flow as the reactive spine. A producer emits; collectors react; and crucially, Flow gives you backpressure — a slow collector doesn’t force the producer to block or drop on the floor, it buffers or conflates on defined terms.</p><p>The backend twin is event-driven architecture. A service does its work and emits a domain event onto EventBridge (or drops a message on SQS); other services subscribe and react on their own time. The producer doesn’t call the consumer and doesn’t wait on it. And the queue does the same job Flow’s backpressure does on the client: SQS queue-based load leveling absorbs a burst so a spike in producers doesn’t knock over the consumers — you bound concurrency instead of overwhelming the downstream.</p><p>There’s a deeper structural-concurrency rhyme here too. Coroutines’ structured concurrency bounds and scopes the work a screen is allowed to spawn — when the scope dies, the children die, no leaks. Queue-based leveling bounds and scopes the work the backend is allowed to run at once. Both are answers to the same question: <em>how do I absorb bursts without unbounded concurrency taking the system down?</em> I started writing better Flow code — conflating where I should, choosing the right buffer strategy — because SQS made me think explicitly about what a consumer does when the producer outruns it.</p><h3>Parallel 4 — declare your dependencies, let the framework assemble them</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/0*6m6b9kd2RRGqP4bM" /><figcaption>Parallel 4: Hilt dependency injection vs. AWS Infrastructure-as-Code — declare what you need, let the framework wire it</figcaption></figure><p>This is the parallel that surprised me most, because the two technologies look nothing alike on the surface.</p><p>Hilt (Dagger) is a dependency-injection graph. You don’t construct your Repository and hand-thread its ApiService and Database through five constructors; you declare how each thing is provided, and the framework assembles the graph and injects what each consumer asked for.</p><pre>// Android — Hilt: declare the dependency, the framework wires the graph<br>@Module<br>@InstallIn(SingletonComponent::class)<br>object DataModule {<br>    @Provides @Singleton<br>    fun provideCartRepo(api: CartApi, db: AppDatabase): CartRepository =<br>        CartRepositoryImpl(api, db)   // you declare; Hilt assembles &amp; injects<br>}</pre><p>Infrastructure-as-Code is the same idea pointed at cloud resources. You don’t click through a console wiring a Lambda to a DynamoDB table to an IAM role by hand; you declare the resources and their relationships, and the framework (CloudFormation / the Serverless Framework / Terraform) assembles the graph and provisions what each piece needs.</p><pre># AWS — IaC: declare the resource, the framework provisions &amp; wires it<br>functions:<br>  addItem:<br>    handler: cart.handler<br>    events: [{ http: { path: /cart, method: post } }]<br>    # declare what it needs; the framework grants the table dependency below<br>    iamRoleStatements:<br>      - { Effect: Allow, Action: [dynamodb:PutItem], Resource: !GetAtt CartTable.Arn }</pre><p>Both are the same move: stop assembling dependencies by hand; declare them and let a framework build the graph. Hilt’s @Provides and an IaC resource block are the same sentence in two languages. After IaC, I stopped resenting Hilt’s boilerplate and started seeing it as the client-side instance of a pattern I now trusted at scale.</p><h3>The fifth one — boundaries that scale a team</h3><p>I’ll name a fifth quickly because it’s the one senior engineers feel most. Gradle multi-module boundaries — :feature:cart, :core:network, an api module a :feature depends on versus the impl it doesn’t see — exist to enforce boundaries so a codebase and a team can scale without everything depending on everything. Microservice and service boundaries on the backend are the identical concern: you split so teams can ship independently and a change’s blast radius is bounded. The repository pattern abstracting your data sources is, on the backend, an API gateway or service layer abstracting the systems behind it. Same instinct, same payoff, same failure mode when you draw the lines wrong.</p><h4>Where the analogy breaks — and why that’s the most valuable part</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*9tf2omLUZkt75USy" /><figcaption>Where the Android-AWS analogy breaks: cold starts, distributed failure, and eventual consistency</figcaption></figure><p>If I stopped here, this would be a tidy little “everything is the same” essay, and that would be dishonest. The analogy is powerful precisely up to the point where it shatters, and the shattering is where the cert earned its keep.</p><p>Cold starts don’t exist on a device. Your ViewModel is already in memory; your code is warm. A Lambda can be cold — a fresh container, an init penalty, a p99 that’s nothing like your p50. On a device you optimize for jank and battery; in the cloud you optimize for an entirely different latency distribution, one with a long tail your client will <em>feel</em>. Understanding that tail changed how I design clients: I now expect the occasional slow first response and build the UI to stay responsive through it, instead of assuming the backend is as warm as my ViewModel.</p><p>Partial and distributed failure barely exist on a device. On the client, an operation mostly succeeds or fails as a unit, locally, observably. In a distributed system, a request can succeed on the server and fail to reach the client (my original retry bug), or half a fan-out can complete while the other half is still in flight. There’s no single “did it work?” you can read. This is why idempotency and explicit retry semantics aren’t backend trivia — they’re contracts my mobile client has to participate in. I write retries differently now: with idempotency keys, with the assumption that “no response” does not mean “no effect.”</p><p>Eventual consistency isn’t a thing your screen normally has to model. A device reads its own writes from local storage instantly. A distributed read replica might not have caught up yet. Designing for that — knowing that “I just wrote it but the read came back stale” is <em>correct behavior</em>, not a bug — has no real equivalent in single-device Android. But the moment your app reads from a system that’s eventually consistent, your UI has to account for it: optimistic updates, reconciliation, “pending” states. The cert is what let me see that coming instead of filing a phantom bug.</p><p>These three — cold starts, distributed failure, eventual consistency — are the load-bearing differences. And here’s the thing: learning where the parallel ends is exactly what made me a better mobile engineer. Not the similarities — the similarities just made the material learnable fast. The <em>differences</em> are what let me design clients that cooperate with the system they live inside: offline-first sync that tolerates eventual consistency, retries that assume idempotency, pagination and caching tuned to a real latency tail rather than an imagined instant backend.</p><h3>Why this makes me stronger on both sides</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/0*9rck62ssVhqNBp00" /><figcaption>Full-stack architecture diagram: Android client (Kotlin, Compose, Hilt) connected to a serverless AWS backend (Lambda, DynamoDB, EventBridge)</figcaption></figure><p>I came out of the Solutions Architect cert a better Android engineer, and it’s not the line on the résumé — it’s the second pair of eyes. When I design a screen now, I’m also thinking about the shape of the system feeding it: what its consistency guarantees are, where it can be slow, how it fails, what it costs to scale. When I reason about a backend, I bring the client’s reality — that latency and failure aren’t abstractions, they’re something a human is staring at on a phone, waiting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*jTMm4Nt7Zj96VoczjaV6kg.gif" /><figcaption>Realization: It’s the same mental map</figcaption></figure><p>I’ve now built both directions for real — a fully serverless app on AWS (single-table DynamoDB, 54 Lambdas, EventBridge) and OEM-level Android at Samsung — and the throughline is that the architecture instincts transfer almost completely, <em>except</em> at the three seams above, which are precisely the seams you have to get right. Mobile is going full-stack whether mobile engineers come along or not. The ones who reason about the whole system, instead of treating the backend as a vending machine, are going to build clients that feel inexplicably more solid than everyone else’s. That’s the bet I made. So far it’s paying off in cleaner retries, smarter offline behavior, and a much shorter conversation with backend engineers when something’s on fire.</p><p>If you write mobile and the backend still feels like a black box: pick the one cert or the one project that forces you to open it. You won’t come back a backend engineer. You’ll come back a better mobile one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/0*pG846fhZnphCbizp" /><figcaption>Recap diagram: all 7 Android-AWS architecture parallels and the 3 places the analogy breaks, in one map</figcaption></figure><p><em>Parallels mapped: ViewModel↔Lambda · Room offline-first↔DynamoDB single-table+cache · UDF/Kotlin Flow↔EventBridge/reactive streams · structured concurrency↔SQS load leveling · Hilt DI↔Infrastructure-as-Code · Gradle module boundaries↔service boundaries · Repository pattern↔API/service layer.</em></p><p><em>Where it breaks: cold starts · distributed/partial failure · eventual consistency.</em></p><p><em>I’m Shantanu — Android engineer and AWS Certified Solutions Architect — Associate. I build full-stack — Android clients and the serverless backends behind them. I write about mobile and cloud at </em><a href="http://shantanu-gonade.com/"><em>shantanu-gonade.com</em></a><em>. Open to senior Android and mobile-platform roles — let’s connect.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=060a16d280ca" width="1" height="1" alt=""><hr><p><a href="https://towardsaws.com/im-an-android-engineer-i-got-an-aws-solutions-architect-cert-here-s-why-060a16d280ca">I’m an Android Engineer. I got an AWS Solutions Architect Cert. Here’s why?</a> was originally published in <a href="https://towardsaws.com/">Towards AWS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android After Google I/O 2026]]></title>
            <link>https://medium.com/@shantanu568/android-after-google-i-o-2026-4a7c6515ec1f?source=rss-46cf39bc224------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a7c6515ec1f</guid>
            <category><![CDATA[android-development]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[kotlin-coroutines]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Shantanu Gonade]]></dc:creator>
            <pubDate>Tue, 09 Jun 2026 02:13:49 GMT</pubDate>
            <atom:updated>2026-06-16T05:41:01.944Z</atom:updated>
            <content:encoded><![CDATA[<p>Edge-to-edge is mandatory. Predictive back now owns your stack. Compose 1.11 ships Grid and Styles. Navigation 3 is stable. Kotlin 2.4 context parameters are production-ready.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t6TAKMgfNjNby5GmPL_oLg.png" /></figure><p>If your app targets Android 16 (API 36), two things will break the moment a user upgrades: your status bar layout and your back button handler. Not “might break.” Will break.</p><p>Google I/O 2026 has a single through-line: Android is now Compose-first. That phrase showed up in every keynote. It isn’t marketing. It means Google is putting all future guidance, new APIs, and tooling investment behind Jetpack Compose. Five years after its launch, Compose has graduated from “recommended” to “the only supported path forward.” Every change in this article connects back to that shift.</p><p>Let’s start with what’s on fire.</p><h3>Two Things That Will Break Your App Right Now</h3><h4>Edge-to-Edge Is No Longer Optional</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TMgk6hz90skOeXOqfp3aUg.gif" /><figcaption><em>Left: not edge-to-edge. Right: edge-to-edge — the only mode Android 16 supports.</em></figcaption></figure><p>Starting with Android 16 (API level 36), the system ignores WindowCompat.setDecorFitsSystemWindows(window, false). Apps that used true to opt out of edge-to-edge will now render incorrectly — content bleeds behind the navigation bar and status bar without insets applied.</p><p>Edge-to-edge is enforced. There is no opt-out flag, no manifest attribute to escape it. You must handle window insets explicitly.</p><p>Here is the correct pattern for a full-screen composable in 2026:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c1ea8c07ca8fa59be1695016076e3879/href">https://medium.com/media/c1ea8c07ca8fa59be1695016076e3879/href</a></iframe><p>The enableEdgeToEdge() call replaces the old WindowCompat dance. It sets the correct window appearance flags, handles light/dark status bar icons, and prepares the window for inset consumption.</p><p>Inside your screens, use Modifier.consumeWindowInsets and the WindowInsets APIs directly rather than relying on Scaffold to absorb everything silently:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0267e53b43f6876e10d1b93acc4be123/href">https://medium.com/media/0267e53b43f6876e10d1b93acc4be123/href</a></iframe><p>The key mistake developers make is passing WindowInsets.Zero to contentWindowInsets to &quot;fix&quot; visual issues, which defeats the purpose of edge-to-edge and creates problems on devices with gesture navigation. Use WindowInsets.safeContent and let the system compose correctly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UG8hV5QSQKoh6My_oSgWEA.png" /><figcaption><em>Gesture insets: the green zones are controlled by the OS. Never place tappable targets under them.</em></figcaption></figure><p>If you have custom views inside a AndroidView composable, apply insets explicitly:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b325950305da2a1b4d9caa7623685864/href">https://medium.com/media/b325950305da2a1b4d9caa7623685864/href</a></iframe><p><strong>Migration checklist:</strong></p><ul><li>Replace all WindowCompat.setDecorFitsSystemWindows(window, true) calls with enableEdgeToEdge()</li><li>Replace WindowCompat.setDecorFitsSystemWindows(window, false) calls — they are now no-ops</li><li>Audit every Scaffold for missing contentWindowInsets</li><li>Test on a device running Android 16 with gesture navigation enabled</li></ul><h3>Predictive Back: onBackPressed Is Dead</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sCvKbU37HVUVfAzP5wYg7A.png" /><figcaption><em>Predictive back previews the destination before the gesture commits. On Android 16, your app must support this natively.</em></figcaption></figure><p>On Android 16 (API 36), onBackPressed() is no longer called. KeyEvent.KEYCODE_BACK is not dispatched. If you override onBackPressed in an Activity or Fragment and you have not migrated to the predictive back APIs, your back handling silently does nothing.</p><p>This is a hard breaking change, not a deprecation warning.</p><p>The correct implementation uses BackHandler in Compose, which wires into the OnBackPressedDispatcher — the only supported path:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fe6757af391519a34f6f41850acf5bc1/href">https://medium.com/media/fe6757af391519a34f6f41850acf5bc1/href</a></iframe><p>For the system’s predictive back preview animation — the one that shows a shrinking card as you swipe — you get it for free when you use BackHandler. The system intercepts the gesture and shows the preview before your handler fires. You do not write animation code for the default behavior.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*diyFfAu3XweaFRVG6SG74g.png" /><figcaption>Motion spec during a left-edge swipe: the surface scales to 90%, shifts right with an 8dp margin. PredictiveBackHandler gives you the progress value to drive this.</figcaption></figure><p>For custom back animations (your own content transitioning while the user is mid-swipe), use PredictiveBackHandler:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/81c3eb3d69a52154ad3cb787ef4b8284/href">https://medium.com/media/81c3eb3d69a52154ad3cb787ef4b8284/href</a></iframe><p>If you still have legacy code that uses onBackPressed, set android:enableOnBackInvokedCallback=&quot;false&quot; in your manifest as a <strong>temporary</strong> escape hatch — but treat it as technical debt with a deadline. It will not be supported forever.</p><h3>Kotlin 2.4: Context Parameters Are Stable and They’ll Change How You Write Compose Code</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V-alJszhDidrRrszEUx_UA.png" /><figcaption>Kotlin 2.4.0 release notes: context parameters are stable. No compiler flags required.</figcaption></figure><p>Kotlin 2.4.0, released in June 2026, promotes context parameters to stable. No compiler flags required. Production-ready today.</p><p>Context parameters let a function declare that it needs a value to be “in scope” without the caller explicitly passing it. The compiler injects the dependency from the surrounding scope.</p><p>Here is the problem they solve in a Compose codebase. Consider a common pattern — a function that needs both a SnackbarHostState and a CoroutineScope to show snackbar messages:</p><p><strong>The old way (lots of plumbing):</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d602006b501d922237adf88b90e2a75e/href">https://medium.com/media/d602006b501d922237adf88b90e2a75e/href</a></iframe><p><strong>The new way with context parameters:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c49b86186a73b2bee69161d699fad6d8/href">https://medium.com/media/c49b86186a73b2bee69161d699fad6d8/href</a></iframe><p>The stronger use case: domain-level operations that need infrastructure — logging, analytics, navigation — without threading those concerns through every parameter.</p><p>Context parameters work especially well with the NowInAndroid architecture pattern. In a repository that needs both a network client and a local DAO, context parameters let you declare those dependencies at the call site rather than injecting them into the constructor when the caller already has them in scope.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/00b2ff90dbb6a4de3a37bc229b93c70d/href">https://medium.com/media/00b2ff90dbb6a4de3a37bc229b93c70d/href</a></iframe><p>This is not a replacement for Hilt or dependency injection. Context parameters solve a different problem: eliminating parameter drilling for values that are ambient within a call chain, not values that are injected at construction time.</p><h3>Compose 1.11: Grid, Styles, and the Testing Overhaul</h3><h4>The Grid API</h4><p>Compose 1.11 ships a non-scrollable Grid composable for building two-dimensional layouts. This is different from LazyVerticalGrid — Grid is for fixed-size layouts, not infinite lists.</p><p>Before Grid, building a dashboard-style layout in Compose required either LazyVerticalGrid (wrong — it&#39;s built for infinite content and has overhead for fixed layouts) or nested Row/Column composables (fragile and hard to maintain).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/af7763261db013e76e119c3e693c0e74/href">https://medium.com/media/af7763261db013e76e119c3e693c0e74/href</a></iframe><p>The GridItemSpan API gives you column-spanning without the SubcomposeLayout gymnastics that were previously required.</p><h4>The Styles API (Experimental)</h4><p>The experimental Style {} API separates a component&#39;s visual appearance from its structural behavior. Instead of overriding colors, shapes, and textStyle through individual parameters, you declare a style object that carries all visual customization.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ebe86713d0ee19778c528110950cc1ad/href">https://medium.com/media/ebe86713d0ee19778c528110950cc1ad/href</a></iframe><p>The Styles API is still @ExperimentalFoundationApi in 1.11. Do not ship it in production without understanding that the API surface may change. It is worth understanding now because this is the direction Compose is moving for design system work.</p><h4>The Testing API Overhaul</h4><p>Compose 1.11 makes the v2 testing APIs the default. This is a breaking change for test suites that relied on the implicit coroutine execution behavior of v1.</p><p><strong>What changed:</strong> v1 tests used UnconfinedTestDispatcher, which ran coroutines immediately when launched. v2 uses StandardTestDispatcher, which queues coroutines. They run only when you advance the virtual clock.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c37bddd17dc6a3c956b97610ed9d79ac/href">https://medium.com/media/c37bddd17dc6a3c956b97610ed9d79ac/href</a></iframe><p>The migration is mechanical: find every runComposeUiTest block that asserts on asynchronous state and add mainClock.advanceUntilIdle() or mainClock.advanceTimeBy(timeMs) after setContent. If you are using waitUntil, review whether it is masking timing assumptions.</p><p>The v1 APIs are deprecated but still present in 1.11. They will be removed in a future release.</p><h3>Navigation 3 Is Stable. Time to Migrate.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*9G4TfcSaH-3SAqW3nyVxjA.png" /><figcaption>Navigation 3’s NavDisplay handles back-gesture insets automatically. No manual inset wiring required.</figcaption></figure><p>Jetpack Navigation 3 reached stable in late 2025 and is now the official navigation library for Compose apps. Navigation 2 (androidx.navigation:navigation-compose) still works, but it will not receive new features.</p><p>Navigation 3 does one thing Navigation 2 never could: it gives you full ownership of the back stack as state. The back stack is a List&lt;Any&gt; that you hold in a MutableList — a plain Kotlin value. Navigation observes it; it does not own it.</p><p><strong>Migration from Navigation 2 to Navigation 3:</strong></p><p><em>Before:</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bd251f0401a09988cac2a72f6752cd85/href">https://medium.com/media/bd251f0401a09988cac2a72f6752cd85/href</a></iframe><p><em>After:</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6d47ebd0a7b3f4bbf31af2c57e646dc2/href">https://medium.com/media/6d47ebd0a7b3f4bbf31af2c57e646dc2/href</a></iframe><p>The back stack is a SnapshotStateList&lt;NavKey&gt;. You can read it, filter it, replace entries, and serialize it for process death restoration — none of which was possible with NavController.</p><p><strong>Adaptive layouts with Navigation 3:</strong></p><p>Navigation 3’s architecture makes two-pane layouts straightforward. The same back stack drives both single-pane (phone) and two-pane (tablet/foldable) layouts:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b1595181827e155cec3b0a76fdaabe61/href">https://medium.com/media/b1595181827e155cec3b0a76fdaabe61/href</a></iframe><p>This pattern — a single back stack that adapts its display — is the official recommended approach for large-screen apps in 2026.</p><h3>The Platform Goes Compose-First: Widgets, Camera, and Health Connect</h3><h4>Jetpack Glance + RemoteCompose: Widgets Are Finally Good</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XtbhWvRriUuNr43Ggp02jA.gif" /><figcaption>The same Compose concepts that govern app UI now govern widget UI via Jetpack Glance + RemoteCompose.</figcaption></figure><p>Android 17 marks a shift toward a Compose-based development model for all widgets. The vehicle is RemoteCompose, integrated into Jetpack Glance.</p><p>RemoteCompose renders full Compose animations on remote surfaces — home screen widgets and car displays. This means your home screen widget can have animated progress indicators, state transitions, and dynamic content without the RemoteViews limitations that made widget development miserable for a decade.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/716a2ad19c740ae0d4dbaedf397043c0/href">https://medium.com/media/716a2ad19c740ae0d4dbaedf397043c0/href</a></iframe><p>This is the first time CircularProgressIndicator in a widget animates properly on the home screen without running a background service to push RemoteViews updates at a fixed interval.</p><h4>Health Connect: FHIR Medical Records</h4><p>Health Connect in Android 16 adds write access for medical records in FHIR (Fast Healthcare Interoperability Resources) format. Health Connect is no longer just fitness data.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4fb2a22ab1ac4e5736a3bfef576670fc/href">https://medium.com/media/4fb2a22ab1ac4e5736a3bfef576670fc/href</a></iframe><p>Apps that read FHIR records must declare READ_MEDICAL_DATA_* permissions (scoped per category). The Health Connect permission dialog now shows users exactly what medical categories an app requests. This is a significant privacy surface — do not request medical permissions unless your app requires them.</p><h4>CameraX: The Composable Viewfinder</h4><p>CameraXViewfinder is now a stable @Composable that replaces the old XML-only PreviewView. It handles rotation, surface lifecycle, and camera configuration correctly across all window sizes.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/85b5902122d0f5fa4d49eb773055700c/href">https://medium.com/media/85b5902122d0f5fa4d49eb773055700c/href</a></iframe><p>The old pattern required wrapping PreviewView in AndroidView, which created lifecycle coordination issues when the composable was paused. CameraXViewfinder handles this correctly.</p><h3>Your Toolchain Changed Completely: Android Studio, CLI, and the Agentic Era</h3><h4>Android Studio: Narwhal + I/O Edition</h4><p>The I/O edition of Android Studio ships a LeakCanary profiler task directly in the IDE. You no longer run LeakCanary as a separate tool — memory leak analysis runs as a first-class profiler task in the same panel as CPU and network profilers.</p><p>Agent Mode in Gemini (available in Narwhal Feature Drop and later) handles multi-file tasks: generating tests for a feature, refactoring a module to a new architecture pattern, or migrating from Navigation 2 to Navigation 3. The agent formulates a plan, shows it to you, and executes only after you approve each step.</p><p>The iOS app porting feature deserves special attention: you point Android Studio at an Xcode project and an AI agent analyzes the Swift/Objective-C code, maps it to equivalent Android patterns, and generates a working Kotlin/Compose app. Migrations that took weeks now take hours. The output is not perfect, but it produces a running app with the correct architecture patterns.</p><h4>Android CLI: Your App Is Now Scriptable</h4><p>Android CLI (adb replacement for semantic operations) is stable and exposes your app to AI agents:</p><pre># Semantic symbol resolution — ask Android CLI what a class does<br>android-cli symbols resolve --class=&quot;com.example.HomeViewModel&quot;<br><br># Render a Compose preview to file (for visual regression or AI analysis)<br>android-cli compose preview --composable=&quot;HomeScreen&quot; --output=preview.png<br><br># Analyze a file for warnings without opening the IDE<br>android-cli analyze --file=&quot;app/src/main/java/com/example/HomeScreen.kt&quot;<br><br># Run a specific UI test with Gemini-powered natural-language assertions<br>android-cli test journey --description=&quot;Tap the login button, enter test@example.com and password123, verify the home screen shows&quot;</pre><p>The test journey command is the most significant: natural-language test assertions backed by Gemini&#39;s vision model. You describe the user flow in plain English; the CLI converts it into an automated test that runs against your app. This is how Google intends Android to participate in the agentic development toolchain.</p><h4>Google AI Studio: Build Android Apps From a Prompt</h4><p>Google AI Studio now builds native Android apps directly. Select “Build an Android app,” describe what you want, and the generated project uses Kotlin, Jetpack Compose, Material 3, and the current NowInAndroid architecture patterns. You can connect your Google Play developer account and publish directly to the Internal Test Track without leaving AI Studio.</p><p>This matters for prototyping. The generated code is a starting point, not production code — but it generates the right starting point (Hilt, Room, MVVM, Compose Navigation) rather than the dated patterns that earlier code-generation tools produced.</p><h3>Android 17: What’s Coming and the End of Developer Preview</h3><p>Android 17 is in its first beta as of Google I/O 2026. Two changes worth knowing now:</p><p><strong>The Canary channel replaces quarterly developer previews.</strong> Android now ships new APIs and features to the Canary release of Android Studio as soon as they pass internal testing. You no longer wait for a scheduled Developer Preview drop. If you want to build against the latest Android platform APIs, stay on the Canary channel of Android Studio. This is the new normal.</p><p><strong>Widgets become Compose-native.</strong> Android 17 completes the migration of Jetpack Glance to full RemoteCompose. The legacy RemoteViews approach still works, but Google will point all new widget development at Glance + Compose from Android 17 forward. If you have widgets written with RemoteViews, plan their migration.</p><p><strong>Pausable composition is now default.</strong> Introduced experimentally in Compose 1.10, pausable composition lets the Compose runtime split long composition work across multiple frames — preventing jank on complex screens. It is enabled by default in Android 17’s build of Compose. You do not need to change your code, but you should run your UI tests with the Compose 1.11 v2 testing APIs (see Section 3) to ensure they handle the non-immediate execution correctly.</p><h3>Your Action Items</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4yL01hMWwxx7ZkIFNRxMYQ.gif" /><figcaption>A correctly handled edge-to-edge bottom bar: scrim for three-button navigation, transparent for gesture navigation. This is what your app should look like on Android 16.</figcaption></figure><p>The most urgent changes are in this order:</p><p><strong>Ship this week:</strong></p><ol><li>Add enableEdgeToEdge() to every Activity and remove all WindowCompat.setDecorFitsSystemWindows calls</li><li>Audit every onBackPressed override — migrate to BackHandler or PredictiveBackHandler</li><li>Run your Compose tests with Compose 1.11 — any test that fails on StandardTestDispatcher has a hidden timing assumption</li></ol><p><strong>Ship this month:</strong> <br>Migrate from Navigation 2 to Navigation 3, Upgrade to Kotlin 2.4 and audit your codebase for context parameter opportunities. Test your app on the Android 16 emulator with gesture navigation enabled.</p><p><strong>Plan for next quarter:</strong> <br>Migrate widgets from RemoteViews to Jetpack Glance + RemoteCompose 8. Evaluate CameraX replacement if you use PreviewView in AndroidView Explore Health Connect FHIR if your app touches health data. Enable Android Studio Agent Mode for your most repetitive architectural tasks (generating tests, migrating modules)</p><h4>What Google I/O 2026 Actually Means</h4><p>Android in 2026 is not the same platform it was in 2021 when Compose shipped. The ecosystem has converged. Kotlin is the only language. Compose is the only UI toolkit. MVVM with Hilt and Flow is the official architecture. Navigation 3 gives you back-stack as state. The toolchain generates apps that follow these patterns by default.</p><p>Five years of investment in Compose is paying off at the platform level: widgets, car displays, Wear OS tiles, and TV all converge on the same Compose model. The XML layout editor, Fragments, ViewPager2 — these are now legacy APIs, maintained but not advanced.</p><p>The developers who win in this cycle are the ones who use today’s stack to its depth — not the ones who maintain the widest possible backward compatibility. Android 16’s mandatory edge-to-edge and killed onBackPressed are not aggressive changes. They are the platform finally enforcing what it recommended for two years.</p><p>Your users already expect apps to feel like part of the OS. Now the OS enforces it.</p><p><em>All code in this article targets Android 16 (API 36), Kotlin 2.4, Compose 1.11, Navigation 3, and uses the NowInAndroid architecture patterns with Hilt and StateFlow. The minimum supported SDK in examples is API 24.</em></p><h4>Sources</h4><ul><li><a href="https://android-developers.googleblog.com/2026/05/17-things-android-developers-google-io.html">Android Developers Blog: 17 Things to know for Android developers at Google I/O</a></li><li><a href="https://android-developers.googleblog.com/2026/04/jetpack-compose-april-2026-updates.html">Android Developers Blog: What’s new in the Jetpack Compose April ’26 release</a></li><li><a href="https://android-developers.googleblog.com/2025/11/jetpack-navigation-3-is-stable.html">Jetpack Navigation 3 is stable</a></li><li><a href="https://developer.android.com/about/versions/16/summary">Android 16 features and changes list</a></li><li><a href="https://developer.android.com/about/versions/16/behavior-changes-16">Behavior changes: Apps targeting Android 16 or higher</a></li><li><a href="https://kotlinlang.org/docs/whatsnew24.html">What’s new in Kotlin 2.4.0</a></li><li><a href="https://android-developers.googleblog.com/2026/05/whats-new-android-developer-tools.html">Android Developers Blog: Android Studio I/O Edition: What’s new in Android Developer tools</a></li><li><a href="https://doveletter.dev/release-notes/google-io-2026-android">Everything About Google I/O 2026 for Android Developers | Dove Letter</a></li><li><a href="https://android-developers.googleblog.com/2026/02/the-first-beta-of-android-17.html">The First Beta of Android 17</a></li><li><a href="https://9to5google.com/2026/05/19/google-ai-studio-android-apps/">Google AI Studio can now build Android apps</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a7c6515ec1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>