<?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 sonali goel on Medium]]></title>
        <description><![CDATA[Stories by sonali goel on Medium]]></description>
        <link>https://medium.com/@goelsonali?source=rss-d5dcc9399827------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*gt9llJmV3O6dVkVc</url>
            <title>Stories by sonali goel on Medium</title>
            <link>https://medium.com/@goelsonali?source=rss-d5dcc9399827------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 19:48:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@goelsonali/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[How Fly.io Bakes Your App: A Behind-the-Scenes Look at fly deploy]]></title>
            <link>https://medium.com/@goelsonali/how-fly-io-bakes-your-app-a-behind-the-scenes-look-at-fly-deploy-f67b08da87da?source=rss-d5dcc9399827------2</link>
            <guid isPermaLink="false">https://medium.com/p/f67b08da87da</guid>
            <category><![CDATA[flyio]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[web-app-deployment]]></category>
            <dc:creator><![CDATA[sonali goel]]></dc:creator>
            <pubDate>Thu, 26 Nov 2026 22:35:18 GMT</pubDate>
            <atom:updated>2026-11-26T22:38:36.381Z</atom:updated>
            <content:encoded><![CDATA[<p>Subtitle: No docker push, no Docker Desktop, and no exposed secrets—how Fly.io turns a local Dockerfile into a live microVM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c9Xb6qWw-PZPZPAwST5o3Q.jpeg" /><figcaption>Fly.io bakery in action</figcaption></figure><p>The first time I deployed an app to Fly.io, it felt like a magic trick.</p><p>I installed flyctl locally, typed fly deploy, watched build logs scroll down my terminal, and sixty seconds later my app was live.</p><p>Then a few nagging questions kicked in:</p><ul><li><strong>Where did the Docker image actually go?</strong> I never ran docker push. I never logged into Docker Hub. Docker Desktop wasn&#39;t even open on my laptop. Who built the image, where was it stored, and how did the server know where to pull it from?</li><li><strong>Does Fly.io even run Docker in production?</strong> (Spoiler: it doesn’t — not in the way you might think.)</li><li><strong>Is committing </strong>fly.toml<strong> to Git a security risk?</strong> My configuration file sits in a repository listing my app names, regions, and machine sizes. Am I exposing my infrastructure to anyone who reads the repo?</li></ul><p>If you’ve ever stared at fly deploy logs wondering what happens between hitting Enter and getting a live URL, the cleanest way to understand the entire pipeline is to picture a <strong>bakery</strong>.</p><h3>The Setup: A Two-Part App</h3><p>To keep things concrete, imagine a small application split into two services:</p><ol><li>notes-web: A public frontend where users sign in.</li><li>notes-api: A private backend that stores notes in SQLite on persistent disk (a Fly Volume).</li></ol><p>Each service lives in its own folder with its own Dockerfile and fly.toml:</p><pre>notes/<br>├── web/<br>│   ├── Dockerfile<br>│   └── fly.toml<br>└── api/<br>    ├── Dockerfile<br>    └── fly.toml</pre><p>Here is a minimal fly.toml for the backend API:</p><pre>app = &quot;notes-api&quot;<br>primary_region = &quot;lhr&quot;            # London</pre><pre>[build]<br>  dockerfile = &quot;Dockerfile&quot;       # The recipe card</pre><pre>[env]<br>  PORT = &quot;8080&quot;<br>  DATA_DIR = &quot;/data&quot;</pre><pre>[mounts]<br>  source = &quot;notes_data&quot;           # The storage shelf (persistent volume)<br>  destination = &quot;/data&quot;</pre><pre>[[vm]]<br>  size = &quot;shared-cpu-1x&quot;          # The oven size<br>  memory = &quot;1gb&quot;</pre><h3>The Mental Model: Welcome to the Bakery</h3><p>Every moving part of a fly deploy workflow maps cleanly to a commercial bakery:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Js_8MtBeZ9nZxzhMdqlEA.png" /></figure><h3>Step-by-Step: What fly deploy Does Under the Hood</h3><h3>Step 1: flyctl packs your order form and recipe</h3><ul><li>When you run fly deploy inside api/, the local CLI reads fly.toml to find your app name (notes-api) and build instructions.</li><li>It creates a compressed tarball (build context) of your current directory—your source code and Dockerfile—while stripping out anything listed in .dockerignore (like node_modules, .git, or local .env files).</li></ul><blockquote><strong><em>Pro tip:</em></strong><em> Always include a </em><em>.dockerignore file. Without it, </em><em>flyctl uploads gigabytes of local dependencies or Git history over your home Wi-Fi on every deploy.</em></blockquote><h3>Step 2: Ingredients ship to Fly’s kitchen, not yours</h3><p>This is the part that surprises most developers coming from traditional Docker workflows: <strong>your laptop does not build the image.</strong></p><p>By default, flyctl checks if you have a local Docker daemon running. If you don&#39;t—or if you leave the default remote behavior enabled—flyctl spins up (or wakes up) a <strong>Remote Builder</strong> inside your Fly organization and streams your build context to it over an encrypted WireGuard tunnel.</p><ul><li><strong>Why this matters:</strong> You don’t need Docker Desktop installed or running, and builds run on fast cloud hardware with persistent layer caching across deploys.</li><li><strong>Want to build locally anyway?</strong> You can force local builds with fly deploy --local-only (useful when debugging tricky build steps offline).</li></ul><h3>Step 3: The kitchen follows the recipe (and touches Docker Hub once)</h3><p>The remote builder executes your Dockerfile line by line. The very first line almost always looks something like this:</p><p>Dockerfile</p><pre>FROM python:3.13-slim</pre><p>To execute that line, Fly’s builder pulls the public python:3.13-slim base image from Docker Hub. <strong>That is the only moment Docker Hub is involved.</strong> It supplies the plain sponge cake you start with; your proprietary code is never uploaded to Docker Hub.</p><h3>Step 4: The finished cake goes into Fly’s private fridge</h3><p>Once the image finishes building, the remote builder pushes it directly to Fly.io’s internal registry. You can see this exact moment in your terminal output:</p><pre>pushing manifest for registry.fly.io/notes-api:deployment-01HXYZABC123...</pre><p>Breaking down that address tells you everything about where your code lives:</p><ul><li>registry.fly.io: Fly.io’s private container registry (the fridge).</li><li>notes-api: Your app’s isolated repository inside that registry.</li><li>deployment-01HXYZ...: A unique, immutable tag generated for this specific deployment.</li></ul><h3>Step 5: The plot twist — Fly unpacks the image into a microVM</h3><p>Here is a detail that trips up even experienced engineers: <strong>Fly.io does not run Docker containers in production.</strong></p><p>Instead, Fly uses Docker images purely as a packaging format. When your Machine boots in London (lhr), Fly&#39;s orchestration layer:</p><ul><li>Pulls the image from registry.fly.io/notes-api using internal credentials (so you never have to run docker login).</li><li>Unpacks the Docker image layers into a flat root filesystem.</li><li>Boots a <strong>Firecracker microVM</strong> (a Fly Machine) directly from that filesystem.</li><li>Attaches your persistent notes_data volume at /data.</li><li>Injects your [env] variables and encrypted secrets into the VM&#39;s environment.</li></ul><p>Because it boots as a microVM with its own lightweight kernel rather than a shared-kernel container, startup takes milliseconds, and scaling to zero when idle becomes trivial.</p><h3>Step 6: Rolling updates and rollbacks</h3><p>When you deploy a second time, Fly builds a brand-new image tag, boots a new Machine alongside your old one, waits for health checks (or smoke checks) to pass, routes traffic over, and destroys the old Machine.</p><p>Previous image tags remain stored in registry.fly.io, meaning rollbacks don&#39;t require rebuilding anything.</p><h3>See It for Yourself: Useful Inspection Commands</h3><p>You don’t have to take any of this on faith. You can inspect the exact images, registries, and builders behind your app right from your terminal:</p><pre># View every deployment release and its exact registry.fly.io image tag<br>fly releases -a notes-api --image</pre><pre># Check which image digest and tag your live Machine is currently running<br>fly image show -a notes-api</pre><pre># Deploy a specific pre-built image without rebuilding<br>fly deploy --image registry.fly.io/notes-api:deployment-01HXYZABC123...</pre><h3>Security Check: “Am I Exposing My Setup by Committing fly.toml?&quot;</h3><p>Once developers understand the pipeline, the next worry is almost always Git hygiene:</p><p><em>My </em>fly.toml<em> is sitting in a repository with my app names, regions, internal hostnames, and VM sizes. Is that safe?</em></p><p>Think of fly.toml as the <strong>sign hanging above a bakery</strong>: <em>&quot;Artisan Bakery — London — Open 9 to 5.&quot;</em> Anyone walking down the street can read the sign, and it helps your delivery drivers find the building—but reading the sign doesn&#39;t unlock the safe.</p><h3>What is inside fly.toml (and why it&#39;s safe to commit)</h3><ul><li><strong>App names, regions, and VM specs:</strong> Knowing your app is named notes-api and runs on 1gb of RAM in lhr gives an attacker zero access.</li><li><strong>Non-sensitive </strong>[env]<strong> vars:</strong> Public flags like PORT = &quot;8080&quot; or NODE_ENV = &quot;production&quot; belong in version control so builds stay reproducible.</li><li><strong>Internal addresses:</strong> Seeing [http://notes-api.flycast](http://notes-api.flycast) in your config only reveals a private network alias that is completely unroutable from the public internet.</li></ul><h3>Where real secrets live</h3><p>API keys, database URLs, and signing keys <strong>never</strong> belong in fly.toml or your Dockerfile (note: never pass secrets via Docker ARG or ENV instructions, as those get baked into image layers).</p><p>Instead, store them via Fly Secrets:</p><pre>fly secrets set API_KEY=sk_live_... DATABASE_URL=... -a notes-api</pre><p>Fly encrypts these values at rest and injects them directly into the microVM’s memory only at boot time.</p><p>Even if you run fly secrets list, Fly only outputs cryptographic digests (SHA-256 hashes) of the values—never the plaintext secrets themselves.</p><h3>What you actually need to guard</h3><p>Your container registry (registry.fly.io/notes-api) is locked strictly to your Fly organization. What you need to protect like the keys to the bakery are:</p><ul><li><strong>Your local CLI session</strong> (~/.fly/config.yml)</li><li><strong>CI/CD deploy tokens</strong> (FLY_API_TOKEN in GitHub Actions)</li></ul><p>Anyone holding a valid deploy token can push new code, read environment secrets from a running Machine, and access attached volumes.</p><blockquote>Keep those tokens locked in encrypted CI secrets and scope them to specific apps whenever possible.</blockquote><h3>Bonus Tip: Lock the Back Door on Internal Services</h3><p>If notes-api should <em>only</em> ever talk to notes-web and never face the public internet, make sure it doesn&#39;t have a public IP address:</p><pre># Deploy without assigning public IPv4/IPv6 addresses<br>fly deploy --no-public-ips</pre><pre># Allocate a private Flycast IPv6 address reachable only inside your Fly network<br>fly ips allocate-v6 --private -a notes-api</pre><p>Your frontend (notes-web) can now make standard HTTP requests to [http://notes-api.flycast](http://notes-api.flycast) over Fly&#39;s encrypted internal WireGuard mesh. Even if someone reads your fly.toml on GitHub and tries to curl that address, it simply doesn&#39;t exist on the public internet.</p><h3>The Whole Journey in One Line</h3><blockquote><strong><em>Code + </em></strong><em>Dockerfile → bundled by </em><em>fly deploy → built on </em><strong><em>Fly’s remote builder</em></strong><em> (base image from Docker Hub) → pushed to </em><em>registry.fly.io/&lt;app&gt; → unpacked into a </em><strong><em>Firecracker microVM</em></strong><em> with </em><em>fly.toml settings + encrypted secrets → live traffic.</em></blockquote><h3>Key Takeaways</h3><ul><li>fly deploy<strong> builds in the cloud by default:</strong> Your laptop doesn&#39;t need Docker running; Fly uses an organization-private remote builder with persistent layer caching.</li><li><strong>Images live in </strong>registry.fly.io<strong>, not Docker Hub:</strong> Docker Hub is only used to pull your public FROM base image.</li><li><strong>No Docker daemon in production:</strong> Fly unpacks your Docker image into a root filesystem and boots a lightweight Firecracker microVM.</li><li>fly.toml<strong> is safe for Git:</strong> It holds infrastructure blueprints, not credentials. Keep sensitive values in fly secrets and guard your FLY_API_TOKEN.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f67b08da87da" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pact Testing Made Simple: Learn Contract Testing Through a Restaurant Analogy]]></title>
            <link>https://medium.com/@goelsonali/pact-testing-made-simple-learn-contract-testing-through-a-restaurant-analogy-67cc58dc9b3a?source=rss-d5dcc9399827------2</link>
            <guid isPermaLink="false">https://medium.com/p/67cc58dc9b3a</guid>
            <category><![CDATA[contract-testing-tool]]></category>
            <category><![CDATA[contract-testing]]></category>
            <category><![CDATA[pact-broker]]></category>
            <category><![CDATA[pact-testing]]></category>
            <category><![CDATA[pact]]></category>
            <dc:creator><![CDATA[sonali goel]]></dc:creator>
            <pubDate>Thu, 20 Aug 2026 22:49:51 GMT</pubDate>
            <atom:updated>2026-08-20T22:49:51.457Z</atom:updated>
            <content:encoded><![CDATA[<p>Contract testing can feel abstract when you first encounter it. Terms like consumer, provider, pact content, verification, pending, and broker sound more complicated than the idea really is.</p><p>This post explains Pact using a simple restaurant analogy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GquOiFBRzAsQpgTGRUN9Bg.png" /></figure><h3>The Restaurant Analogy</h3><p>Imagine a customer ordering food from a restaurant.</p><ul><li>The <strong>customer</strong> is the consumer.</li><li>The <strong>restaurant</strong> is the provider.</li><li>The <strong>written order</strong> is the pact.</li><li>The <strong>kitchen checking the order</strong> is provider verification.</li><li>The <strong>notice board where orders and results are stored</strong> is the Pact Broker.</li></ul><p>The customer writes down what they expect. The restaurant checks whether it can serve exactly that.</p><h3><strong>Consumer And Provider</strong></h3><p>In a system made of services, one service often depends on another.</p><p>For example:</p><pre>Checkout service calls Payment service.</pre><p>In Pact terms:</p><pre>Checkout service = consumer<br>Payment service = provider</pre><p>The consumer is the service that needs something.</p><p>The provider is the service that supplies it.</p><p>In the restaurant analogy:</p><pre>Customer = consumer<br>Restaurant = provider</pre><h3>What Is A Pact?</h3><blockquote>A pact is a written agreement created by the consumer.</blockquote><p>It says:</p><pre>When I send this request,<br>I expect this response.</pre><p>For example:</p><pre>When I ask for GET /orders/123,<br>I expect a 200 response,</pre><p>In the restaurant analogy, this is the customer writing an order card:</p><pre>Burger, no onions, chips on the side.</pre><p>The restaurant can then check whether it can fulfil that order.</p><h3>What Is Pact Content?</h3><p>Pact content is the exact detail inside the contract.</p><p>For an HTTP API, pact content may include:</p><p>-&gt; The HTTP method, The URL path, Request headers, Request body, Response status, Response headers, Response body fields.</p><p>Example pact content:</p><pre>Request:<br>GET /orders/123</pre><pre>Expected response:<br>200 OK<br>{<br>  &quot;orderId&quot;: &quot;123&quot;,<br>  &quot;status&quot;: &quot;PAID&quot;<br>}</pre><p>In the restaurant analogy, pact content is the actual wording of the order:</p><pre>Burger, no onions, chips on the side.</pre><p>If the customer changes the order to this:</p><pre>Burger, no onions, chips on the side, add ketchup.</pre><p>then the content has changed.</p><p>In Pact, when the expected request or response changes, the Pact Broker treats that as new pact content.</p><h3>What Is A Consumer Version?</h3><p>A consumer version identifies the exact version of the consumer that published the pact.</p><p>For example:</p><pre>Checkout service version abc123 published this contract.</pre><p>In the restaurant analogy, it is like the receipt number on the order card.</p><pre>Order card number: abc123</pre><p>This helps everyone know exactly which version of the customer expectation is being discussed.</p><h3>What Is The Pact Broker?</h3><p>The Pact Broker is a shared place where contracts and verification results are stored.</p><p>It answers questions like:</p><pre>Which contracts should this provider verify?<br>Has this provider already passed this contract?<br>Is this contract pending?<br>Can this consumer safely deploy?</pre><p>In the restaurant analogy, the Pact Broker is the notice board.</p><p>Customers pin their orders there. The kitchen later writes whether each order was successfully fulfilled.</p><h3>Consumer Pact Publishing</h3><blockquote>The first step is on the consumer side.</blockquote><p>The consumer runs a Pact test. That test does not call the real provider. Instead, it talks to a Pact mock server.</p><p>The mock server records the interaction and produces a pact file.</p><p>Example:</p><pre>Consumer test says:</pre><pre>When I call GET /orders/123,<br>I expect status to be PAID.</pre><p>The test passes if the consumer behaves correctly against that expectation.</p><p>After that, the pact file is published to the Pact Broker.</p><p>In the restaurant analogy:</p><pre>The customer writes the order card and pins it to the notice board.</pre><h3>Provider Verification</h3><p>Provider verification happens on the provider side.</p><p>The provider asks the Pact Broker:</p><pre>Which contracts do I need to verify?</pre><p>The Broker returns the relevant pacts.</p><p>The provider then checks each one:</p><pre>Can I return the response the consumer expects?</pre><p>Example: The pact says -</p><pre>{<br>  &quot;orderId&quot;: &quot;123&quot;,<br>  &quot;status&quot;: &quot;PAID&quot;<br>}</pre><p>The provider returns:</p><pre>{<br>  &quot;orderId&quot;: &quot;123&quot;<br>}</pre><p>The provider missed the status field, so verification fails.</p><p>In the restaurant analogy:</p><pre>The customer ordered burger, no onions, chips, and ketchup.<br>The kitchen served burger, no onions, and chips, but forgot ketchup.</pre><p>The order was not fulfilled correctly.</p><h3>Publishing Verification Results</h3><p>After provider verification, the provider publishes the result back to the Pact Broker.</p><p>The result is one of these:</p><pre>passed<br>failed</pre><p>There is no separate result called pending passed or pending failed.</p><p>Pending is a status that affects whether the provider build fails. The raw verification result is still pass or fail.</p><p>In the restaurant analogy:</p><pre>The kitchen writes on the notice board:<br>Order fulfilled successfully.</pre><p>or:</p><pre>Order was not fulfilled correctly.</pre><h3>What Is A Pending Pact?</h3><p>A pact is pending when the provider has not yet successfully verified that exact pact content for the provider branch being tested.</p><p>That sounds technical, so let us return to the restaurant.</p><p>A regular customer usually orders:</p><pre>Burger and chips.</pre><p>The kitchen has made that many times. It is a known promise. One day, the customer changes the order:</p><pre>Burger, chips, and gluten-free sauce.</pre><p>The kitchen has never successfully made that exact order before.</p><p>The restaurant says:</p><pre>This is a new request. We will try it, but we will not punish the kitchen yet<br>if it fails.</pre><p>That is pending. In Pact terms -</p><pre>The provider can fail the verification,<br>but the provider build does not fail yet.</pre><h3>Pending Does Not Mean Success</h3><p>This is the most important part.</p><p>Pending does not turn a failure into a success.</p><p>If a pending pact fails, Pact still records:</p><pre>failed</pre><p>But the provider build is allowed to stay green because the contract is new or not yet proven for that provider branch.</p><p>In the restaurant analogy:</p><pre>The kitchen forgot the gluten-free sauce.<br>The failure is recorded.<br>But because this was a new request, the kitchen is not marked as breaking an<br>existing promise yet.</pre><p>So a pending failure means:</p><pre>This is a real incompatibility,<br>but it is not blocking the provider build yet.</pre><h3>When Does Pending Stop?</h3><p>Pending stops when the provider successfully verifies the exact pact content.</p><p>In the analogy:</p><pre>The kitchen successfully makes the burger, chips, and gluten-free sauce.<br>The restaurant records that the kitchen can now handle this order.</pre><p>From that point onward, if the kitchen fails the same order again, it is a real regression.</p><p>In Pact terms:</p><pre>Once the provider publishes a successful verification for that pact content,<br>future failures of the same content on that provider branch fail the build.</pre><h3>Provider Branch Matters</h3><p>Pending is calculated for a provider branch.</p><p>For example:</p><pre>main branch<br>feature branch</pre><p>A pact may already be verified on main, but still be pending on a feature branch if that branch has not successfully verified it.</p><p>In the restaurant analogy, imagine two kitchens:</p><pre>Main kitchen<br>Training kitchen</pre><p>The main kitchen may already know how to make the order. The training kitchen still needs to prove it can make the same order.</p><p>So pending is not only about the order itself. It is about:</p><pre>order content + kitchen</pre><p>In Pact terms:</p><pre>pact content + provider branch</pre><h3>A Simple Example</h3><p>Imagine a consumer expects this response:</p><pre>{<br>  &quot;message&quot;: &quot;hello&quot;,<br>  &quot;version&quot;: 2,<br>  &quot;extraField&quot;: &quot;expected&quot;<br>}</pre><p>The provider currently returns:</p><pre>{<br>  &quot;message&quot;: &quot;hello&quot;,<br>  &quot;version&quot;: 2<br>}</pre><p>The provider is missing extraField.</p><p>If this pact content is new, the result is:</p><pre>Raw Pact result: failed<br>Pending status: pending<br>Provider build: green<br>Broker result: failed</pre><p>That means:</p><pre>The provider does not yet satisfy the new consumer expectation.<br>The failure is recorded.<br>The provider build is not blocked yet because this is pending.</pre><h3>Full Flow</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pFX2zFed05W7XwkEn2Lp9g.png" /></figure><h3>Final Thought</h3><p>Pact is not just a test tool. It is a communication tool.</p><p>It helps consumers say:</p><pre>This is what I need.</pre><p>It helps providers say:</p><pre>This is what I support.</pre><p>And it helps teams discover incompatibilities early, before they become production incidents.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67cc58dc9b3a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Design Patterns — Adapter Vs Bridge]]></title>
            <link>https://medium.com/@goelsonali/design-patterns-adapter-vs-bridge-db6d4cb9bc0e?source=rss-d5dcc9399827------2</link>
            <guid isPermaLink="false">https://medium.com/p/db6d4cb9bc0e</guid>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[design-patterns-in-java]]></category>
            <dc:creator><![CDATA[sonali goel]]></dc:creator>
            <pubDate>Fri, 27 Feb 2026 13:06:33 GMT</pubDate>
            <atom:updated>2026-02-27T13:06:33.661Z</atom:updated>
            <content:encoded><![CDATA[<p>Design patterns are the quiet superpowers of software engineering — subtle, elegant solutions that help us build systems that are flexible, scalable, and easier to maintain.</p><p>In this article would like to uncover use cases and differences of 2 structural design patterns <strong>Adapter</strong> and <strong>Bridge</strong>.</p><p>At first glance, both patterns seem to deal with connecting components and improving flexibility. But their intentions, use cases, and long‑term impact on system design are fundamentally different.</p><h3>Adapter pattern</h3><p><strong>Intent:</strong> Make an existing class work with a new interface expected by the client.</p><p><strong>Usually retrofitted</strong>: you already have one interface in use, and you introduce an adapter because something doesn’t match.</p><p><strong>Focus</strong> is on <em>compatibility</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-SaNJ026WrGQe8tQTf51fg.png" /><figcaption>Adapter Design Pattern</figcaption></figure><p>Here is the “Target Interface” expected by the client</p><pre>interface PaymentProcessor {<br>    void pay(int amount);<br>}</pre><p>New payment integration</p><pre>class StripeSDK {<br>    void makePayment(double amt) { ... }<br>}</pre><p>You cannot change:</p><ul><li>PaymentProcessor (Target)</li><li>Client code</li><li>StripeSDK</li></ul><p>So you introduce the adapter class,</p><ul><li><em>implements</em> the client-facing interface (PaymentProcessor)</li><li>And internally wraps the <strong><em>adaptee</em></strong> (the incompatible class — StripeSDK)</li></ul><pre>class StripeAdapter implements PaymentProcessor {<br>    private StripeSDK sdk = new StripeSDK();<br><br>    @Override<br>    public void pay(int amount) {<br>        sdk.makePayment((double) amount);<br>    }<br>}</pre><ul><li><strong>PayPal →</strong> calls PaymentProcessor <strong>directly</strong> via PaypalProcessor.</li><li><strong>Stripe →</strong> goes through <strong>StripeAdapter → </strong><strong>StripeSDK</strong> to match the same PaymentProcessor interface.</li></ul><h3>Bridge pattern (GoF definition)</h3><p><strong>Intent:</strong> Decouple an abstraction from its implementation so the two can vary independently.</p><p><strong>Designed-in</strong>, not just retrofitted</p><p>You have two hierarchies:</p><ol><li>Abstraction hierarchy (what clients depend on)</li><li>Implementation hierarchy (pluggable implementations)</li></ol><p>Bridge pattern in plain terms: <strong>separate “what you do” (abstraction) from “how you do it” (implementation)</strong> so you can change either independently.</p><h3>Example: Notifications (classic Bridge)</h3><p>You want to send notifications, and you might send them via Email/SMS. Also, you might have different <em>types</em> of notifications: “Alert”, “Marketing”. You don’t want a class explosion like:</p><p>EmailAlertNotification, SmsAlertNotification,</p><p>EmailMarketingNotification, SmsMarketingNotification, …</p><p>Instead you “<strong>bridge</strong>” them:</p><p><strong>Abstraction hierarchy:</strong> Notification (Alert/Marketing)</p><p><strong>Implementation hierarchy:</strong> Sender (Email/Sms)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1UrP51s_pzdwVxbKqo_N1g.png" /><figcaption>Bridge Design Pattern</figcaption></figure><pre>interface Sender {<br>    void send(String recipient, String message);<br>}<br><br>final class EmailSender implements Sender {<br>    @Override<br>    public void send(String recipient, String message) {<br>        System.out.println(&quot;EMAIL to &quot; + recipient + &quot;: &quot; + message);<br>    }<br>}<br><br>final class SmsSender implements Sender {<br>    @Override<br>    public void send(String recipient, String message) {<br>        System.out.println(&quot;SMS to &quot; + recipient + &quot;: &quot; + message);<br>    }<br>}<br><br>abstract class Notification {<br>    protected final Sender sender;<br><br>    protected Notification(Sender sender) {<br>        this.sender = sender;<br>    }<br><br>    public abstract void notify(String recipient, String message);<br>}<br><br>final class AlertNotification extends Notification {<br>    public AlertNotification(Sender sender) {<br>        super(sender);<br>    }<br><br>    @Override<br>    public void notify(String recipient, String message) {<br>        sender.send(recipient, &quot;[ALERT] &quot; + message);<br>    }<br>}<br><br>final class MarketingNotification extends Notification {<br>    public MarketingNotification(Sender sender) {<br>        super(sender);<br>    }<br><br>    @Override<br>    public void notify(String recipient, String message) {<br>        sender.send(recipient, &quot;[MARKETING] &quot; + message);<br>    }<br>}<br><br>// Usage:<br>// Notification n = new AlertNotification(new SmsSender());<br>// n.notify(&quot;12345&quot;, &quot;Price dropped!&quot;);</pre><p>the <strong>bridge is the reference held inside the abstraction</strong>:</p><p>Notification (abstraction) <em>contains</em> a Sender (implementation)</p><p>That Sender field is the “bridge” between the two hierarchies</p><p>So the “bridge” is achieved by composition (protected final Sender sender;), not by a standalone wrapper class.</p><p><strong>Conclusion</strong>: Design patterns are not just theoretical constructs — they are practical tools that help us craft systems that remain flexible even as requirements evolve. The <strong>Adapter</strong> and <strong>Bridge</strong> patterns often appear similar at first glance, but their intentions are fundamentally different.</p><p>The <strong>Adapter pattern</strong> shines when you need to <strong>integrate something new without changing existing client code.</strong></p><p>On the other hand, the <strong>Bridge pattern</strong> helps you <strong>grow systems without a combinatorial explosion of subclasses</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db6d4cb9bc0e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build Your First Mutli-Agent System with Google ADK: Tools, Code, and Fast Results]]></title>
            <link>https://medium.com/@goelsonali/build-your-first-mutli-agent-system-with-google-adk-tools-code-and-fast-results-668d4197ca29?source=rss-d5dcc9399827------2</link>
            <guid isPermaLink="false">https://medium.com/p/668d4197ca29</guid>
            <category><![CDATA[adkhackathon]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[google-adk]]></category>
            <category><![CDATA[multi-agent-systems]]></category>
            <dc:creator><![CDATA[sonali goel]]></dc:creator>
            <pubDate>Sat, 21 Jun 2025 18:07:51 GMT</pubDate>
            <atom:updated>2025-06-21T18:07:51.619Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E14U8AMjCcXXZak8S6ZR5A.png" /><figcaption>Building AI Agents with Google ADK</figcaption></figure><p>If you’ve been following the buzz around AI agents, you’ve probably heard of <strong>Google’s Agent Development Kit (ADK)</strong> — their answer to making agent-based development as smooth as butter on warm toast.</p><p>In this post, we’ll walk through:</p><ul><li>What Google ADK actually is (in plain and slightly nerdy terms),</li><li>Why it matters (and what problems it solves),</li><li>The significance of <strong>Tools</strong> and <strong>Agent Tools</strong>,</li><li>And finally — how <em>you</em> can build your first multi-agent ADK agent project from scratch.</li></ul><p>Let’s dive in!</p><h4>What is Google ADK?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/128/1*CD7K0ESEVB2BFiVLLv85_Q.png" /></figure><p>Agent Development Kit (ADK) is a flexible and modular framework for <strong>developing and deploying AI agents</strong>. ADK has been designed to make agent development feel more like software development, to make it easier for developers to create, deploy, and orchestrate agentic architectures.</p><blockquote>Think of ADK as giving your AI both a brain and a toolbox — you define what tools it can use, what goals it should achieve, and how it should reason, all in a developer-friendly way.</blockquote><p>The first place to start learning about google adk is <a href="https://google.github.io/adk-docs/#what-is-agent-development-kit">here</a></p><h4>What problems does it solve ?</h4><p>Building AI agents isn’t new — but doing it <em>right</em>, <em>modularly</em>, and <em>scalably</em> has always been a challenge. That’s where <strong>Google ADK</strong> changes the game.</p><p>Here’s <em>why it matters</em>:</p><ol><li><strong>Modularity That Makes Sense</strong> — ADK encourages <strong>separation of concerns</strong>. You don’t hardcode logic or behaviors — instead, you define reusable tools and let the agent reason when and how to use them.</li><li><strong>Tool-Driven Thinking — </strong>ADK flips the script: instead of teaching your agent <em>what</em> to do, you provide it with <strong>tools and descriptions</strong>, and the agent figures out <strong>how to achieve the goal</strong> using those tools.<br><strong><em>It’s not a script. It’s a </em>strategy engine<em>.</em></strong></li><li><strong>Built for Goal-Oriented Agents-</strong> ADK isn’t just about task completion — it’s about <strong>goal reasoning</strong>. Your agent isn’t blindly executing steps. It’s planning, choosing actions, and using tools. I strongly felt this when running my agents with minimum details yet so impactful results.</li></ol><h4>Tools and Agent Tools: What’s the Deal?</h4><p>🧰 Tools: The Unsung Heroes of AI Agent Development</p><p>Since AI agents stepped onto the scene, <strong>tools have become the backbone of their capabilities</strong>. Tools are how agents interact with the world — whether it’s querying a database, calling an API, or calculating a formula. They transform static models into dynamic, goal-driven systems.</p><ul><li>A Tool can be anything: a Google API, a database, a calendar service, or a custom Python function you write.</li><li>Tools are <em>declarative</em>. You define them and describe what they do — the agent learns to use them when needed.</li></ul><h3>Types of Tools in ADK (What Your Agent Can Use)</h3><p>ADK supports different kinds of tools to keep your agents flexible and powerful:</p><ul><li><strong>Function Tools</strong> — Your own custom functions, written in Python, that handle specific tasks. The most common way to create tools and give access to your agent.</li><li><strong>Agents-as-Tools</strong> — You can plug one agent into another, letting a parent agent delegate tasks to a specialized “sub-agent” only as a tool.</li><li><strong>Long-Running Tools</strong> — For operations that take time (like API calls or heavy computations), ADK handles them asynchronously.</li><li><strong>Built-in Tools</strong> — Out-of-the-box helpers like Google Search, code execution, or RAG (Retrieval-Augmented Generation).</li><li><strong>Third-Party Tools</strong> — Easily integrate with popular frameworks like LangChain or CrewAI.</li></ul><h3>🛠️ Setting Up: Your Mutli-Agent ADK Project</h3><h4>1. 🔧 Prerequisites</h4><p>Make sure you’ve got:</p><ul><li>Python 3.13 ( If you extend you solution to use FastMcp library),</li><li>A virtual environment (venv),</li><li>Git</li></ul><h4>2. 📁 Project Structure &lt;your project_directory&gt;</h4><p>Let’s set up a minimal ADK agent that uses a sub agent and the subagent uses tool for reasoning and responding.</p><p>Create a project folder like :</p><pre>student_multi_agent_system/<br>├── tools/<br>|   └── __init__.py<br>│   └── search.py<br>├── subagent/<br>│   └── resources/<br>|       └── __init__.py <br>|       └── agent.py<br>│   └── chat/<br>|       └── __init__.py <br>|       └── agent.py<br>└── __init__.py<br>└── agent.py<br>└── .env</pre><p>3. 🔨 Creating Your First Tool (Using existing google search in-built tool)</p><p><strong>search.py</strong> is the tool — an agent tool using <strong>google_search</strong> in-built tool provided in the google adk package</p><pre>&quot;&quot;&quot;Wrapper to Google Search Grounding with custom prompt.&quot;&quot;&quot;<br><br>from google.adk.agents import Agent<br>from google.adk.tools.agent_tool import AgentTool<br>from google.adk.tools.google_search_tool import google_search<br><br>MODEL_GEMINI_2_0_FLASH = &quot;gemini-2.0-flash&quot;<br><br>_search_agent = Agent(<br>    model=MODEL_GEMINI_2_0_FLASH,<br>    name=&quot;google_search_grounding&quot;,<br>    description=&quot;An agent providing Google-search grounding capability&quot;,<br>    instruction=&quot;&quot;&quot;,<br>    Answer the user&#39;s question directly using google_search grounding tool; Provide a brief but concise response. <br>    Rather than a detail response, provide the actionable item for a user to the users&#39;s query.<br>    &quot;&quot;&quot;,<br>    tools=[google_search],<br>)<br><br>google_search_grounding = AgentTool(agent=_search_agent)</pre><p>4. 🧠 Building a Student Support Multi Agent System</p><ul><li>Define your system architecture how you want your agents to interact<br>example —</li></ul><pre>+-----------------------------+<br>|         root_agent          |  (student_multi_agent_system/agent.py)<br>|-----------------------------|<br>| LlmAgent                    |<br>| - Coordinates flow          |<br>| - Delegates to subagents    |<br>| - Subagent: chat_agent      |<br>+-------------+---------------+<br>              |<br>              v<br>+-----------------------------+<br>|         chat_agent          |  (student_multi_agent_system/subagent/chat/agent.py)<br>|-----------------------------|<br>| LlmAgent                    |<br>| - Handles student queries   |<br>| - Delegates resource reqs   |<br>| - Subagent: resources_agent |<br>| - Uses CHAT_AGENT_PROMPT    |<br>+-------------+---------------+<br>              |<br>              v<br>+-----------------------------+<br>|       resources_agent       |  (student_multi_agent_system/subagent/resources/agent.py)<br>|-----------------------------|<br>| Agent                       |<br>| - Finds online resources    |<br>| - Uses RESOURCE_AGENT_INST. |<br>| - Tool: google_search_grounding<br>+-------------+---------------+<br>              |<br>              v<br>+-----------------------------+<br>|   google_search_grounding   |  (student_multi_agent_system/tools/search.py)<br>|-----------------------------|<br>| AgentTool                   |<br>| - Wraps google_search tool  |<br>| - Custom search prompt      |<br>+-----------------------------+</pre><p>Here, the code snippet for your <strong>root_agent (agent.py)</strong></p><pre><br>import os<br>from google.adk.agents import LlmAgent<br>from dotenv import load_dotenv<br>from .subagent.chat.agent import chat_agent<br><br># Load environment variables from .env file<br>load_dotenv()<br><br>GOOGLE_API_KEY = os.environ.get(&#39;GOOGLE_API_KEY&#39;)<br><br># More supported models can be referenced here: https://ai.google.dev/gemini-api/docs/models#model-variations<br>MODEL_GEMINI_2_0_FLASH = &quot;gemini-2.0-flash&quot;<br><br>root_agent = LlmAgent(<br>    model=MODEL_GEMINI_2_0_FLASH,<br>    name=&quot;root_agent&quot;,<br>    description=&quot;An agent that coordinates the flow of information and delegates tasks to specialized subagents in a student support system.&quot;,<br>    sub_agents=[chat_agent]<br>)</pre><p>and your <strong>chat_agent </strong>(subagent/chat/agent.py)</p><pre>&quot;&quot;&quot;Chat Agent in a student support system that provides answers and delegates subagents.&quot;&quot;&quot;<br>from google.adk.agents import LlmAgent<br>from dotenv import load_dotenv<br>from . import prompt<br>from student_multi_agent_system.subagent.resources.agent import resources_agent<br><br>MODEL_GEMINI_2_0_FLASH = &quot;gemini-2.0-flash&quot;<br><br>chat_agent = LlmAgent(<br>    model=MODEL_GEMINI_2_0_FLASH,<br>    name=&quot;chat_agent&quot;,<br>    description=&quot;A chat agent that responds to user queries by coordinating with specialized subagents for various tasks in a student support system.&quot;,<br>    instruction=prompt.CHAT_AGENT_PROMPT,<br>    sub_agents=[resources_agent]<br>)</pre><p>and the <strong>resource_agent</strong> (subagent/resources/agent.py)</p><pre>&quot;&quot;&quot;Resource Agent in a student support system that searches Google for relevant resources.&quot;&quot;&quot;<br><br>from google.adk.agents import Agent<br>from . import prompt<br>from student_multi_agent_system.tools.search import google_search_grounding<br><br>MODEL_GEMINI_2_0_FLASH = &quot;gemini-2.0-flash&quot;<br><br><br>resources_agent = Agent(<br>    model=MODEL_GEMINI_2_0_FLASH,<br>    name=&quot;resources_agent&quot;,<br>    description=&quot;Given some text, search Google for the most relevant, trustworthy, and helpful online resources (such as articles, guides, or tools) in response to the user&#39;s query.&quot;,<br>    instruction=prompt.RESOURCE_AGENT_INSTRUCTION,<br>    tools=[google_search_grounding]<br>)</pre><p>Once, all your agents are configured with all the necessary instructions ( also considered as prompts) you are ready to run your first multi-agent adk based system.</p><p>Result would look something like this (after running the multi-agent locally with the command : <strong>adk web </strong>)—</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TrtiMnu3XnpvPf4lpKk-mQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s0q3sjexJxMh7EhOtqgLWQ.png" /></figure><h3>🧪 What’s Next?</h3><p>You’ve built your first Multi-agent system with ADK . Congrats!</p><p>Here’s how you can level up:</p><ul><li>Add more tools (e.g., database, file I/O, data summarization),</li><li>Build custom reasoning loops,</li><li>Integrate with other third-party agents.</li></ul><h3>🏁 Final Thoughts</h3><p>Google’s ADK marks a shift toward <em>modular agent architecture</em> — where you define the tools, and let your AI figure out how to use them. It’s elegant, developer-friendly, and opens the door for truly flexible AI agents.</p><p>If you’re serious about building smart, adaptable agents, <strong>ADK is absolutely worth exploring.</strong></p><p>Reference Github repository — <a href="https://github.com/goelsonali/First-adk-agent">https://github.com/goelsonali/First-adk-agent</a> (Give a star if you find useful)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=668d4197ca29" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Prompt Engineering with the P.A.T.T.E.R.N. Framework]]></title>
            <link>https://medium.com/@goelsonali/mastering-prompt-engineering-with-the-p-a-t-t-e-r-n-framework-273e873d8bf1?source=rss-d5dcc9399827------2</link>
            <guid isPermaLink="false">https://medium.com/p/273e873d8bf1</guid>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[prompt]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[google-adk]]></category>
            <category><![CDATA[framework]]></category>
            <dc:creator><![CDATA[sonali goel]]></dc:creator>
            <pubDate>Fri, 06 Jun 2025 15:21:42 GMT</pubDate>
            <atom:updated>2025-06-06T15:21:42.818Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EV-sggfTladwZ9ZtXHPCkA.png" /></figure><p><em>Harnessing the power of well-crafted prompts to unlock the full potential of AI</em></p><h3>🔍 Introduction</h3><p>In the age of generative AI, how you <strong>talk to AI models</strong> matters as much as what you ask them. Whether you’re developing chatbots, interactive learning tools, or content generators, crafting clear, contextual prompts can make or break your results.</p><p><strong>P.A.T.T.E.R.N. Framework</strong> — a powerful methodology I use to structure prompts that are not only effective but also adaptable to real-world applications. In this guide, we’ll explore each component of the framework and examine how one can put to use— along with visual diagrams and real-world case studies .</p><h3>🧭 The P.A.T.T.E.R.N. Framework</h3><blockquote><strong><em>P.A.T.T.E.R.N.</em></strong><em> = Purpose, Audience, Tone, Task, Examples, Refinement, Nuance</em></blockquote><p>Each component of the P.A.T.T.E.R.N. Framework contributes to greater <strong>clarity</strong>, <strong>context</strong>, and <strong>control</strong> when working with different AI models.</p><h3>🎯 Purpose — Define the Goal</h3><p>Every prompt should start with a <strong>clear intention</strong>. Are you asking for a story, a summary, or an explanation?</p><p><strong>📝 Example Prompt:</strong></p><blockquote>“Write a short story about a robot <strong>discovering emotions</strong>.”</blockquote><p><strong>✅ Why it works:</strong> It sets a clear narrative task.</p><h3>🧑‍🏫 Audience — Know Who You’re Talking To</h3><p>Adjusting your prompt for the intended audience ensures relevancy and clarity.</p><p><strong>📝 Example Prompt:</strong></p><blockquote>“Explain how rainbows are formed in a way that a <strong>5-year-old</strong> can understand.”</blockquote><p><strong>✅ Why it works:</strong> Simplifies scientific knowledge for young learners.</p><h3>🎭 Tone — Set the Mood</h3><p>The tone sets the emotional and stylistic expectation for the AI’s output.</p><p><strong>📝 Example Prompt:</strong></p><blockquote>“Describe a day in the life of a cat with a <strong>funny twist</strong>.”</blockquote><p><strong>✅ Why it works:</strong> Informs the AI to generate content that’s humorous and creative.</p><h3>🛠 Task — Be Specific About What You Want</h3><p>The more specific your task, the better the AI performs.</p><p><strong>📝 Example Prompt:</strong></p><blockquote>“<strong>Summarize the key points</strong> of the latest tech conference in 100 words.”</blockquote><p><strong>✅ Why it works:</strong> Clear about both the <strong>content</strong> and <strong>format</strong>.</p><h3>🧩 Examples — Show the Desired Format</h3><p>Use <strong>few-shot prompting</strong> to show the AI what you’re aiming for.</p><p><strong>📝 Example Prompt:</strong></p><blockquote>“Create analogies to explain blockchain technology. For example, ‘Blockchain is like a digital ledger where transactions are recorded.’”</blockquote><p><strong>✅ Why it works:</strong> Gives both structure and conceptual context.</p><h3>🔁 Refinement — Iterate and Improve</h3><p>Great prompts are rarely born perfect. Iterate based on output.</p><p><strong>Before:</strong></p><blockquote>“Explain quantum computing.”</blockquote><p><strong>After:</strong></p><blockquote>“Explain quantum computing in simple terms using an analogy.”</blockquote><p><strong>✅ Why it works:</strong> Refines the goal and clarifies the expected tone.</p><h3>🎨 Nuance — Add Depth and Context</h3><p>Advanced prompts benefit from contextual cues that direct AI toward richer, more relevant output.</p><p><strong>📝 Example Prompt:</strong></p><blockquote>“In the context of climate change, explain the greenhouse effect.”</blockquote><p><strong>✅ Why it works:</strong> Adds <strong>scope</strong> and <strong>focus</strong> to avoid ambiguity.</p><h3>🧮 Prompt Design Patterns</h3><p>Beyond P.A.T.T.E.R.N., experienced prompt engineers use <strong>design patterns</strong> for specific use cases. Here are six powerful ones:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mxl8v-t8CZOqcX8zB9UNJA.png" /><figcaption>Prompt design patterns</figcaption></figure><h3>💼 Case Study: Building an AI App with P.A.T.T.E.R.N.</h3><h3>🎠 P.A.T.T.E.R.N. Framework in Action</h3><h3>Case Study: Children’s Storytelling App</h3><p><em>A team successfully implemented the P.A.T.T.E.R.N. Framework to create an engaging storytelling app for children aged 5–10.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yj8AEgbOGMNgIrmGeg17kA.png" /></figure><blockquote><strong>Prompt Example</strong> : <br>You are a magical storyteller creating bedtime stories for children aged 5–10.</blockquote><blockquote><strong>PURPOSE</strong>: Generate a complete, age-appropriate short story that will engage young listeners and help them wind down for sleep.</blockquote><blockquote><strong>AUDIENCE</strong>: Children ages 5–10 — use simple vocabulary, relatable characters, and concepts they can easily understand.</blockquote><blockquote><strong>TONE</strong>: Keep it fun, friendly, and imaginative. Use a warm, gentle voice that feels like a caring adult telling a story.</blockquote><blockquote><strong>TASK</strong>: Create a 3–4 minute bedtime story (approximately 300–400 words) with:<br>- Clear beginning, middle, and end<br>- Simple conflict that gets resolved<br>- Vivid but calming imagery</blockquote><blockquote><strong>EXAMPLES</strong>: Structure it like classic formats children love:<br>- Fairy tale: “Once upon a time…” with magical elements<br>- Fable: Animal characters learning important lessons<br>- Adventure: Friendly quest with a happy ending</blockquote><blockquote><strong>REFINEMENT</strong>: After generating, check that the story:<br>- Uses vocabulary appropriate for ages 5–10<br>- Has a gentle, non-scary conflict<br>- Ends on a peaceful, satisfying note</blockquote><blockquote><strong>NUANCE</strong>: Weave in positive values naturally:<br>- Friendship and helping others<br>- Being brave when facing challenges <br>- Showing kindness to all creatures</blockquote><blockquote><strong>Theme for tonight’s story</strong>: A little fox who learns that asking for help is brave, not weak.</blockquote><h3>🏆 Conclusion</h3><p>Prompt engineering isn’t just about giving instructions to AI — it’s about <strong>designing conversations</strong> with structure, creativity, and intent.</p><p>By mastering the <strong>P.A.T.T.E.R.N. Framework</strong> and learning common design patterns, you can significantly enhance the output quality of your AI powered Apps or your interaction with AI tools.</p><p>Whether you’re a developer, content creator, or educator, <strong>prompt literacy</strong> is now a competitive advantage.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=273e873d8bf1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[First System Design Interview: A Guide to Success]]></title>
            <link>https://medium.com/@goelsonali/first-system-design-interview-a-guide-to-success-66e484fbd4be?source=rss-d5dcc9399827------2</link>
            <guid isPermaLink="false">https://medium.com/p/66e484fbd4be</guid>
            <category><![CDATA[technical-interview]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[senior-developer]]></category>
            <dc:creator><![CDATA[sonali goel]]></dc:creator>
            <pubDate>Sat, 07 Dec 2024 11:58:30 GMT</pubDate>
            <atom:updated>2024-12-07T11:58:30.829Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QwxHM2MT4csTbkVwgbEnFA.png" /></figure><p>Breaking into system design interviews can be intimidating, especially if it’s your first time. These interviews evaluate your ability to design scalable, maintainable, and robust systems — skills vital for mid to senior-level roles in software engineering. This guide will walk you through the fundamentals, preparation strategies, and tips for acing your first system design interview.</p><p><strong>Key goals of the interview include:</strong></p><ul><li>Evaluating how well you understand trade-offs between different system components.</li><li>Understanding your ability to balance scalability, reliability, and cost-effectiveness.</li><li>Testing your problem-solving approach and communication skills.</li></ul><blockquote><strong>System Design and LEGO: A Perfect Analogy</strong><br>Designing a system is like building a structure using LEGO pieces. Each piece represents a component or a technology, and together, they form a cohesive, functional system.</blockquote><h3><strong>How To Prepare For System Design Interview ?</strong></h3><h4><strong>Create Your Own Framework</strong></h4><p>Having a structured approach to tackle system design problems is critical. A framework not only ensures you cover all necessary aspects but also demonstrates a clear thought process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4p4OfEccO1YbP-9c1xJ2eA.png" /></figure><p>( Do share your interesting acronyms in the comments)</p><h4><strong>Key Areas To Cover</strong></h4><ul><li><strong>Architecture Components<br>What to Focus On</strong>: Essential components such as databases, caching, APIs, load balancers, and microservices.<br><strong>Tip</strong>: Choose the right data storage solution based on the use case (e.g., SQL for structured data vs. NoSQL for unstructured or high-volume data). Opt for an efficient caching mechanism like Redis or Memcached to enhance performance.</li><li><strong>Data Flow<br>What to Focus On</strong>: Understand and define how data moves through the system, from the client to backend services and databases.<br><strong>Tip</strong>: Number each step of the data flow and use arrows to visualize the interactions clearly. This will help you and the interviewer align on the system’s workflow.</li><li><strong>Scalability<br>What to Focus On</strong>: Design for horizontal and vertical scalability to handle increasing traffic or data loads.<br><strong>Tip</strong>: Incorporate a load balancer to distribute traffic effectively and consider an API gateway to manage requests efficiently in high-traffic scenarios.</li><li><strong>Fault Tolerance<br>What to Focus On</strong>: Build systems resilient to failures, ensuring they degrade gracefully and recover quickly.<br><strong>Tip</strong>: Implement retry and timeout mechanisms for failed requests. Use message queues like RabbitMQ or Kafka to handle asynchronous processing and prevent data loss during failures.</li><li><strong>Monitoring and Logging<br>What to Focus On</strong>: Include tools and strategies for monitoring performance (e.g., latency, throughput) and analyzing logs for debugging and auditing.<br><strong>Tip</strong>: Familiarize yourself with monitoring and logging tools like AWS CloudWatch, Grafana, and Kibana. Mentioning these tools shows practical knowledge of observability in large systems.</li></ul><h4>Practice and Mock Interviews</h4><ul><li><strong>Mock Interviews</strong>: <br>- Watch mock system design interview videos on platforms like Exponent or Interviewing.io to understand real-world scenarios.<br>- Practice with tools like ChatGPT for guidance or with peers to simulate the interview environment.</li><li><strong>Popular Problems To Try</strong>:<br>- Design an <strong>E-commerce store</strong> to understand catalog management, order processing, and scaling.<br>- Design a <strong>ticket-booking system</strong> to explore real-time updates and concurrency.<br>- Design a <strong>URL-shortening application</strong> to practice hashing, database management, and scalability.</li><li><strong>Learn to Communicate</strong>: <br>- Use ChatGPT to practice initial problems and refine your thought process.<br>- Record your mock interviews to identify gaps and areas for improvement, focusing on clarity and organization.</li></ul><h3>The Day Of The Actual Interview</h3><ul><li><strong>Start Strong</strong>: Spend time to clarify the problem statement. (Use your framework)</li><li><strong>Think Aloud</strong>: Engage the interviewer by walking them through your thought process.</li><li><strong>Handle Feedback Gracefully</strong>: Be open to suggestions or corrections. And do not hesitate to make amendements to your design.</li><li><strong>Time Management</strong>: Allocate time wisely for each stage of the problem.</li><li><strong>Stay Calm</strong>: Focus on problem-solving even if you’re unfamiliar with specific details. Start simple do not overthink about the design.</li></ul><h3>Embrace The Journey</h3><p>Embarking on your first system design interview is a valuable learning experience, no matter the outcome. Mastery in system design comes with consistent practice, thoughtful reflection, and embracing failures as opportunities to grow. Treat each interview as a stepping stone in your journey to becoming a better problem-solver.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66e484fbd4be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[T for Terraform — Begineer’s Guide]]></title>
            <link>https://medium.com/@goelsonali/t-for-terraform-begineers-guide-3e9171bffd68?source=rss-d5dcc9399827------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e9171bffd68</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[iac]]></category>
            <category><![CDATA[beginner]]></category>
            <dc:creator><![CDATA[sonali goel]]></dc:creator>
            <pubDate>Fri, 19 Jul 2024 07:02:21 GMT</pubDate>
            <atom:updated>2024-07-19T07:02:21.858Z</atom:updated>
            <content:encoded><![CDATA[<h3>T for Terraform — Begineer’s Guide</h3><h3><strong>Why learn about Terraform?</strong></h3><p>If you work with cloud technologies and are curious about the term ‘Infrastructure as Code,’ then a good place to start is with Terraform. Additionally, if you are working on a service or tool that has its own Terraform provider for resource provisioning, it is beneficial to have a basic understanding of Terraform ( ex — Rundeck).</p><blockquote><strong>While Terraform does have its own syntax and configuration language for defining infrastructure, it primarily functions as a tool for managing and provisioning infrastructure resources across various cloud providers and services.</strong></blockquote><p>Terraform creates and manages resources on cloud platforms and other services through their application programming interfaces (APIs). Providers enable Terraform to work with virtually any platform or service with an accessible API.</p><p>Here, you can see at a high level where Terraform fits in provisioning any resources. These resources can be cloud resources, which are the most popular, or they can be any service as well, such as Rundeck to provision jobs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kr78X5pJZLGIKvutK_14jA.png" /><figcaption>Resource provisioning via terraform</figcaption></figure><p>Some key components of terraform are defined below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PTpkBjNXyqFU1G7f3A9mrw.png" /><figcaption>Components of terraform</figcaption></figure><ol><li><strong>Configuration Files</strong> :<br>These are written in HashiCorp Configuration Language (HCL) or JSON and describe the desired state of your infrastructure.<br>( all the .tf files are the configuration files)</li><li><strong>Providers</strong> :<br>Terraform provider acts as an interface between Terraform and the APIs of various infrastructure platforms, Saas-Service, allowing Terraform to create, update, and delete resources within those platforms.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lzhcQoUhvTocn_Sz6tOsCw.png" /><figcaption>Providers task</figcaption></figure><p>3. <strong>State :<br></strong>A file that Terraform uses to map resources in the configuration files to the real-world resources. It holds critical information about the infrastructure managed by Terraform like — Resource Metadata, Resource Attributes, Relationship/dependencies between the resources, Provider Information, Output Values defined in the configuration files as outputs, Module information, State version ( for compatibility with terraform version).</p><p>4. Modules:<br>Reusable configurations that can be called multiple times with different parameters.</p><h3>How to make it work ?</h3><p>Let’s mention a bit about the <strong>“Terraform Workflow”</strong>, one of the most interesting and exciting aspects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LGE7-VfcGIqtDkeas71zfg.png" /><figcaption>Terraform workflow</figcaption></figure><p>Once all the configuration is written which provider to use, which resource to provision then follow this workflow to actually spin up the resource.</p><ol><li><strong>Initialize</strong>: Prepare the working directory and download necessary providers with terraform init.</li><li><strong>Validate</strong> (optional): Ensures that the terraform configurations (*.tf ) are syntactically correct. Also validates that all referenced variables, modules, resources, and data sources are defined within the configuration terraform validate.</li><li><strong>Plan</strong>: Preview the changes that will be made to the infrastructure with terraform plan. Think of the plan phase in Terraform as a staged preview of changes to your actual resources, based on your configuration.</li><li><strong>Apply</strong>: Execute the changes to reach the desired state with terraform apply. And once this is successful the resources would be provisioned on the respective cloud environment or service tool.</li><li><strong>Destroy </strong>(optional): Remove the infrastructure managed by Terraform with terraform destroy . If the resource is no longer required then with help of this command the resource can be removed/deleted from the respective cloud environment or service tool. ( Use it with caution, only perform for the resources not required any more)</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e9171bffd68" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mentoring for Change: Empowering Engineers for future]]></title>
            <link>https://medium.com/@goelsonali/mentoring-for-change-empowering-engineers-for-future-4ebb6513710c?source=rss-d5dcc9399827------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ebb6513710c</guid>
            <category><![CDATA[guidance]]></category>
            <category><![CDATA[mentorship]]></category>
            <category><![CDATA[future-engineer]]></category>
            <category><![CDATA[future]]></category>
            <dc:creator><![CDATA[sonali goel]]></dc:creator>
            <pubDate>Sun, 23 Jun 2024 23:32:38 GMT</pubDate>
            <atom:updated>2024-06-24T21:30:56.147Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oicb8lu1r8yn70SnJT44Rw.jpeg" /></figure><blockquote>“Imagine the impact we could have if every experienced engineer dedicate just a small part of their time to mentoring the next generation.”</blockquote><p>I joined an amazing group called Women Who Code London, now known as <a href="https://womencodingcommunity.com/">Women Coding Community</a>, where I was introduced to the world of mentorship.</p><p>Enrolling in the program completely changed my perspective towards mentorship. Despite being a 12+ year experienced engineer, I had struggled to find guidance throughout my career.</p><p>When I met my first mentor, I was overwhelmed with gratitude. I couldn’t believe someone was willing to give me their precious time. I expressed my thanks repeatedly during our call and continued to do so in my mind long after.</p><blockquote>Through this mentorship, I learned to reflect deeply, discovering my ikigai.</blockquote><p>At the beginning of this year, I felt confident enough to become a mentor myself, eager to share my knowledge and guide others.</p><p>This journey has been transformative, shaping me into a remarkable human and a leader.</p><p>That’s why I want to share the <strong><em>power of mentorship</em></strong> through this writing — to inspire others to seek out and embrace the profound impact that mentorship can have on their personal and professional lives.</p><p>Let’s start with defining some key terminology here -</p><h3>Mentorship vs Coaching</h3><p><strong><em>Mentorship</em></strong> typically focused on long-term personal and professional growth.</p><p><strong><em>Coaching</em></strong> is typically aimed at achieving specific, short-term goals or improving specific skills.</p><p>Now, highlighting some key differences -</p><p><strong>Bonding </strong>— Mentoprship is more of an informal approach to the mentor and mentee’s relationship where a lot depends on mentor’s experience and advice, whereas Coaching is more structured and facilitative, with the coach guiding the coachee to find their own solutions.</p><p><strong>Style</strong> — Mentors share their knowledge and experiences, providing guidance to help mentees sail through the waters of their career paths successfully, while Coaches employ questioning, listening and feedback techniques to promote self-discovery and self-improvement.</p><h3>Importance of Mentorship in Engineering</h3><p>Mentorship is a two-way street: both mentor and mentee benefit from this journey. It isn’t just about guiding someone else. It’s about growing together, learning from each other, and enhancing our collective engineering capabilities.</p><p>Mentorship is a combination of 3G’s</p><p><strong>Giving</strong> — Back to your community, where you have gain your experience and support it is a way to extend your thanks to the community.</p><p><strong>Guiding</strong> — Guiding your future generation , helping them recognising their potential and strengths.</p><p><strong>Growing</strong> — Growing as a leader/ a better engineer and as a better human. ( You will unlock your own potentials which were unknown to you )</p><h3>How to Become a Transformative Mentor ?</h3><p>4 step process to guide you -<br>1. <strong>Understand your mentee’s goals.</strong> The first step in effective mentoring is to deeply understand what your mentee aims to achieve. This involves asking insightful questions and listening carefully.</p><p><strong>2. Set clear, achievable goals together.</strong> Once you understand your mentee’s aspirations, collaborate to set clear, achievable goals that align with their vision. Try aligning them with SMART goals framework.</p><p><strong>3. Maintain open and honest communication.</strong> Effective communication is crucial for a successful mentoring relationship. Encourage your mentee to share their challenges and successes openly.</p><p><strong>4. Provide ongoing support and celebrate successes.</strong> Support your mentee continuously by offering resources, advice, and encouragement. Celebrate their achievements.</p><blockquote>When mentoring, it’s crucial to listen more than you speak. Understand your mentee’s aspirations and fears, and guide them with empathy.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ebb6513710c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>