<?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 GyeongSeon (Sunny) Park on Medium]]></title>
        <description><![CDATA[Stories by GyeongSeon (Sunny) Park on Medium]]></description>
        <link>https://medium.com/@gngsn?source=rss-c4661bee7a84------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*OQ18kCXappOpSD051KMmtw.jpeg</url>
            <title>Stories by GyeongSeon (Sunny) Park on Medium</title>
            <link>https://medium.com/@gngsn?source=rss-c4661bee7a84------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 09:01:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gngsn/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[CMUX x AIM Hackathon Seoul - Shortify: Turn knowledge into short-form videos for faster learning]]></title>
            <link>https://medium.com/@gngsn/cmux-x-aim-hackathon-seoul-shortify-turn-knowledge-into-short-form-videos-for-faster-learning-aa4da73fd141?source=rss-c4661bee7a84------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa4da73fd141</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[hackathons]]></category>
            <dc:creator><![CDATA[GyeongSeon (Sunny) Park]]></dc:creator>
            <pubDate>Sat, 11 Jul 2026 14:40:28 GMT</pubDate>
            <atom:updated>2026-07-11T14:47:07.210Z</atom:updated>
            <content:encoded><![CDATA[<p>April 26th, 2026<br>CMUX x AIM Hackathon opened from 8AM to 8PM.</p><p>More than 300 AI enthusiasts gathered in one place.<br>The purpose of ours was only one — <br>Build something cool with AI 🤖<br>Just because it’s fun 😎.</p><p>Let me share what I built, <br>how the system worked, <br>what I struggled, <br>and what I learned from building an AI-native product <br>in one hackathon day.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ny8awmgGsHtlTnpD.png" /></figure><h3>What I built</h3><p>What my team built is Shortify:<br><a href="https://github.com/mindful-labs-ai/shortify.git">🔗 Shortify Github</a></p><h4>ㅤ</h4><h4>📹<strong> Shortify</strong></h4><blockquote>Turn knowledge into short-form videos for faster learning</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iFEoZxQuYzHRbxF3.jpg" /></figure><p>Let’s be honest, we all end up sticking to short videos like YouTube Shorts or Instagram Reels. It’s hard to deny that short beats long these days.</p><p>Our idea started by flipping that phenomenon around:<br><em>Utilizing it in an educational way, taking in the facts.</em></p><p>So the application we built is an education platform that produces short-form videos based on the chapters a user picks from a document’s table of contents.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FlKUFuptfiQM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DlKUFuptfiQM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FlKUFuptfiQM%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d0b3b066e1bdd81fd04f0e2620671f64/href">https://medium.com/media/d0b3b066e1bdd81fd04f0e2620671f64/href</a></iframe><p>📚 PDFs are where knowledge often lives such as Textbooks or Research papers. But it’s usually dense.</p><p>📼 Short-form videos are easy to start, easy to watch, easy to share.<br>But it’s shallow. They usually do not teach deeply.</p><p>So we took the strength of each:<br><em>Keep the density of the source.<br>Borrow the accessibility of short-form video.</em></p><p>In other words, <strong>turn long-form knowledge into short-form learning</strong>.<br>Not just summary, A learning unit.<strong><br></strong>One chapter → One concept → One short video 📹.</p><h4>ㅤ</h4><h3>How it works</h3><p>Drop a PDF 📚<br>→ Choose the chapters 📑<br>→ Generate short learning videos 📹.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MC5uLUqHnZTUvsYUlGt5LA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g1wi2880aJ-fFNRQ0GU1Ag.png" /></figure><p>The user faces a simple UI, but there’s a complicated flow inside — each AI call in the chain feeds the next, and producing images and video takes a long time. So I built a stage tracker to record exactly where a job currently stood, plus a progress bar so the user can see their request is actually moving.</p><blockquote><strong>🧠 Process: PDF → Chapter → Script → Visual → Video</strong></blockquote><p>Here is the actual flow:</p><pre>PDF<br>└─&gt; TOC extraction<br>└─&gt; chapter selection<br>└─&gt; concept planning<br>└─&gt; scene direction<br>└─&gt; image concept<br>└─&gt; video generation<br>└─&gt; narration<br>└─&gt; alignment<br>└─&gt; final vertical video</pre><h4>ㅤ</h4><h3>Challenges</h3><p>There were several challenges:</p><h4><strong>🧠 Which LLM model suits each stage</strong></h4><p>Each LLM generally has its own specialty — some are tuned for image generation, others for audio. Since the hackathon sponsor provided Gemini credits, we standardized on Gemini for every stage, but split by model per purpose:</p><ul><li>General text: models/gemini-3.1-flash-lite-preview</li><li>Image generation (T2I): models/gemini-3.1-flash-image-preview</li><li>Video generation (I2V): models/veo-3.1-fast-generate-preview</li><li>Speech synthesis (TTS): models/gemini-3.1-flash-tts-preview</li><li>Audio alignment: models/gemini-3.1-flash-lite-preview</li></ul><h4>ㅤ</h4><h4><strong>💥 How it tolerates failures</strong></h4><p>A single job is a sequential chain. One concept fans out into multiple images, a script per image, and a final composition into one video. Every step depends on the one before it.</p><p>The user’s request has to go through, even if one step in the middle fails.<br>So I decided to track each step as a checkpoint, and retry from that exact step instead of starting over.</p><p>ㅤ</p><h4><strong>🔁 How we set retry strategy</strong></h4><p>Retry strategy mattered a lot here, since a single job strings together several sequential API calls and one failure downstream shouldn’t force redoing everything upstream. Too many retries add overhead, so instead of retrying immediately we backed off with increasing delay between attempts.</p><p>ㅤ</p><h4><strong>⛓️ How images, narration, and music line up in time</strong></h4><p>One concept produces multiple images, and those images get composed into a single video together with narration generated from a separate call. That means the pipeline has to merge exact timing between each image and its narration segment — the alignment and rhythm_cut stages exist specifically to solve that sync problem.</p><h4>ㅤ</h4><h3><strong>🧪 The Build Pattern: Spec-First, Agent-Driven</strong></h3><p>A few months ago, I wrote about <a href="https://medium.com/@gngsn/ralphthon-seoul-no-human-hands-on-the-keyboard-049fe2daf839">Ralphthon and the idea that humans direct while AI accelerates</a>.</p><p>This hackathon tested that idea with stakes.<br>The pattern was simple:</p><p>✅ Write the product idea clearly<br>✅ Keep every decision current in the wiki the AI reads as context<br>✅ Split each execution step into visible boundaries<br>✅ Let AI surface open questions before locking in a critical decision<br>✅ Verify the result after every step finishes</p><p>The key idea is:</p><p><em>Spec documents became the product before the product existed.<br></em>The documents came first, then the code came later.</p><h4>ㅤ</h4><h3><strong>🎯 Strategies I’d Repeat</strong></h3><h4><strong>🦴 Walking Skeleton</strong></h4><p>My first goal was not perfection, but a full path.<br>From uploading a knowledge document,</p><p>through every stage, to returning an output — <br>I wanted to <strong>run the whole cycle first</strong>.<br>Even if some parts were stubs, the skeleton had to stand.</p><p>That way the app kept working end-to-end at every point, and the code could evolve stage by stage. A broken feature is easier to fix than a missing path.</p><h4>ㅤ</h4><h4><strong>🔍 Glass Box Debugging</strong></h4><p>Looking back at how I’d build any AI product now,<br>the very first thing I did was set up tracing for every AI call.</p><p>AI systems fail in unexpected ways — <br>the prompt can be wrong, or the response can come back malformed.</p><p>Before wiring up the first LLM call, I built a small observability layer:<br>an ai_traces table in the database,<br>logging on every request to and from the LLM,<br>and a monitoring dashboard on top of it.</p><p>This observability layer fully separate from the production code.</p><h4>ㅤ</h4><h4><strong>🔁 Stage-Cached Retry</strong></h4><p>I was genuinely happy that a test could resume from exactly the stage I wanted — I didn’t want to burn time re-running the whole pipeline every time. Even though image and video generation took ages, testing itself stayed fast.</p><p>Image generation and Video pipelines are expensive. It takes long time and drains tokens. So if Stage 6 fails, it should not rerun Stages 1 through 5. One of the better decisions was setting up a fast, cheap test environment.</p><p>Each stage needs a durable output.<br>A retry should continue from the closest valid checkpoint.</p><p><strong>Test</strong> fast, <strong>fix</strong> fast, and <strong>retry</strong> fast.</p><h4>ㅤ</h4><h4><strong>🛠️ What I Struggled — Characters kept drifting off-model.</strong></h4><p>The image concepts included a recurring mascot and a small cast of narrator characters, and the early scenes weren’t consistent — the same character came out looking different from shot to shot.</p><p>Instead of guessing, I traced it through the `ai_traces` table and the monitoring dashboard: first checking whether reference images were even being attached to the prompt.</p><p>And they weren’t — the reference path was silently breaking.</p><p>After I fixed it, the model still drifted — so I strengthened the prompt to treat the reference image as identity, not style. Having the trace data on hand turned guessing into something I could actually diagnose.</p><h4>ㅤ</h4><h3><strong>💡 What I Learned</strong></h3><h4><strong>✔️ AI Products Need Checkpoints</strong></h4><p>Full automation sounds elegant, but it’s not the answer.<br>That matters — and so does the ability to correct course quickly when something drifts.</p><p>Both reduce expensive mistakes. The lesson is not to slow the user down, but to place control where it matters.</p><p>ㅤ</p><h4><strong>✔️Backpressure Is the Whole Point</strong></h4><p>AI can generate a lot of code.<br>That is not the hard part anymore.<br>The hard part is knowing when the code is wrong.</p><p>It’s better to catch the wrong direction as early as possible — right after each small, split-out step finishes, not after the whole thing is done.</p><p>With backpressure, AI speed becomes leverage.</p><h4>ㅤ</h4><h4><strong>✔️ Humans Move Up a Layer</strong></h4><p>Stop typing. Start thinking.<br>Humans have to think about how the project scales through better system design.</p><p>The bottleneck was not typing speed but clarity. What should exist, and what should be removed?</p><p>How do you turn a business requirement into a clear specification? What should the AI never guess?</p><p>ㅤ</p><h3><strong>🏆 The Demo Moment</strong></h3><p>Shortify had a working product flow — drop a PDF, extract chapters, pick what to generate, choose a visual concept, watch the job progress, open the final video.</p><p>The judges’ and participants’ reaction was the line every hackathon team wants to hear: <em>You built this in 12 hours?</em></p><p>Shortify went on to <strong>win the Business Track at CMUX x AIM Intelligence Hackathon Seoul</strong>.</p><p>ㅤ</p><h3><strong>🔮 What I Would Improve Next</strong></h3><p>Shortify works as a hackathon product.</p><p>But the next version needs deeper polish.</p><p><strong>✅ Draw clearer role boundaries between engineers.</strong></p><p>Since this was an intense, time-limited project, I tried to split development work with another developer — it wasn’t easy. Too many steps felt like they had to run sequentially.</p><p><strong>✅ Token efficiency.</strong></p><p>We used Claude for both coding and design. It drains tokens really quickly — we ended up upgrading our payment plan and eating the extra cost. That won’t scale in a real product environment.</p><p><strong><em>🎬 Closing</em></strong></p><p>AI moves engineering upward.<br>From typing to directing.<br>From implementation to orchestration.<br>From code generation to system design.</p><p>When the system is clear, AI can move fast.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa4da73fd141" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Switch Any LLM Without Touching Your Code: OpenChat Playground]]></title>
            <link>https://medium.com/@gngsn/switch-any-llm-without-touching-your-code-openchat-playground-33b1cddc9f26?source=rss-c4661bee7a84------2</link>
            <guid isPermaLink="false">https://medium.com/p/33b1cddc9f26</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[GyeongSeon (Sunny) Park]]></dc:creator>
            <pubDate>Sun, 12 Apr 2026 05:42:23 GMT</pubDate>
            <atom:updated>2026-04-12T13:26:54.599Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s a period of rapid AI/LLM change.<br>New models have been dropping fast.</p><p>Developers are busy trying to catch up with the latest one.</p><p>ㅤ</p><blockquote>Yesterday, it was Gemini 2.5.<br>Today, it’s Claude Opus 4.6.</blockquote><blockquote>Tomorrow — who knows.</blockquote><p>ㅤㅤ<br>Switching LLM providers sounds simple as a concept.<br>But that’s never as simple as it sounds<br>— We need to learn new APIs, implement new SDKs, test, and deploy.</p><p>So, I’ll share an open-source project, <br>which we built to solve this problem:<br>Switching between any LLM provider with zero code changes.</p><p>You end up with one interface to talk to any model,<br>finding why you need this in a project with multiple LLM providers.</p><p>ㅤ</p><h3>⚡<strong> </strong>Keeping Up With the AI Race</h3><p>We want to build an AI application.</p><p>But the ecosystem is shifting fast,<br>every frontier model that’s released,<br>and actually it looks better than the last one.</p><p>If you look at <a href="https://artificialanalysis.ai/">Artificial Analysis</a> benchmarks, <br>models are catching up to each other, trading the lead like a relay race.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QhJNnRTwLQXVqdchF8htuA.png" /></figure><p>ㅤ</p><p>OpenAI led the early stages,<br>but now Anthropic, Google, and others have caught up.</p><p>They scramble to outdo each other with new releases.</p><p>ㅤ</p><h4><strong>Software Developers’ Pain</strong></h4><p>Imagine you’re working on an app:</p><blockquote>You’re running Claude today.<br>Gemini drops a model with better reasoning tomorrow.<br>You want to switch.</blockquote><blockquote>But each provider has its own API.<br>Its own SDK.<br>Its own authentication flow.</blockquote><p>Switching means learning, implementing, testing, deploying<br>— for every single provider.</p><p>That’s a lot of engineering hours for what should be a configuration change. And when multiple developers face the same problem, that’s wasted effort and time multiplied.</p><p>ㅤ</p><h4><strong>🧠 OpenChat Playground — One Interface, Any Model</strong></h4><blockquote>OpenChat Playground (OCP)<br>: an open-source project built on ASP.NET Core.</blockquote><p>OpenChat Playground lets you interact with any LLM through a unified web UI. You can swap models without changing a single line of code.</p><p>ㅤ</p><p><strong>✔️ Zero-Code Switching.</strong></p><p>Think of it like a universal power adapter. Different countries have different plugs — but with the right adapter, your device works everywhere. OpenChat Playground does the same for LLMs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gpH6wX7WL4lCDK_saUczbA.png" /></figure><p>OpenChat Playground is the strip that connects them all through <strong>one standardized API</strong>. Your project only needs one socket — plug into OpenChat Playground, and every LLM is reachable.</p><p>ㅤ</p><h4><strong>What It Supports</strong></h4><p>Each provider’s authentication and API quirks are already handled inside OpenChat Playground.</p><p>You don’t touch any of that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*P7BVd650KKuTMBE8.png" /></figure><p><strong>Cloud MaaS (Model as a Service):<br></strong>- Amazon Bedrock<br>- Azure AI Foundry<br>- Github Models<br>- Google Vertex AI</p><p><strong>Local Models:<br></strong>- Docker Model Runner<br>- Foundry Local<br>- HuggingFace<br>- Ollama</p><p><strong>Direct Providers:<br></strong>- Anthropic Claude<br>- LG EXAONE<br>- OpenAI GPT<br>- Upstage Solar</p><p>ㅤ</p><h3><strong>How You Start</strong></h3><p>You can run OpenChat Playground by setting ConnectorType and then run it. ㅤ</p><h4><strong>How You Switch</strong></h4><p>Three configuration methods — pick one:</p><p>✅ <a href="https://github.com/aliencube/open-chat-playground/blob/main/src/OpenChat.PlaygroundApp/appsettings.json"><strong>appsettings.json</strong></a>— change the ConnectorType value.</p><pre>{<br>  ...<br>  &quot;ConnectorType&quot;: &quot;GitHubModels&quot;,<br><br>  &quot;AmazonBedrock&quot;: {<br>    &quot;AccessKeyId&quot;: &quot;{{AMAZON_BEDROCK_ACCESS_KEY_ID}}&quot;,<br>    &quot;SecretAccessKey&quot;: &quot;{{AMAZON_BEDROCK_SECRET_ACCESS_KEY}}&quot;,<br>    &quot;Region&quot;: &quot;{{AMAZON_BEDROCK_REGION}}&quot;,<br>    &quot;ModelId&quot;: &quot;amazon.nova-micro-v1:0&quot;<br>  },<br><br>  &quot;AzureAIFoundry&quot;: {<br>    &quot;Endpoint&quot;: &quot;{{AZURE_AI_FOUNDRY_ENDPOINT}}&quot;,<br>    &quot;ApiKey&quot;: &quot;{{AZURE_AI_FOUNDRY_API_KEY}}&quot;,<br>    &quot;DeploymentName&quot;: &quot;gpt-4o-mini&quot;<br>  },<br><br>  ...<br>}</pre><p>Then run docker run. <br>That’s it!</p><p>ㅤ</p><p>✅ <strong>Environment variable</strong> — set it at deploy time.</p><pre># Linux / macOS<br>export CONNECTOR_TYPE=OpenAI<br><br># Windows<br>set CONNECTOR_TYPE=OpenAI</pre><p>Same with appsettings.json, run docker run after setting it.</p><p>ㅤ</p><p>✅ <strong>Command-line argument</strong> — pass it at launch.</p><pre>dotnet run –– --connector-type OpenAI</pre><p>|</p><p>It’ll apply Command-line args &gt; Environment variable &gt; appsettings.json in sequence.</p><p>Just update the config and restart.<br>That’s all.</p><p>No code change. <br>No redeployment of business logic.</p><p>ㅤ</p><h4><strong>🛠️ The Secret: Microsoft.Extensions.AI</strong></h4><p>Here’s what makes this simple configuration work.</p><p>OpenChat Playground uses <a href="https://learn.microsoft.com/en-us/dotnet/ai/ai-extensions">Microsoft.Extensions.AI</a> (MEAI) — a standard abstraction library from Microsoft that unifies LLM interactions behind a single interface.</p><p>The key interface is IChatClient.</p><pre>namespace Microsoft.Extensions.AI;<br>public interface IChatClient : IDisposable<br>{<br>    Task&lt;ChatResponse&gt; GetResponseAsync(<br>        IEnumerable&lt;ChatMessage&gt; messages,<br>        ChatOptions? options = null,<br>        CancellationToken cancellationToken = default);<br><br>    IAsyncEnumerable&lt;ChatResponseUpdate&gt; GetStreamingResponseAsync(<br>        IEnumerable&lt;ChatMessage&gt; messages,<br>        ChatOptions? options = null,<br>        CancellationToken cancellationToken = default);<br><br>    object? GetService(Type serviceType, object? serviceKey = null);<br>}</pre><p>It exposes two methods:<br>- GetResponseAsync— for single-shot responses<br>- GetStreamingResponseAsync— for streaming responses</p><p>Every provider — OpenAI, Anthropic, Bedrock, Ollama — implements this same interface.</p><p>In other words, your application code talks to IChatClient.<br>It never knows (or cares) which provider is behind it.</p><p>ㅤ</p><h3><strong>🏁 Architecture: From Web UI to LLM</strong></h3><p>OpenChat Playground uses the <strong>Factory Template Pattern</strong> to wire everything together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MalcnIZxpBN8pEyNnQCa0g.png" /></figure><p>Here’s how it flows:</p><pre>appsettings.json<br>                              │<br>                    ┌─────────┴─────────┐<br>                    │  ConnectorType =   │<br>                    │  &quot;GitHubModels&quot;    │<br>                    └─────────┬─────────┘<br>                              │<br>                              ▼<br>                ┌──────────────────────────────┐<br>               │   LanguageModelConnector      │<br>               │   (abstract base class)       │<br>               │   - validation                │<br>               │   - option building           │<br>               │   - common config             │<br>                └──────────────┬───────────────┘<br>                               │  creates<br>          ┌──────────┬─────────┼───────────┬──────────┐<br>          ▼          ▼         ▼           ▼          ▼<br>     ┌─────────┐┌─────────┐┌─────────┐┌─────────┐┌─────────┐<br>     │ OpenAI  ││  Azure  ││ AWS     ││  Ollama ││ GitHub  │<br>     │Connector││Connector││Connector││Connector││Connector│<br>     └───┬─────┘└────┬────┘└──┬──────┘└────┬────┘└────┬────┘<br>         │           │        │            │          │<br>         └─────┬─────┴────┬───┴───┬────────┘          │<br>               │          │       │                   │<br>               └──────────┴────┬──┴───────────────────┘<br>                               │<br>                               ▼<br>                        ┌─────────────┐<br>                        │ IChatClient │  ◄── one unified interface<br>                        └──────┬──────┘<br>                               │<br>                               ▼<br>                        ┌─────────────┐<br>                        │ ChatService │  ◄── knows nothing about the provider<br>                        └──────┬──────┘<br>                               │<br>                               ▼<br>                          User (Web UI / API / Console)</pre><ol><li>An abstract class LanguageModelConnector holds the shared logic — validation, option building, common configuration.</li></ol><p>2. Each provider has a concrete connector that creates the actual IChatClient implementation</p><p>3. At startup, the configured ConnectorType determines which connector gets injected</p><p>4. The ChatService calls IChatClient — completely unaware of the provider behind it</p><p>5. The response stream flows back to the user</p><p>ㅤ</p><p>The Web UI isn’t the only entry point.</p><p>OpenChat Playground also exposes <strong>a</strong> <strong>backend API</strong> (/api/chat/responses) and <strong>a console app</strong>.<br>It means you can plug it into mobile, desktop, or any HTTP client.</p><p>ㅤ</p><h3><strong>🤔 Isn’t This Already Solved?</strong></h3><p>Hasn’t anyone tried this before?</p><p>Yes, there are great services out there.</p><p>ㅤ</p><p><strong>✔️ Open WebUI</strong></p><p><a href="https://openwebui.com/"><strong>Open WebUI</strong></a> is a local AI platform that gives you a unified interface to interact with multiple LLMs. It gives you an interface to work with multiple LLMs right on your machine.</p><p>Open WebUI focuses on its web UI experience — which is great — but it doesn’t expose an API. So if you want to integrate it into your own app or backend, that’s not an option yet.</p><p>ㅤ</p><p><strong>✔️ OpenRouter</strong></p><p><a href="https://openrouter.ai/"><strong>OpenRouter</strong></a> lets you access various LLM providers through a single API gateway.</p><p>OpenRouter is convenient.<br>One API gateway to access dozens of providers.</p><p>OpenRouter does offer an API, but it’s a paid service. For open-source projects or quick experiments, that can be a hurdle.</p><p>|</p><p>Both are solid.<br>Both have their own strengths.</p><p>That said, as I explored them for my own use cases,<br>I noticed a few things I wished were different.</p><p>ㅤ</p><p><strong>✔️ What OpenChat Playground Adds to the Mix</strong></p><p>OpenChat Playground fills a different niche:</p><ul><li><strong>Standardized API: </strong>same endpoint, same request/response format, regardless of the model behind it.</li><li><strong>Open source</strong>: read the code, modify it, extend it however you want.</li><li><strong>Web UI</strong>: interact with any supported model through a built-in interface.</li><li><strong>Wide model support</strong>: connects to many LLM providers out of the box.</li></ul><p>You get both a ready-to-use web UI and a flexible API.<br>No need to choose one or the other.</p><p>The API support is especially useful.<br>It means you’re not limited to <strong>OpenChat Playground</strong>’s web UI.</p><p>Build your own frontend, <br>call it from a mobile app, <br>or integrate it into an existing backend.</p><p>I’ll cover the API in more detail later in this post.</p><p>ㅤ</p><h3><strong>💡 Why This Matters</strong></h3><p><strong>✔️ Rapid Model Adoption<br></strong>A new model drops today. You can test it in your environment tomorrow — no SDK integration sprint needed.</p><p><strong>✔️ No Vendor Lock-In<br></strong>If OpenAI goes down, you just switch to Anthropic with a config change. Service continuity. It’s maintainable.</p><p><strong>✔️ A/B Testing Made Easy<br></strong>Same prompt, different models, one UI.<br>Compare outputs side by side and pick the winner.</p><p><strong>✔️ Cost Optimization<br></strong>Not every task needs the most expensive model. Route simple queries to lighter models — save budget for the hard problems.</p><p>ㅤ</p><h3><strong>🔗 What’s Next</strong></h3><p>OpenChat Playground is actively evolving.<br>Here’s what’s on the roadmap:</p><p>- <strong>Hot-swapping:</strong> switch LLMs at runtime without restart<br>- <strong>Aspire orchestration</strong>: managed multi-service deployment<br>- <strong>MCP server support: </strong>plug into the Model Context Protocol ecosystem</p><p>And it’s open source — contributions welcome.</p><blockquote>Tools will keep changing.<br>But the pattern of abstracting away the provider — that endures.</blockquote><p>ㅤ</p><h3><strong>🎬 Closing</strong></h3><p>The LLM landscape moves fast.<br>New models, new providers, new benchmarks — every month.</p><p>OpenChat Playground doesn’t bet on one model.<br>It bets on the pattern: <strong>one interface, any provider, zero code changes.</strong></p><p>That simplicity is what makes it reliable.</p><blockquote>“Make the things that change easy to change.”</blockquote><p>The models will keep changing.<br>The abstraction is what stays. 🔄</p><p>ㅤ</p><p><strong>Reference.</strong></p><ul><li><a href="https://github.com/aliencube/open-chat-playground">OpenChat Playground — GitHub</a></li><li><a href="https://learn.microsoft.com/en-us/dotnet/ai/ai-extensions">Microsoft.Extensions.AI Documentation</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aEthvu9JsB2w1E_N" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33b1cddc9f26" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ralphthon @Seoul: No Human Hands on the Keyboard ]]></title>
            <link>https://medium.com/@gngsn/ralphthon-seoul-no-human-hands-on-the-keyboard-049fe2daf839?source=rss-c4661bee7a84------2</link>
            <guid isPermaLink="false">https://medium.com/p/049fe2daf839</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[seoul]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[GyeongSeon (Sunny) Park]]></dc:creator>
            <pubDate>Mon, 06 Apr 2026 04:04:16 GMT</pubDate>
            <atom:updated>2026-04-06T11:48:20.896Z</atom:updated>
            <content:encoded><![CDATA[<p>Last Sunday, March 29th, <br>the second Ralphthon Seoul took place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MM4ikdhXSvHzLD8nin9wqg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*5gJOfX6TKyyO6OL7HCwJTg.jpeg" /></figure><p>From 9am to 9pm, <br>teams competed to build the best AI agent that can autonomously write code.<br>— No human hands on the keyboard. 👥⌨️🚫<br>ㅤ</p><blockquote>Ralphthon = Ralph + Hackathon</blockquote><p>Human just wait while Ralph working during the whole Hackathon.<br>Meaning .. human just fool around the most of time.</p><p>Let me share what Ralph is, how the event worked, and what I learned.</p><p>ㅤ</p><h3><strong>🤔 Ralph?</strong></h3><p>Ralph is a technique for AI-assisted coding.<br>The name inspired by the Simpsons character Ralph Wiggum.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kvDuR1ljPTp5KuZ9hV53wQ.jpeg" /></figure><p>The concept is simple:</p><blockquote>Loop your prompt until you get the result you want, <br>starting a fresh session with clear context for each iteration.</blockquote><pre>while :; do cat PROMPT.md | claude-code ; done</pre><p>A bash while loop 🔁.<br>That’s all.</p><p>ㅤ</p><blockquote>Ralph is very good at making playgrounds, but he comes home bruised because he fell off the slide, so one then tunes Ralph by adding a sign next to the slide saying “SLIDE DOWN, DON’T JUMP, LOOK AROUND,” and Ralph is more likely to look and see the sign.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*d254pwU0lSm1rM-N" /><figcaption><a href="https://www.reddit.com/r/TheSimpsons/comments/1aj7zqe/this_is_my_swing_set_this_is_my_sandbox_im_not/">https://www.reddit.com/r/TheSimpsons/comments/1aj7zqe/this_is_my_swing_set_this_is_my_sandbox_im_not/</a></figcaption></figure><blockquote>Eventually all Ralph thinks about is the signs so that’s when you get a new Ralph that doesn’t feel defective like Ralph, at all.</blockquote><blockquote>- 🔗 <a href="https://ghuntley.com/ralph/">Geoff’s blog</a></blockquote><h3>ㅤ</h3><h3><strong>🧠 Why Ralph? The Context Problem</strong></h3><p>Here’s the problem Ralph solves: <strong>too much context</strong>.<strong><br></strong>When conversation history piles up, AI coding agents <strong>lose focus</strong>.</p><p>The model’s performance degrades.<br>Adding more questions to an already-bloated session makes things worse, not better.</p><p>Ralph’s answer is kinda radical: <br>Throw away the context, keep the code. <br>🗑️ ➡️ 💾️ ➡️ 🗑️ ➡️ 💾</p><pre>  ┌─────────────────────────────────────────────────────┐<br>  │                   while :; do                       │<br>  │                                                     │<br>  │   ┌───────────┐    ┌──────────────┐    ┌────────┐  │<br>  │   │ Read      │───▶│ Explore      │───▶│Implement│  │<br>  │   │ PROMPT.md │    │ Codebase     │    │One Task │  │<br>  │   └───────────┘    └──────────────┘    └────┬───┘  │<br>  │                                             │       │<br>  │        ┌────────────────────────────────────┘       │<br>  │        ▼                                            │<br>  │   ┌──────────┐    ┌──────────────┐                  │<br>  │   │ Run Tests│───▶│  Terminate   │──── ♻️ ──┐       │<br>  │   │ &amp; Build  │    │  (exit)      │          │       │<br>  │   └──────────┘    └──────────────┘          │       │<br>  │                                             │       │<br>  │   Context is lost ❌                        │       │<br>  │   Files remain on disk ✅                   │       │<br>  │   ┌─────────────────────────────────────────┘       │<br>  │   │  New session starts with fresh context          │<br>  │   └─────────────────────────────────────────────┐   │<br>  │                                                 │   │<br>  └─────────────────────────────────────────────────┘   │<br>                        ▲                               │<br>                        └───────────────────────────────┘</pre><p>At the end of each loop, the agent terminates.<br>The conversation history is gone, but the code remains on disk.</p><p>The next session reads PROMPT.md, <br>explores the codebase with fresh eyes,<br>picks the most important task, <br>implements it, <br>and terminates.</p><p>The loop starts again.</p><p><strong>Ralph tunes itself over time<br>— fresh context, but always the latest codebase.</strong></p><p>Each iteration builds on the accumulated code while avoiding the accumulated confusion.</p><p>ㅤ</p><h3><strong>🏁 Ralphthon</strong></h3><p>The core rule is clear:<br><strong>humans do not code directly. AI agents do.</strong></p><p>The outcome isn’t determined by coding skills,<br>but by <strong>agent orchestration skills</strong>.</p><p>The moment you can’t touch your laptop,<br>it reveals how well your agent is set up.</p><p>Prompt design, task decomposition, agent pipeline configuration<br>— all these preparations determine the agent’s autonomous capability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZZKtCmjtVY0W6rcz11adbw.png" /></figure><h4>ㅤ</h4><h4><strong>🦞 The Lobster Suit Rule</strong></h4><p>Participants can’t touch their laptop while the agent is working.<br>If they absolutely must intervene, they have to <strong>wear a lobster suit.<br></strong>— a playful penalty that signals “a human stepped in.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VG-8OjkMbgReJRQgeYHPjg.png" /></figure><h4>ㅤㅤ</h4><h4><strong>🛠️ What I Built</strong></h4><p>My team built <strong>crayfish-farm(</strong> <a href="https://github.com/mindful-labs-ai/crayfish-farm"><strong>🔗 Github</strong></a><strong>).<br></strong>— a farm growing your lovely crayfish(lobsters), <br>each crayfish is a Claude Code agent.</p><p><strong>Code while raising crayfish</strong><br>Crayfish Farm is a virtual farm living in your menu bar and terminal.<br>One agent, one crayfish. <br>Give it work and it eats, grows, and levels up.</p><p>Neglect it and it starves, dropping levels!<br>As a farm owner, keeping your crayfish healthy means you naturally keep working.</p><p>Sessions are discovered automatically via filesystem watching.<br>Each crawfish levels up based on token usage, and tokens decay when sessions go idle<br>— so the farm always reflects what’s actually alive and active.</p><p>ㅤ<br>We built two interfaces:</p><h4><strong>🍎 Mac Menu Bar Widget</strong></h4><p>An Electron-powered tray app themed as a farm: <br>Sky with drifting clouds, red barn with silo, wooden fences, a pond with shimmer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KVubGmEbyl6qxA9XBykd-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wnI4Mye6LKehMEroybi5dA.png" /></figure><p>Crawfish positioned on green pasture, animated per state:</p><p>- 🔨 <strong>Working </strong>→ bounce animation<br>- 🌾 <strong>Idle</strong> → gentle sway<br>- 💤 <strong>Sleeping</strong> → breathe + zZZ</p><p>Click any crawfish for an info card with sprite, state, level, and session summary.</p><p>Press d and all crawfish dance for 3 seconds 💃🏻</p><p>ㅤ</p><h4><strong>🖥️ TUI Dashboard</strong></h4><p>Animated ASCII crawfish sprites rendered per session,<br>2-column card layout with level bars, activity summaries, and token delta tracking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3naRrldXcP5pC2cQ.png" /></figure><p>ㅤ</p><h4><strong>🏃 Built in One Run</strong></h4><p>Okay so, did it all get built autonomously?</p><p><strong>*Yes* </strong>😎</p><p>We put real effort into the specs, task decomposition, and prompt design to make sure the agent could build it in one run — and it did.</p><p>ㅤ</p><p><strong>What we did for running it just once?</strong></p><p><strong>✅ Set the first Rule</strong></p><blockquote>Rule #1: DO NOT ASK ANY QUESTIONS. For any decision not covered in SPEC.md, choose the most popular/standard approach and proceed immediately. This prompt is designed for a single autonomous run that produces a complete, working project.</blockquote><p><strong>✅ Remove ambiguity from the spec</strong></p><p>After producing a PLAN.md with AI, we reviewed it and found some vague parts. for example, if AI suggested multiple ways to build features, we picked one and clarified it in the prompt.</p><p><strong>✅ Pin the tech stack</strong></p><p>We specified the tech stack (Python, TUI with Rich, Electron for menu bar) in the prompt to prevent the agent from exploring other options.</p><p><strong>✅ Uploaded assets</strong></p><p>We provided the agent with assets (crawfish sprites, background images) upfront to the S3 and made sure it can be public accessed to avoid it asking local file questions for no reason.</p><p>ㅤㅤ</p><h3><strong>💡 What I Took Away</strong></h3><p>I kept thinking: <strong>how would this hold up in real life?</strong></p><p>Writing specifications well,<br>Setting up prompts correctly,<br>And designing backpressure (tests and builds) effectively.</p><p>It’s about the meta-layer of coding, not coding itself.</p><h4><strong>It’s a technique, not a tool</strong></h4><p>Before the event, I thought Ralph was a specific tool or framework.<br>It’s not. It’s a technique.<br>— A way of thinking about how to structure AI-assisted work.</p><p>Geoffrey’s spent years in C, manually calling malloc and free. The idea of Ralph started from what he was used to doing — managing memory.<br>: allocate a full context window, spend it on one task, free it completely, start fresh.</p><p>What I realized is the upfront work matters even more:</p><h4>✔️ <strong>Trust the AI, but own the outcome</strong></h4><p>Even when the AI makes mistakes, you have to believe in eventual consistency. Don’t be afraid of breaking the codebase. Don’t blame the model — suspect the prompt first, fix it, and iterate.</p><h4>ㅤ<br><strong>✔️ Separate “planning” from “execution”</strong></h4><p>Let the AI learn and grow across loops by recording lessons and bugs in fix_plan.md. That’s how Ralph takes himself to university.</p><h4>ㅤ<br>✔️ <strong>Build a smart playground for the AI</strong></h4><p><strong>Specs become the product.</strong> Ralph reads `specs/` and `fix_plan.md` every loop to decide what to do. If those are vague, Ralph drifts. In a hackathon you can rescue it.</p><p><strong>Backpressure is non-negotiable</strong>. Type systems, static analyzers, security scanners — use all of them as backpressure.</p><p>Code generation → tests → build → pass. <br>Only then does the next loop begin.</p><p>If you don’t set up these guardrails — tests, type checkers, linters — the AI will produce garbage and you won’t catch it until it’s too late. Backpressure isn’t optional. It’s the whole point.</p><h4>ㅤ<br>✔️ <strong>Know when not to use it</strong></h4><p>Tools are great only when they’re used for the right job.</p><p>I don’t think Ralph is good for an existing project or a codebase split across many services and concerns.</p><p>Ralph is good for the new Monolithic.<br>Deliberately monolithic — a single process, a single repository, a single task per loop.</p><p>It scales vertically, not horizontally.<br>That simplicity is what makes it reliable.</p><p>Developers need to step away from the act of “coding” itself and move up to a higher-level role — designing and automating the entire development process. That’s the shift Ralph is pointing at.</p><p>ㅤ</p><h4><strong>🤝 3. The people</strong></h4><p>Hackathons are high-energy and compressed.<br>You can eyeball the output, throw in a human intervention, steer things back on track.</p><p>The participants I met shared a common energy — eager to learn, eager to share, all sensing that something big is shifting in how we build software. It’s still vague. But everyone in that room knew it was coming, and wanted to be ready.</p><p>ㅤ</p><h3><strong>🎬 Closing</strong></h3><p>The AI landscape moves fast. It’s not worth trying to master every new tool. But it is worth understanding the core ideas behind them — because the tools will change, but the patterns endure.</p><p>Ralph is one such pattern: when context becomes a burden, start fresh. Let the code be the memory. Keep the loops tight and the specs clear.</p><p>Geoffrey Huntley puts it best:</p><blockquote><strong>The beauty of Ralph is that it is deterministically bad in an indeterministic world.</strong></blockquote><p>And that predictable imperfection, iterated enough times, converges on something surprisingly good. 🔄✨</p><p>ㅤ<br><strong>Reference.<br></strong><a href="https://ghuntley.com/ralph/">Ralph Wiggum as a “software engineer”</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=049fe2daf839" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Flexible and Scalable Notification System: Design and Implementation]]></title>
            <link>https://blog.devops.dev/building-a-flexible-and-scalable-notification-system-design-and-implementation-eef601f22518?source=rss-c4661bee7a84------2</link>
            <guid isPermaLink="false">https://medium.com/p/eef601f22518</guid>
            <category><![CDATA[notifications]]></category>
            <category><![CDATA[notification-service]]></category>
            <category><![CDATA[design-systems]]></category>
            <dc:creator><![CDATA[GyeongSeon (Sunny) Park]]></dc:creator>
            <pubDate>Sat, 15 Mar 2025 07:06:18 GMT</pubDate>
            <atom:updated>2025-04-05T01:26:34.543Z</atom:updated>
            <content:encoded><![CDATA[<p>Designing a notification system is an interesting architectural challenge. It is a fundamental feature of all modern web and mobile applications, required across different programming languages and technologies. While it can be implemented simply, designing an enterprise-level notification system requires careful consideration of specific requirements, development constraints, and cost factors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H6doHWMylMSsZ7C-AfstFw.png" /></figure><p>I developed a flexible notification system that is simple yet meets business requirements using a macro-like schema. It’s been working well with — 130K for 8 minutes</p><p>In this article, I’ll walk you through its design and implementation. Feedback and comments are always welcome!</p><p>Let’s start by analyzing the requirements.</p><h3>Functional Requirements</h3><ul><li><strong>Scheduling</strong>: Send notifications based on predefined conditions and schedules.</li><li><strong>Targeting</strong>: Deliver notifications to specific users according to their preferences and settings.</li><li><strong>Triggering</strong>: Generate notifications when certain conditions are met.</li></ul><h3>Non-Functional Requirements</h3><ul><li><strong>Pluggability:</strong> Add new features with minimal changes to the system.</li><li><strong>High Availability</strong>:<strong> </strong>Ensure at least 99.99% uptime.</li><li><strong>Timeliness</strong>: Guarantee notification delivery within a defined time frame.</li><li><strong>Deduplication</strong>: Prevent duplicate notifications to ensure exactly-once delivery.<br> — <strong><em>Example</em></strong><em>: If the system fails in the middle of processing a notification, it must resume from the failure point. Similarly, if an administrator accidentally clicks the send button twice, duplicate emails must be avoided.</em></li><li><strong>Auditing</strong>: Maintain logs of sent notifications, including timestamps and recipients.</li><li><strong>Low Latency</strong> : Optimize delivery speed to ensure notifications reach users as quickly as possible.</li></ul><h3>Scale Estimation</h3><p>Before designing the system, I estimated its scale to inform architectural decisions. The notification system has been tested to send <strong>60,000–130,000 notifications to nearly 30,000 users simultaneously</strong>, maintaining stability and efficiency.</p><h3>System Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aUddsNLbcA-3i38zdjP5Pw.png" /></figure><p>Let’s say there’s a need to send notifications for meeting room reservations. First, we write a target query to extract the meeting rooms scheduled to start within a certain time window. Then, we write a user target query to retrieve the users involved in those meetings. Notifications can be sent 10 or 15 minutes before the meeting starts, since the system checks for pending notifications every 5 minutes using a cron expression defined in the schedule field.</p><h3>1. Scheduler</h3><p>The scheduler handles various types of notifications:</p><ul><li><strong>Time-Based Notifications</strong>: Sent at a predefined time or interval (e.g., daily summaries, weekly reports, or maintenance alerts).</li><li><strong>Event-Based Notifications</strong>: Triggered by specific events or actions (e.g., password resets, order status updates, or user registration).</li><li><strong>User-Triggered Notifications</strong>: Initiated directly by user actions (e.g., submitting a form, liking a post, or sending a message).</li></ul><p>While the focus is on scheduled notifications, the system is flexible and can be extended for other types.</p><p>The scheduler continuously checks for pending notifications. This check can occur every 5 or 30 minutes, but it doesn’t require a dedicated scheduler — just a continuously running server.</p><p>Each notification is scheduled using crontab, allowing administrators to define when notifications should be sent. This approach ensures notifications are handled only at their scheduled times, preventing overload at once.</p><h3>2. Generator</h3><p>The <strong>Generator</strong> is responsible for:</p><ul><li>Retrieving all active notifications and processing them in chunks of size N.</li><li>Creating UMS requests with payloads and enqueueing them in the NotificationQueue.</li></ul><h4><strong>2.1 Rule-Based Notification System</strong></h4><p>The <strong>Notification Manifest</strong> acts as a catalog of notification rules, containing metadata such as the <strong>Name</strong>, <strong>UUID</strong>, <strong>Schedule</strong>, <strong>SQL query</strong> (for dynamically generating notifications), and other relevant data.</p><p>This structure ensures a centralized and manageable way to define all notification rules.</p><p><strong>Example</strong>:</p><pre>[<br>  {<br>    &quot;version&quot;: &quot;1.0&quot;,<br>    &quot;name&quot;: &quot;Meeting Reminder&quot;,<br>    &quot;uuid&quot;: &quot;b8a5e0e3-47d2-4f5e-b1fb-4f4fc7d95a10&quot;,<br>    &quot;args&quot;: &quot;{}&quot;,<br>    &quot;template_id&quot;: &quot;MEETING_100&quot;,<br>    &quot;schedule&quot;: &quot;* * * * *&quot;,<br>    &quot;target_items&quot;: &quot;SELECT id AS meeting_id FROM meeting WHERE start_date &gt; NOW() - INTERVAL 20 minutes&quot;,<br>    &quot;target_users&quot;: &quot;SELECT user_id as target_id FROM attendee WHERE meeting_id = &#39;$meeting_id&#39;&quot;<br>  },<br>  {<br>    &quot;version&quot;: &quot;1.0&quot;,<br>    &quot;name&quot;: &quot;Daily Report&quot;,<br>    &quot;uuid&quot;: &quot;b8a5e0e3-47d2-4f5e-b1fb-4f4fc7d95a10&quot;,<br>    &quot;args&quot;: &quot;{}&quot;,<br>    &quot;template_id&quot;: &quot;MEETING_110&quot;,<br>    &quot;schedule&quot;: &quot;0 8 * * 1-5&quot;,<br>    &quot;target_items&quot;: &quot;SELECT id AS meeting_id FROM meeting WHERE start_date::date = now()::date&quot;,<br>    &quot;target_users&quot;: &quot;SELECT user_id as target_id FROM attendee WHERE meeting_id = &#39;$meeting_id&#39;&quot;<br>  }<br>  ...<br>]</pre><h4><strong>2.2 User Selection</strong></h4><p>The system dynamically selects users <strong>based on SQL queries</strong>, allowing flexible targeting. Instead of hardcoding user lists, the system retrieves data from a <strong>user-alarm table</strong> and other relevant sources to check individual <strong>notification preferences</strong> before sending notifications.</p><p>For example, in a meeting notification scenario:</p><pre>{<br>  &quot;version&quot;: &quot;1.0&quot;,<br>  &quot;name&quot;: &quot;Meeting Reminder&quot;,<br>  &quot;uuid&quot;: &quot;b8a5e0e3-47d2-4f5e-b1fb-4f4fc7d95a10&quot;,<br>  &quot;template_id&quot;: &quot;MEETING_100&quot;,<br>  &quot;schedule&quot;: &quot;* * * * *&quot;,<br>  &quot;target_items&quot;: &quot;SELECT id AS meeting_id FROM meeting WHERE start_date &gt; NOW() - INTERVAL 20 minutes&quot;,<br>  &quot;target_users&quot;: &quot;SELECT user_id AS target_id FROM attendee WHERE meeting_id = &#39;$meeting_id&#39;&quot;<br>}</pre><h4><strong>2.3 Template-Based Argument Injection</strong></h4><p>To enable <strong>flexible and dynamic notifications</strong>, I designed a templating system where placeholders in the notification template are automatically replaced with predefined arguments at runtime.</p><p><strong>Example</strong>: Weekly Charge Summary Notification Template</p><pre>{<br>  &quot;version&quot;: &quot;1.0&quot;,<br>  &quot;name&quot;: &quot;Weekly Charge Summary&quot;,<br>  &quot;uuid&quot;: &quot;4d08593d-6983-4574-9f8a-c8a6e451f63f&quot;,<br>  &quot;schedule&quot;: &quot;0 08 * * 1&quot;,<br>  &quot;args&quot;: &quot;{\&quot;filter_type\&quot;: \&quot;free\&quot;}&quot;,<br>  &quot;target_items&quot;: &quot;SELECT id AS meeting_id FROM meeting WHERE room_type != &#39;$filter_type&#39;&quot;,<br>  &quot;target_users&quot;: &quot;SELECT user_id as target_id FROM attendee WHERE meeting_id = &#39;$meeting_id&#39;&quot;<br>}</pre><p>In this system, arguments such as $filter_type and $meeting_id are dynamically <strong>injected</strong>.</p><p>Your section is well-structured, but I made some refinements to improve clarity, fix grammar issues, and enhance readability while keeping your original intent intact.</p><p><strong>Merging Multiple Argument Sources</strong></p><p>The system retrieves arguments from multiple sources and <strong>merges them</strong> before rendering the final notification:</p><ul><li><strong>Notification-Specific Arguments</strong> <br>: Automatically generated per notification, such as:</li></ul><pre>{<br>    &quot;now&quot;: &quot;2025-03-15T15:05:12&quot;,<br>    &quot;notification_uuid&quot;: &quot;4d08593d-6983-4574-9f8a-c8a6e451f63f&quot;,<br>    ...<br>}</pre><ul><li><strong>User-Defined Arguments</strong> <br>: Custom values specified in the database for each notification type.</li><li><strong>Target Item Query Results</strong> <br>: Dynamic values retrieved from database queries.</li></ul><p>To facilitate this, the system <strong>aggregates all arguments</strong> in a structured way. This ensures that results from target_items queries can be <strong>fed into other queries</strong> or reused in <strong>nested templates</strong>, simplifying query selection and reducing complexity.</p><p>By combining <strong>default values, predefined arguments, and real-time query results</strong>, the system enables highly customizable notifications without requiring changes to the core logic.</p><h4><strong>2.4 Ensuring Exactly-Once Delivery with PostgreSQL Queue</strong></h4><p><em>Check out </em><a href="https://medium.com/p/01b6ca81b395"><em>🔗 Build a Custom Queue Using PostgreSQL</em></a></p><p>To guarantee exactly-once delivery, I implemented a <strong>custom PostgreSQL queue</strong> using:</p><ol><li>SELECT … FOR UPDATE SKIP LOCKED <br>: Prevents duplicate processing by locking selected rows.</li><li>INSERT … ON CONFLICT DO NOTHING<br>: Ensures notifications aren’t sent multiple times.</li></ol><p>The queue also maintains a <strong>history of sent notifications</strong>:</p><pre>ums=# select * from meeting;<br>   id | status |                                     check_key   |   payload | try_count | max_tries  |  priority |     create_time      |     update_time      <br>------+--------+-------------------------------------------------+-----------+-----------+------------+---------------------+----------------------------------<br>20111 |      1 |   4d08593d-6983-4574-9f8a-c8a6e451f63f:21:Sunny |     {...} |         1 |          3 |         1 |  2025-03-15 10:32:01 | 2025-03-15 10:33:04<br>20112 |      1 |   4d08593d-6983-4574-9f8a-c8a6e451f63f:21:James |     {...} |         1 |          3 |         1 |  2025-03-15 10:32:01 | 2025-03-15 13:33:05<br>20113 |      0 | 4d08593d-6983-4574-9f8a-c8a6e451f63f:21:Michael |     {...} |         0 |          3 |         1 |  2025-03-15 10:32:02 | 2025-03-15 17:33:05<br>...<br>(101221 rows)</pre><p>Each notification has a <strong>unique check key</strong> to distinguish it from others.</p><h3>3. Sender</h3><p>The <strong>Sender</strong> retrieves messages from the queue and dispatches them to the <strong>central UMS system</strong>.</p><p>A notification payload might look like this:</p><pre>{<br>  &quot;template_id&quot;: &quot;MEETING_1000&quot;,<br>  &quot;timestamp&quot;: &quot;2025-03-15T13:40:00Z&quot;,<br>  &quot;channel&quot;: &quot;push&quot;,<br>  &quot;user&quot;: {<br>    &quot;userId&quot;: &quot;user789&quot;,<br>    &quot;email&quot;: &quot;user@example.com&quot;<br>  },<br>  &quot;body&quot;: {<br>    &quot;subject&quot;: &quot;Reservation Notification&quot;,<br>    &quot;body&quot;: &quot;Your &#39;Idation Investment&#39; meeting is coming in 20 minutes&quot;<br>  }<br>}</pre><h4><strong>3.1 Asynchronous Requests</strong></h4><p>Initially, the sender was <strong>synchronous</strong>, but performance tests revealed delays. I transitioned to an <strong>asynchronous sender</strong> with worker units, enabling dynamic rate control. Since the sender was built using an <strong>interface and abstract class</strong>, swapping implementations was seamless.</p><h4><strong>3.2 Chunk-Oriented Processing</strong></h4><p>Instead of processing all notifications at once, I used <strong>chunk-oriented processing</strong>:</p><ul><li>Reads and processes a fixed number of records per transaction.</li><li>Reduces memory usage and supports rollback on failure.</li></ul><h4><strong>3.3 Ensuring Exactly-Once Delivery</strong></h4><ul><li><strong>PostgreSQL queue</strong> ensures <strong>transaction integrity</strong>.</li><li><strong>Asynchronous sender</strong> increases efficiency.</li></ul><h3>Conclusion</h3><p>This project improved my technical expertise and deepened my understanding of event-driven architectures.<br> It also reinforced the importance of domain knowledge in building efficient backend systems.</p><p>Would love to hear your thoughts — any feedback is welcome! 🚀</p><h4>References.</h4><p>For a deeper understanding, I’d recommend checking out the following resources:</p><ul><li><a href="https://cloudificationzone.com/2021/08/13/notification-system-design/">Notification System Design</a></li><li><a href="https://blog.devops.dev/build-a-custom-queue-using-postgresql-01b6ca81b395">Build a Custom Queue Using PostgreSQL</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eef601f22518" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/building-a-flexible-and-scalable-notification-system-design-and-implementation-eef601f22518">Building a Flexible and Scalable Notification System: Design and Implementation</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a Custom Queue Using PostgreSQL]]></title>
            <link>https://blog.devops.dev/build-a-custom-queue-using-postgresql-01b6ca81b395?source=rss-c4661bee7a84------2</link>
            <guid isPermaLink="false">https://medium.com/p/01b6ca81b395</guid>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[queue]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[GyeongSeon (Sunny) Park]]></dc:creator>
            <pubDate>Mon, 03 Mar 2025 09:19:19 GMT</pubDate>
            <atom:updated>2025-04-06T07:23:37.140Z</atom:updated>
            <content:encoded><![CDATA[<p>Do we <em>really</em> need RabbitMQ or Kafka just to implement a simple queue?<br>Are they our only options, even when all we need is a basic queuing mechanism?</p><p>While robust queue systems exist, sometimes all we need is a simple queue — one that doesn’t require installation, setup, or learning a new system.</p><p>This is why I built a simple queue using PostgreSQL. My project uses PostgreSQL, and I needed a queue for notification messages. The custom queue was simple, making it intuitive to understand the logic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JfGmeD9wlULtOVDFWg8xFw.png" /></figure><h3>Get Hands Dirty</h3><p>Let’s make a simple queue with PostgreSQL. No need for additional system setup or configuration — just SQL.</p><h4>1. Create a table in the database.</h4><p>First, I created a table for the queue.</p><pre>CREATE TABLE custom_queue<br>(<br>    name varchar(30) NOT NULL,<br>    key varchar(256) NOT NULL,<br>    status integer DEFAULT 0 NOT NULL,<br>    payload json DEFAULT &#39;{}&#39;::json NOT NULL,<br>    enqueue_dt date DEFAULT now()::date NOT NULL,<br>    created_at timestamp DEFAULT now() NOT NULL,<br>    updated_at timestamp DEFAULT now() NOT NULL,<br><br>CONSTRAINT PK_custom_queue PRIMARY KEY (name, key, enqueue_dt)<br>) PARTITION BY RANGE (enqueue_dt);</pre><p>The key, status, and payload columns are essential for this table.<br>Let’s break down the table schema:</p><p>✔️ name<br>The name of the queue for which the message is intended.<br>For scalability, multiple systems may use this queue, so having a distinct name helps differentiate between them. You can think of this as a category or topic to differentiate between various services using this queue.</p><p>✔️ key<br>A unique identifier for each message in the queue.</p><p>✔️ status<br>Represents the message state:</p><ul><li>0 → In progress</li><li>1 → Successfully processed</li><li>-1 → Failed</li></ul><p>✔️ payload<br>: The payload of the message.<br>Stores the message content in JSON format.</p><p>✔️ enqueue_dt<br>: The date the message was added. <br>This helps with partitioning by month.</p><p>✔️ created_at / updated_at<br>: Track creation and modification timestamps.</p><p>This schema forms the foundation of the queue, but we still need mechanisms to process messages.</p><h4>Let’s make it better!</h4><p><strong>📌 Indexes for Faster Queries</strong><br>Since most queries will fetch messages ready to be sent, I created an index on status and created_at:</p><pre>CREATE INDEX IDX_custom_create_at_status <br>ON custom_queue (status, created_at);</pre><p><strong>📌 Partitioning for Scalability<br></strong>Since the queue table can grow significantly over time, we partition it by month using enqueue_dt to improve query performance and data management.</p><pre>CREATE TABLE custom_queue_2025_02 PARTITION OF custom_queue<br>FOR VALUES FROM (&#39;2025–02–01&#39;) TO (&#39;2025–03–01&#39;);</pre><p>This reduces query time and improves performance when dealing with large datasets.</p><h4>2. Enqueue a Message into the Queue.</h4><p>The enqueue operation should prevent duplicate messages. We achieve this using ON CONFLICT DO NOTHING:</p><pre>INSERT INTO &lt;YOUR QUEUE NAME&gt; (params) <br>VALUES (&lt;YOUR PAYLOAD JSON&gt;)<br>ON CONFLICT DO NOTHING;</pre><p>In our queue table, it will look like this:</p><pre>INSERT INTO notification_queue (name, key, status, try_count, payload, enqueue_dt)<br>VALUES (<br>    &#39;custom-producer&#39;,<br>    &#39;5bcb207c-aa82–4fc4–8bac-5f3b69cafdca:2:sunny&#39;,<br>    0,<br>    3,<br>    &#39;{&quot;id&quot;: &quot;780acc3328eed0d5573d0&quot;, &quot;user&quot;: &quot;sunny@gmail.com&quot;, &quot;device&quot;: &quot;iOSmini3&quot;, &quot;channel&quot;: [&quot;Tab&quot;, &quot;Push&quot;]}&#39;::json,<br>    &#39;2025-03-03&#39;<br>)<br>ON CONFLICT DO NOTHING;</pre><p>By using this approach, we ensure <strong>idempotency</strong> — if the process fails, it can be retried without inserting duplicate messages. If the message generator fails during the process, we can retry it without worrying about duplicate payloads.</p><h4>3. Dequeue a message from the queue.</h4><p>You might wonder:</p><blockquote>“How to ensure that only one consumer can dequeue the message at a time?”</blockquote><p>To prevent multiple consumers from processing the same message, we use FOR UPDATE SKIP LOCKED:</p><pre>SELECT *<br>FROM ≪queue_table_name≫<br>WHERE name = ≪producer_name≫&#39;<br>  AND status = 0<br>LIMIT ≪chunk_size≫<br>FOR UPDATE SKIP LOCKED;</pre><p>Do not use “AUTOCOMMIT” option. This method only works within a transaction context.</p><p>✔️ enqueue_dt</p><p>If a message should only be sent on the day it is enqueued, the query must filter messages generated on that specific date</p><pre>SELECT *<br>FROM ≪queue_table_name≫<br>WHERE <br>  ...<br>  AND enqueue_dt = &#39;≪now_date≫&#39;<br>...</pre><p>In our queue table, the query would look like this:</p><pre>SELECT *<br>FROM custom_queue<br>WHERE name = &#39;ipo-queue&#39; <br>  AND enqueue_dt = &#39;2025–03–03&#39;<br>  AND status = 0<br>  AND try_count != 0<br>LIMIT 1000<br>FOR UPDATE SKIP LOCKED;</pre><h4>What Does FOR UPDATE SKIP LOCKED Do?</h4><p>This clause is essential for preventing multiple consumers from processing the same message.</p><ul><li><strong>Prevents Race Conditions</strong>: Ensures that only one consumer processes a message at a time.</li><li><strong>Locks Selected Rows</strong>: Any row selected by one transaction remains locked until processed.</li><li><strong>Avoids Blocking Other Consumers</strong>: Other consumers skip locked rows and fetch available messages instead.</li></ul><p>This is a common pattern for processing queue messages concurrently.<br>For more details, check out this resource: <a href="https://www.sqlines.com/oracle-to-mysql/skip_locked">🔗 SQLines: SKIP LOCKED</a></p><h3>Conclusion</h3><p>Using PostgreSQL as a queue is a lightweight and efficient alternative when a dedicated message broker isn’t necessary. By leveraging table partitioning, indexes, and FOR UPDATE SKIP LOCKED, we can build a simple, scalable, and idempotent queuing mechanism.</p><p>Would you consider using PostgreSQL for a queue in your project? Let me know your thoughts!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=01b6ca81b395" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/build-a-custom-queue-using-postgresql-01b6ca81b395">Build a Custom Queue Using PostgreSQL</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Hexagonal Architecture: Structuring Software with Ports and Adapters]]></title>
            <link>https://medium.com/@gngsn/mastering-hexagonal-architecture-structuring-software-with-ports-and-adapters-e2751e985e43?source=rss-c4661bee7a84------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2751e985e43</guid>
            <category><![CDATA[hexagonal-architecture]]></category>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[clean-architecture]]></category>
            <dc:creator><![CDATA[GyeongSeon (Sunny) Park]]></dc:creator>
            <pubDate>Sun, 12 Jan 2025 14:02:54 GMT</pubDate>
            <atom:updated>2025-01-12T14:02:54.254Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uy34eipwertXXhSuH63MMw.png" /></figure><h3>Clean Architecture</h3><p>Clean Architecture has gained popularity in software systems due to its focus on managing and organizing projects effectively.</p><p>It’s all about how well you manage your projects by focusing on organizing architectures. So, I’d recommend reading this article to get insight and time to think of a good structure.</p><p>Since Robert C. Martin introduced the concept of ‘<a href="https://blog.cleancoder.com/uncle-bob/2011/11/22/Clean-Architecture.html">Clean Architecture</a>,’ it has been widely discussed and evolved. Because the article leans toward theory, it is somewhat vague when it comes to adapting to practical projects, leading many software engineers to implement their own implementations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/0*duqwPriHkjjaRvQ5.jpg" /><figcaption><a href="https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html">https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html</a></figcaption></figure><p>There are several ideas have been fleshed out:</p><ul><li><a href="http://alistair.cockburn.us/Hexagonal+architecture">Hexagonal Architecture</a> (a.k.a. Ports and Adapters)</li><li><a href="http://jeffreypalermo.com/blog/the-onion-architecture-part-1/">Onion Architecture</a></li><li><a href="http://blog.cleancoders.com/2011-09-30-Screaming-Architecture">Screaming Architecture</a></li><li><a href="http://www.amazon.com/Lean-Architecture-Agile-Software-Development/dp/0470684208/">DCI</a></li><li><a href="http://www.amazon.com/Object-Oriented-Software-Engineering-Approach/dp/0201544350">BCE</a></li></ul><p>These all achieve the key of Clean Architecture “separation by dividing the software into layers” in varying ways.</p><blockquote>The idea of Hexagonal Architecture is to put inputs and outputs at the edges of our design. Business logic should not depend on whether we expose a REST or a GraphQL API, and it should not depend on where we get data from — a database, a microservice API exposed via gRPC or REST, or just a simple CSV file.</blockquote><blockquote>- <a href="https://netflixtechblog.com/ready-for-changes-with-hexagonal-architecture-b315ec967749">Netflix Tech Blog</a></blockquote><p>In this article, We’ll understand what Hexagonal Architecture is.</p><h3>Hexagonal Architecture</h3><p>Hexagonal Architecture is a <strong>layered architecture</strong> structured around <strong>ports and adapters</strong> between layers.</p><p>Let’s start by clarifying its structure.</p><h4>Layered architecture</h4><p>Layered architecture, also known as the <strong>n-tier architecture pattern</strong>, is one of the most commonly used architectural styles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kibTRN4Iz6OZpE26.png" /><figcaption><a href="https://www.oreilly.com/library/view/software-architecture-patterns/9781491971437/ch01.html">https://www.oreilly.com/library/view/software-architecture-patterns/9781491971437/ch01.html</a></figcaption></figure><p>As the name suggests, the key concept of Layered Architecture is separating layers based on their specific roles within the application (e.g. presentation logic or business logic).</p><p>The layered architecture pattern doesn’t specify a specific number of layers, but it typically involves layers like presentation, business, persistence, and database.</p><p><strong>✔️ Presentation Layer</strong></p><p><em>: </em>to deal with handling the UI or browser communication logic.</p><p><strong>✔️ Domain Layer</strong></p><p>: to handle main tasks like business service or system logic. <br><em>A.k.a Business or Service Layer.</em></p><p><strong>✔️ Persistence Layer</strong></p><p>: Responsible for communicating with external systems to ensure data persistence for the application. A.k.a Data Access Layer<em>.</em></p><p>It covers not only databases but also external systems like message queues or external API communications.</p><p><strong>✔️ Database Layer</strong></p><p>: to be responsible for managing and storing data in a structured and organized manner.</p><p>Components within these layers are organized into horizontal layers. Since each layer requires “separation concern”, we can code each component focusing on what the layer is for.</p><p>For example, components in the presentation layer deal only with presentation logic, whereas components residing in the business layer deal only with business logic.</p><p>However, if we focus solely on layering, we may encounter the following issues:</p><ul><li>It’s easy to mix up responsibilities between layers.</li><li>There is a dependency on data: the presentation layer depends on the domain layer, and the domain layer depends on the persistence layer.</li></ul><p>To avoid these problems, <strong>we need to ensure high cohesion within each layer.</strong></p><h3>Ports and adapters pattern</h3><p>Let’s explore the components of the Hexagonal Architecture and see how it can be structured in three layers.</p><pre>├── domain/<br>├── application/<br>│   ├── usecases/<br>│   └── ports/<br>│       ├── input/<br>│       └── output/<br>└── adapter/<br>    ├── input/<br>    │   └── persistence/<br>    └── output/<br>        └── web/</pre><p>This structure separates concerns, with the domain layer representing business logic, the application layer handling use cases and ports, and the adapter layer interfacing with external systems.</p><ul><li><strong>Domain</strong> <strong>Layer</strong>: Domain Objects, Entities</li><li><strong>Application Layer</strong>: Use Cases (or Services), Ports</li><li><strong>Adapter Layer</strong>: Adapters, Repositories, and so on.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/0*8PEdRgDk3v7rXrPy.png" /><figcaption><a href="https://github.com/thombergs/buckpal?tab=readme-ov-file#table-of-contents">https://github.com/thombergs/buckpal?tab=readme-ov-file#table-of-contents</a></figcaption></figure><p><strong>✔️ Domain</strong></p><p>: Domain Objects represent business models.</p><p>A domain object is a core entity written in the application’s primary language, such as a POJO in Java. The key concept is domain objects don’t have any outward dependency.</p><p>This is a perfect example of the Single Responsibility Principle in <strong>S</strong>OLID.</p><pre>public record Account(<br>    @Getter AccountId id,<br>    @Getter ActivityWindow activityWindow,<br>    Money baselineBalance<br>) { /* ... */ }</pre><p><strong>✔️ Use Cases</strong></p><p>: Usage scenarios for a piece of software.</p><p>A use case class has no dependency on outward components. If a use case requires external data or services, we create an output port.</p><pre>public interface SendMoneyUseCase {<br>    boolean sendMoney(SendMoneyCommand command);<br>}</pre><pre>public class SendMoneyService implements SendMoneyUseCase {<br>  private final LoadAccountOutputPort loadAccountOutputPort;<br>  // ...<br><br>  @Override<br>  boolean sendMoney(SendMoneyCommand command) { /* ... */ }<br>}</pre><p><strong>✔️ Input &amp; Output Ports</strong></p><p>Ports are interfaces that allow interaction with the core components. Domain objects and Use Cases reside within the hexagon and communicate with external components solely through these ports.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Bd8nwmj0zrMWDM6p.png" /><figcaption><a href="https://jivimberg.io/blog/2020/02/01/hexagonal-architecture-on-spring-boot/">https://jivimberg.io/blog/2020/02/01/hexagonal-architecture-on-spring-boot/</a></figcaption></figure><p>The direction of data flow — whether input or output — helps us classify ports and adapters clearly.</p><p><strong>- Input Port</strong></p><p>: Input Port is an interface can be called by outward components implemented by a use case. This component is called an input adapter or “driving” adapter.</p><p><strong>- Output Port</strong></p><p>: Output Port is an interface that can be called by our use cases if they need something from the external systems. It’s implemented by an outside component called an output or “driven” adapter.</p><pre>public interface LoadAccountOutputPort {<br>    Account loadAccount(AccountId accountId, LocalDateTime baselineDate);<br>}</pre><p>This design ensures that dependencies are directed outward from use cases to adapters through interfaces, which is a great example of the Dependency Inversion Principle (DIP) from SOLID.</p><p><strong>✔️ Adapter</strong></p><p>Adapters form the outer layer of Hexagonal Architecture. While they are not part of the core, they interact with it.</p><pre>public record AccountPersistenceAdapter(<br>        AccountRepository accountRepository,<br>        ActivityRepository activityRepository,<br>        AccountMapper accountMapper<br>) implements LoadAccountPort, UpdateAccountStatePort {/* ... */}</pre><p>All dependencies point inward, meaning the core business logic remains agnostic to the presentation layer and data sources.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2751e985e43" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS S3 Storage Class: Choose the best Storage Class]]></title>
            <link>https://medium.com/@gngsn/aws-s3-storage-class-choose-the-best-storage-class-8210e4554f32?source=rss-c4661bee7a84------2</link>
            <guid isPermaLink="false">https://medium.com/p/8210e4554f32</guid>
            <category><![CDATA[cloud-services]]></category>
            <category><![CDATA[cloud-storage]]></category>
            <category><![CDATA[aws-s3]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[GyeongSeon (Sunny) Park]]></dc:creator>
            <pubDate>Tue, 14 Mar 2023 04:39:53 GMT</pubDate>
            <atom:updated>2023-03-14T04:39:53.066Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*J2wmt9e5VyHf59Qb.png" /></figure><h3>S3 Storage Class</h3><p>AWS S3 stands for Amazon Web Service Simple Storage Service, which has had a significant impact on the storage market. S3 provides various types of storage to suit diverse companies’ or customers’ situations. Because AWS provides so many S3 types, we need to know which type is suitable for the given situation.</p><p>For example, customers may face situations like uploading clients’ profile images several times in a day or batch processing, both of which get a large amount of files from S3 for analyzing customer trends. Every company in every situation has different needs, including access times, storage periods, and purpose of storage, which is why we will now explore the S3 storage class.</p><p>There are diverse storage classes which we will explore:</p><ul><li>Standard</li><li>Standard-IA</li><li>One Zone-IA</li><li>Glacier Instant Retrieval</li><li>Glacier Flexible Retrieval</li><li>Glacier Deep Archive</li><li>Intelligent-Tiering</li></ul><p>We can specify a storage class from among the above classes not only when we upload an Object, which means all types of data like files or images in S3, but also in a property tab of an already uploaded Object.</p><h3>Standard</h3><p>As you can see from the name of the class, the Standard type of storage is best suited for general purposes, and is also the default type of an Object. For reference, the S3 introduction by AWS is below.</p><blockquote>Frequently accessed data (more than once a month) with milliseconds access.</blockquote><p>There are four representative features:</p><ul><li>Provide 99.99% Availability</li><li>Used for frequently accessed data</li><li>Low Latency and High Throughput</li><li>Sustain two concurrent facility failures: if a facility is down, it can still work.</li></ul><h4>Use cases</h4><p>- Big Data Analytics, Mobile and Gaming Applications, Content Distribution, Dynamic Websites, Cloud Applications</p><h3>Standard IA (Infrequent Access)</h3><p>Standard Infrequent Access is designed for data that is accessed less frequently, but requires rapid accessing when needed. Standard IA provides 99.9% availability, which makes it less available than Standard by 0.09%, but is still an excellent, highly reliable storage method. The class is cheaper than the Standard class, but costs on retrieval.</p><h4><strong>Use cases</strong></h4><p>- Disaster Recovery, Backups</p><p>The comparison with the Standard class is below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*R7G3aijFmxxGzcP0ciQNCQ.png" /><figcaption>S3 Standard VS S3 Standard-IA</figcaption></figure><p>As you can see, the feature that is accessed less frequently makes the storage prices lower.</p><h3>One Zone-Infrequent Access</h3><p>One Zone Infrequent Access is a kind of Standard IA. Like Standard IA, it is suitable for <strong>data that is accessed less frequently</strong>, but requires <strong>rapid accessing when needed</strong>. The S3 One Zone-IA class stores the data in only one zone; in other words, it has only one availability zone. Because of this, the data, which is stored in a bucket located in a certain zone, can be lost if the zone fails.</p><p>S3 One Zone-IA is 20% cheaper than S3 Standard-IA. So, it is the ideal storage option if you need a lower cost but do not require high availability or resilience.</p><p>For example, it is fit for a task that uses easily recreatable data like dealing with secondary backup copies.</p><p>The comparison with the Standard-IA class is below, which has a little difference in storing cost:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*D5e42u_vvYOOSUIFEotOmg.png" /><figcaption>S3 Standard-IA VS S3 One Zone — IA</figcaption></figure><h3>3 types of Glacier Storage</h3><p>All S3 Glacier storages are purposed for archiving or backups and there are three kinds, listed below:</p><ul><li><strong>S3 Glacier Instant Retrieval</strong>: when instantaneous accessing in milliseconds</li><li><strong>S3 Glacier Flexible Retrieval</strong>: when the most retrieval flexibility</li><li><strong>S3 Glacier Deep Archive</strong>: when long-term archiving</li></ul><h3>S3 Glacier Instant Retrieval</h3><p>S3 Glacier Instant Retrieval is purposed for a customer who needs <strong>retention of data with millisecond-time retrieval</strong>. S3 Glacier Instant Retrieval is suitable for this situation and is mainly used for data accessed once a quarter. S3 Glacier Instant Retrieval has a <strong>minimum storage duration of 90 days</strong>.</p><p>The comparison with the Standard-IA class is below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*ssx0l5tbL43GHBBgY_3JtQ.png" /><figcaption>S3 One Zone-IA VS S3 Glacier Instant Retrieval</figcaption></figure><h3>S3 Glacier Flexible Retrieval</h3><p>S3 Glacier Flexible Retrieval was formerly known as Amazon S3 Glacier before the introduction of Glacier Instant Retrieval. S3 Glacier Flexible Retrieval is designed for archiving data that <strong>does not require immediate access</strong>, but needs the <strong>flexibility to retrieve large sets of data at no cost</strong>. For example, S3 Glacier Flexible Retrieval is ideal for backup or disaster recovery.</p><p>Furthermore, there are several retrieval time options varying by cost and speed:</p><ul><li><strong>Expedited</strong>: 1 to 5 minutes</li><li><strong>Standard</strong>: 3 to 5 hours</li><li><strong>Bulk</strong>: 5 to 12 hours — free</li></ul><p>S3 Glacier Flexible Retrieval typically costs up to 10% less than S3 Glacier Instant Retrieval. Retrieval cost tends to be low although different depending on the type. S3 Glacier Flexible Retrieval has a <strong>minimum storage duration</strong> <strong>of 90 days</strong>, the same as S3 Glacier Instant Retrieval.</p><p>The comparison with the S3 Glacier Instant Retrieval class is below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/1*oOz9PZgqfI4CcbvSwWhCdw.png" /><figcaption>S3 Glacier Instant Retrieval VS S3 Glacier Flexible Retrieval</figcaption></figure><h3>S3 Glacier Deep Archive</h3><p>S3 Glacier Deep Archive is designed for <strong>long-term retention</strong> and <strong>digital preservation</strong> of data that will be retained for 7–10 years and is ideal for accessing once or twice a year. That’s why S3 Glacier Deep Archive has the lowest storage cost.</p><p>For example, those in highly-regulated industries, such as financial services, healthcare, and public sectors retain data sets for 7 ~ 10 years or longer to meet regulatory compliance requirements.</p><p>S3 Glacier Deep Archive has two retrieval time options:</p><ul><li><strong>Standard</strong>: 12 hours</li><li><strong>Bulk</strong>: 48 hours</li></ul><p>S3 Glacier Deep Archive has a <strong>minimum storage duration of 180 days.</strong></p><p>The comparison with the S3 Glacier Flexible Retrieval class is below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*LzgOdl4_4WO85YLlYNKpJA.png" /><figcaption>S3 Glacier Instant Retrieval VS S3 Glacier Flexible Retrieval</figcaption></figure><h3>S3 Intelligent-Tiering</h3><p>S3 Intelligent Tiering is purposed for unknown or changing access, <strong>automatically moving data to</strong> <strong>the most cost-effective access tier</strong> based on usage and access frequency without performance impact, retrieval fees, or operational overhead.</p><p>Because S3 has to watch how long each Object is saved, S3 Intelligent Tiering requires a small monthly monitoring and auto-tiering fee; however, there are no retrieval charges in S3 Intelligent-Tiering.</p><p>There are three split tiers according to retention periods:</p><ul><li><strong>Frequent Access tier</strong>: <em>automatic</em>. <strong>default </strong>tier</li><li><strong>Infrequent Access tier</strong>: <em>automatic</em>. objects not accessed for <strong>30 days</strong></li><li><strong>Archive Instant Access tier</strong>: <em>automatic</em>. objects not accessed for <strong>90 days</strong></li></ul><p>Furthermore, S3 Intelligent-Tiering supports two options for storing long-term when needed:</p><ul><li><strong>Archive Access tier</strong>: <em>optional</em>. configurable from <strong>90 days</strong> to 700+ days</li><li><strong>Deep Archive Access tier</strong>: <em>optional</em>. configurable from <strong>180 days</strong> to 700+ days</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*90r-a3xj1Gws6F4LDHEvZQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8210e4554f32" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS RDS & Aurora: Cloud Relational Database Easy to Operate and Scale]]></title>
            <link>https://blog.devops.dev/aws-rds-aurora-cloud-relational-database-easy-to-operate-and-scale-9f6e399ef745?source=rss-c4661bee7a84------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f6e399ef745</guid>
            <category><![CDATA[relational-databases]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aurora]]></category>
            <category><![CDATA[rds]]></category>
            <dc:creator><![CDATA[GyeongSeon (Sunny) Park]]></dc:creator>
            <pubDate>Thu, 02 Mar 2023 04:55:27 GMT</pubDate>
            <atom:updated>2023-03-03T19:56:00.258Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xu4dzBJ6o64jYqGBOx_-ag.png" /></figure><h3>AWS Relational Databases: RDS &amp; Aurora</h3><h4>✔️ Relational Database</h4><p>Before getting started, we need to know what a relational database is. A relational database is a type of database that stores and provides access to data points that are related to one another. A relational database organizes data into rows and columns, which form a table. Data is typically structured across multiple tables, which can be joined together via a primary key or a foreign key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/0*i8NQZb6rtsw1ZHLy.png" /><figcaption><a href="https://docs.aws.amazon.com/redshift/latest/dg/tutorial-loading-data-create-tables.html">https://docs.aws.amazon.com/redshift/latest/dg/tutorial-loading-data-create-tables.html</a></figcaption></figure><h4>✔️ AWS RDS</h4><p>AWS RDS stands for Relational Database Service provided by Amazon Web Service. RDS is a web service that makes it easier to set up, operate, and scale a relational database in the cloud. Also, RDS is a fully managed DB service for a database that uses SQL as a its query language.</p><h4>✔️ AWS Aurora</h4><p>Amazon Aurora is a cloud-native database built for speed and reliability. Aurora is cloud-optimized and claims 5 times greater performance over MySQL on RDS, and over 3 times greater performance of Postgres on RDS. Aurora is part of the managed database service RDS.</p><h4>✔️ Managed service</h4><p>As fully managed services, RDS and Aurora DB provide the following benefits.</p><ul><li>Automatic failover</li><li>Backup &amp; Multi-AZ for disaster recovery (DR)</li><li>Isolation &amp; Security</li><li>Push-button scaling (vertical and horizontal)</li><li>Read replicas for improved read performance</li><li>Automated provisioning and OS patching</li><li>Advanced monitoring, providing a dashboard</li><li>Routine maintenance</li><li>Built-in best practice</li></ul><p>These features are crucial and absolutely necessary when using databases in production circumstances. That’s why we should use databases in the cloud such as RDS or Aurora.</p><p>Now, let us dive into RDS and Aurora.</p><h3>AWS RDS</h3><p>RDS is a representative database server provided by AWS and is very easy to manage in the cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*s_oNteQIzX_ZCH-I.png" /></figure><p>RDS may pose various initial challenges, including setting up, making replicas, and scaling. When we use RDS, we can perform these operations just by clicking the button.</p><p>RDS supports all RDS database engines such as MariaDB, MySQL, PostgreSQL, SQL Server, and Oracle. For your information, Aurora only suppots MySQL and PostgreSQL.</p><h4>✔️Auto Scaling</h4><p>While using a database, if the database’s capacity approaches the storage threshold, it is common practice to increase the database’s storage. In RDS, you have the option to enable auto-scaling, which scales database storage when it detects you are running out of free storage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*iDcBQdRqD1Gda4Zq.gif" /><figcaption><a href="https://aws.amazon.com/ko/blogs/database/sharding-with-amazon-relational-database-service/">https://aws.amazon.com/ko/blogs/database/sharding-with-amazon-relational-database-service/</a></figcaption></figure><p>It is beneficial to avoid manually scaling your database storage. One of the reasons is data should be handled efficiently and carefully. Additionally, scaling manually is not a trivial task.</p><p>When you use RDS, you have to set the Maximum Storage Threshold (maximum limit for DB storage). When the usage capacity is going to reach the threshold, RDS observes and modifies storage. RDS will modify the storage for autoscaling DB instances depending on user settings and other factors such as:</p><ul><li>Free storage is less than 10% of allocated storage</li><li>Low storage lasts at least 5 minutes</li><li>6 hours have passed since the last modification</li></ul><p>Autoscaling is very useful for applications with unpredictable workloads.</p><h4>✔️ Read Replica</h4><p>In many cases, reading data stored in a database occurs more frequently than writing. So, it is common practice to create read-only databases , which are used for SELECT queries that can read data, not INSERT, UPDATE, or DELETE. By establishing a read-only database, the production database can take on normal loads. Additionally, read-only databases are optimally suited for auto-scaling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/0*aEJYWNZfm3bvS5j3.png" /><figcaption><a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html">https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html</a></figcaption></figure><p>RDS can make up to 5 read replicas in range of the Availability Zone (AZ), cross AZ, or cross Region. Replicas can be promoted to the primary database instance that does reading and writing.</p><p>Instead of decreasing the load for the database, we need to consider the replica lags. RDS copies the replicas asynchronously, so reads are eventually consistent. But sometimes, the replication process isn’t able to keep up with the primary DB instance. As a result, replication lag can occur.</p><h4>✔️ Multiple Availability Zone</h4><p>In AWS, a new DB can be restored from a snapshot in a new Availability Zone (AZ). This improves availability and can be used for disaster recovery, since when one zone fails, our databases can fail. For RDS Read Replicas within the same region, so you don’t pay that fee. But, there is a network cost when data goes from one AZ to another.</p><p>AWS performs replication with zero downtime, meaning there is no need to stop the DB and make manual modifications. This is one of the merits of RDS, including Aurora.</p><p>The following happens internally:</p><ul><li>First, a snapshot is taken.</li><li>Second, a new DB is restored from the snapshot in a new AZ.</li><li>Third, synchronization is established between the two databases.</li></ul><h3>AWS Aurora</h3><p>Aurora is a proprietary technology from AWS and not open-sourced like other engines. Aurora DB supports Postgres and MySQL drivers, so you can work with the two databases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-Uzz0F6HOVLGapJ7.png" /></figure><p>Aurora is designed to work in the cloud and HA (High Availability) native, so the failover is instantaneous. Aurora storage automatically grows in increments of 10GB, up to 128 TB. Aurora can have 15 replicas while MySQL has 5, and the replication process is faster. However, instead of having more efficient than RDS, Aurora costs 20% more.</p><p>For copying to other regions, whereas RDS has to make a snapshot, Aurora supports for Cross Region Replication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/0*8AJIEO0faOlnSivt.png" /><figcaption><a href="https://aws.amazon.com/ko/blogs/database/deploy-multi-region-amazon-aurora-applications-with-a-failover-blueprint/">https://aws.amazon.com/ko/blogs/database/deploy-multi-region-amazon-aurora-applications-with-a-failover-blueprint/</a></figcaption></figure><p>Also, Aurora provides automated backups lasting from 1 to 35 days, which cannot be disabled. If you want a backup for as long as you want, you can use Manual DB Snapshots, which are manually triggered and has user-specified retention.</p><p>Aurora supports Multi-Master. If you want immediate failover for the write node for HA, you can assign it Multi-Master. You can decide whether every node performs Read/Write operations or whether to promote read replicas to new master. Else, for more HA configuration, you can consider the global databases which are across the regions with Global Aurora.</p><h4>✔️ Global Aurora</h4><p>Global Aurora has a single primary region that can read and write and secondary regions which can only read. Distributing different regions is excellent for disaster recovery. Global Aurora streamlines this process and helps to decrease latency. There can be up to 5 secondary regions and up to 16 Read Replicas per secondary region. The cross-zone replication lag is less than 1 second, which indicates very low latency.</p><h4>✔️ Aurora Machine Learning</h4><p>Amazon Aurora machine learning enables you to add ML-based predictions to applications via the SQL programming language. You can incorporate machine learning easily without easily without prior experience. It provides simple, optimized, and secure integration between Aurora and AWS ML services without having to build custom integration or move data around. When you run an ML query, Aurora calls Amazon SageMaker for a wide variety of ML algorithms or Amazon Comprehend for sentiment analysis.</p><h3>AWS RDS Proxy</h3><p>Including those built on modern serverless architectures like AWS lambda, many applications can have a large number of open connections to the database server. These database connections may open and close at a high rate, exhausting database memory and compute resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D20mCH6Fdv9cUPO1" /><figcaption><a href="https://www.workfall.com/learning/blog/how-to-improve-application-availability-with-amazon-rds-proxy/">https://www.workfall.com/learning/blog/how-to-improve-application-availability-with-amazon-rds-proxy/</a></figcaption></figure><p>Amazon RDS Proxy allows applications to pool and share connections established with the database, improving database efficiency and application scalability. With RDS Proxy, failover times for Aurora and RDS databases are reduced by up to 66%. RDS Proxy can manage credentials, authentication, and access for security through integration with AWS Secrets Manager and AWS Identity and Access Management (IAM).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f6e399ef745" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/aws-rds-aurora-cloud-relational-database-easy-to-operate-and-scale-9f6e399ef745">AWS RDS &amp; Aurora: Cloud Relational Database Easy to Operate and Scale</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS ELB: Elastic Load Balancer — efficiently distributing incoming network traffic]]></title>
            <link>https://blog.devops.dev/aws-elb-elastic-load-balancer-efficiently-distributing-incoming-network-traffic-499d47eb958d?source=rss-c4661bee7a84------2</link>
            <guid isPermaLink="false">https://medium.com/p/499d47eb958d</guid>
            <category><![CDATA[aws-elb]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[load-balancing]]></category>
            <dc:creator><![CDATA[GyeongSeon (Sunny) Park]]></dc:creator>
            <pubDate>Mon, 27 Feb 2023 13:19:54 GMT</pubDate>
            <atom:updated>2023-03-02T14:50:54.816Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>AWS ELB: Elastic Load Balancer — efficiently distributing incoming network traffic</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BwpqU04hyxPrFnhryZBkwQ.png" /></figure><h3>AWS Elastic Load Balancer</h3><p>AWS ELB stands for Elastic Load Balancer, which is provided by Amazon Web Service. Load Balancers are<strong> </strong>servers that<strong> manage a group of multiple divided backend servers.</strong> Elastic Load Balancing scales your load balancer as your incoming traffic changes over time. It can automatically scale to the vast majority of workloads.</p><p>In AWS, the servers are typically the EC2 instances that are well-known cloud computing servers. The below picture describes an example of a multiple-server structure when using a Load Balancer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*r3L0rudz4AS3blmw.png" /><figcaption><a href="https://aws.amazon.com/ko/elasticloadbalancing/">https://aws.amazon.com/elasticloadbalancing/</a></figcaption></figure><p>When users try to access the website, a Load Balancer distributes one or more servers by forwarding the user requests to the servers running the website application.</p><p>So, why are Load Balancers needed, and why should we distribute the users to multiple servers?</p><h3>Why use load balancing?</h3><p>First, Load Balancing aims to spread loads across multiple downstream instances. By distributing incoming traffic, the downstream server instances can sustain their performance.</p><p>In addition, when any server instance has a problem, so when it has an unhealthy status, the Load Balancer can forward to all servers except the unhealthy one. When the server is fixed and restores healthy status, the Load Balancer starts to forward to that server again. We call the Health Check for high availability.</p><h3>Health Checks</h3><p>Health Checks are crucial for Load Balancers. Once Load Balancer sends requests that have a port and a route, such as by sending /health to all server instances, the instances communicate available status with a response that has a normal HTTP status code. The Load Balancer forwards only to servers that are available to reply to the request. If the response is not 200 (OK HTTP status), then the instance is regarded as unhealthy. Health Check provides high availability (HA).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KGuzZrLsThBNXnaF" /></figure><p>In short, you have seen the following two main features of the Load Balancer.</p><ul><li>Distribute load across multiple downstream server instances</li><li>Seamlessly handle failures of downstream instances by doing regular health checks</li></ul><p>Furthermore, AWS provides many more functions like the below list.</p><ul><li>Enable accessing a single point by DNS</li><li>Provide SSL termination for HTTPS to secure access</li><li>Enforce stickiness with cookies</li><li>Provide high availability by covering across zones</li><li>Separate public traffic from private traffic</li></ul><p>In AWS, there is an extra advantage of modularity, which means that AWS services can be easily assembled with other AWS services. Now, let’s review some of these merits in more detail.</p><h3>Load Balancer Types on AWS</h3><p>AWS provides 4 kinds of managed Load Balancers:</p><h4>✔️ <strong>Classic Load Balancer (CLB)</strong></h4><ul><li>Old generation</li><li>Supports HTTP, HTTPS, TCP, SSL</li></ul><p><em>Not covered in this article.</em></p><h4>✔️ <strong>Application Load Balancer (ALB)</strong></h4><ul><li>A new generation</li><li>Operates at layer 7 (Application layer): HTTP, HTTPS, WebSocket</li><li>Targets EC2 instances, ECS tasks, Lambda, IP address</li></ul><h4>✔️ <strong>Network Load Balancer (NLB)</strong></h4><ul><li>A new generation</li><li>Operates at layer 4 (Transport layer): TCP, TLS (secure TCP), UDP</li><li>Targets EC2 instances, IP address, ALB</li></ul><h4>✔️ <strong>Gateway Load Balancer (GWLB)</strong></h4><ul><li>The newest generation</li><li>Operates at layer 3 (Network layer): IP Protocol</li><li>Targets EC2 instances, IP address</li></ul><p>Let’s get details of the above Load Balancers.</p><h3>Application Load Balancer (ALB)</h3><p>An application load balancer operates in <strong>Layer 7</strong> (HTTP) of the<strong> </strong>ISO model which is seven layers that computer systems use to communicate over a network. Because of this, an ALB covers the<strong> target groups</strong> or <strong>applications close to users</strong>. An ALB can operate multiple HTTP applications across machines like target groups, or multiple applications on the same machine like containers. Likewise, an ALB is suitable for <strong>container-based applications</strong> and <strong>microservices</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/0*fVy4H0jwyjjU5AB5.png" /><figcaption><a href="https://aws.amazon.com/ko/blogs/aws/new-application-load-balancer-simplifies-deployment-with-weighted-target-groups/">https://aws.amazon.com/blogs/aws/new-application-load-balancer-simplifies-deployment-with-weighted-target-groups/</a></figcaption></figure><p>An ALB supports HTTP/2 and Websocket, and also supports redirects, such as from HTTP to HTTPS.</p><h3>Routing Table</h3><p>We should set routing rules to forward to different target groups. The routing rules support request routing based on HTTP headers, HTTP methods, URI query parameters, and source IP CIDRs in addition to the host and path-based routing.</p><ul><li>Path in URI: example.com<strong>/users</strong>, example.com<strong>/blogs</strong></li><li>Hostname: <strong>home.example.com</strong>, <strong>profile.example.com</strong></li><li>Query Strings / Parameters: example.com<strong>/users?id=3SD5GW</strong></li><li>Headers: <strong>User-Agent: *Andriod*</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*JzcR759cuMWdMaIH.png" /><figcaption><a href="https://aws.amazon.com/ko/blogs/aws/new-host-based-routing-support-for-aws-application-load-balancers/">https://aws.amazon.com/blogs/aws/new-host-based-routing-support-for-aws-application-load-balancers/</a></figcaption></figure><p>In this section, representing the three types of load balancers, we are going to see how routing tables and rules work and how we can route traffic to the target groups. Let’s review the below structure and look over the flow of incoming traffic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2cZmZroydTY818lz" /></figure><p>A request routed to /user from the web arrives at the ALB, and then the ALB forwards it to a target group that locates server instances running user applications.</p><p>To dive into the ALB, let’s review an example of setting up the process.</p><p>First, to organize the servers as target groups, server instances should be running.</p><p>Second, make the target groups according to the group of User applications and the group of Search applications.</p><p>Third, create an Application Load Balancer and configure listener rules to forward to appropriate target groups. The rules are defined like the route /user face towards a target group for the Users application, and the route /search face towards a target group for the Search application.</p><p>From a security point of view, we need to configure the target group to only open to the ALB, limiting the in-bound and out-bound networks. <strong>We should open the network as limited as possible, following the least privilege principle</strong>, which does not give more permissions than are needed.</p><h3>Network Load Balancer (NLB)</h3><p>The Network load balancer operates in <strong>Layer 4 </strong>(TCP &amp; UDP) of the<strong> </strong>ISO model. It allows forwarding of TCP and UDP traffic to your instances, which are below the application level. An NLB can handle millions of requests per second. Also, it demonstrates high performance, providing latency under 100 milliseconds. It is much faster than the ALB, which provides 400 milliseconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BWu961BLfb3bMhyG.png" /><figcaption><a href="https://aws.amazon.com/ko/elasticloadbalancing/">https://aws.amazon.com/elasticloadbalancing/</a></figcaption></figure><p>One must note that each NLB has one static IP per Availability Zone (AZ), and supports assigning Elastic IP. It can be helpful for whitelisting specific IP.</p><p>The NLB supports <strong>health checks</strong> to TCP, HTTP, and HTTPS protocols. The health check process is equal to that of the ALB.</p><h3>Gateway Load Balancer (GWLB)</h3><p>The gateway load balancer operates in <strong>Layer 3 </strong>(Network Layer) of the<strong> </strong>ISO model. This means that the GWLB allows IP packets and operates at <strong>the lowest level</strong> when compared to the preceding Load Balancers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YtilD4dAG8S1sWrS.png" /><figcaption><a href="https://aws.amazon.com/ko/elasticloadbalancing/">https://aws.amazon.com/elasticloadbalancing/</a></figcaption></figure><p>A GWLB helps distribute your incoming traffic across multiple targets in one or more Availability Zones. It monitors the health of its registered targets, and routes traffic only to the healthy targets.</p><p>It listens for all IP packets across all ports and forwards traffic to the target group that is specified in the listener rule. It maintains the stickiness of flows to a specific target appliance. The Gateway Load Balancer and its registered virtual appliance instances exchange application traffic using the <a href="https://datatracker.ietf.org/doc/html/rfc8926">GENEVE</a> protocol on port 6081.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=499d47eb958d" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/aws-elb-elastic-load-balancer-efficiently-distributing-incoming-network-traffic-499d47eb958d">AWS ELB: Elastic Load Balancer — efficiently distributing incoming network traffic</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS EBS — AWS Elastic Block Storage]]></title>
            <link>https://blog.devops.dev/aws-ebs-aws-elastic-block-storage-d8e5d326279c?source=rss-c4661bee7a84------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8e5d326279c</guid>
            <category><![CDATA[elastic-block-storage]]></category>
            <category><![CDATA[ebs-volume]]></category>
            <category><![CDATA[aws-ebs]]></category>
            <dc:creator><![CDATA[GyeongSeon (Sunny) Park]]></dc:creator>
            <pubDate>Tue, 14 Feb 2023 01:37:30 GMT</pubDate>
            <atom:updated>2023-02-14T17:52:35.183Z</atom:updated>
            <content:encoded><![CDATA[<h3>AWS EBS — AWS Elastic Block Storage</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qMVHbUgjIyugBNHgkNdMyQ.png" /></figure><p>Amazon Web Service provides a <strong>Elastic Block Storage (EBS) </strong>service, which is designed to function as storage for a single EC2 instance. If you have used an EC2 instance before, it is likely you have benefited from EBS already.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TKe_lSioXDdWVbG1.png" /><figcaption><a href="https://aws.amazon.com/ko/ebs/">https://aws.amazon.com/ko/ebs/</a></figcaption></figure><h3>EBS Volume — Overview</h3><p>There are three features that we will review in the EBS.</p><ul><li>A network driver, not a physical driver</li><li>Locked to Availability Zone (AZ)</li><li>Provisioned capacity</li></ul><p>First, EBS volume is a network driver, not a physical driver. Because of the network driver, there may be a bit of latency when communicating with an EC2 instance. Also, we can detach from an EC2 instance, and also attach it to another instance.</p><p>Second, EBS Volume is locked to an Availability Zone, so we cannot move an EBS to another AZ. For example, an EBS volume in ap-northeast-2a cannot be attached to ap-northeast-2b. However, you can move to another AZ across by making a snapshot of it. Regarding the EBS snapshot, we will explore this in the following section.</p><p>Third, in order to use EBS Volumes, you have to choose the EBS types among the types that have various performance and price policies. The EBS type has a specific capacity such as size in GiB and IOPS (I/O per second) and you will get billed corresponding to the specified specs. You can increase the volume size, change the volume type, or adjust the performance of your EBS volumes.</p><h3>Volume Types</h3><p>There are <strong>6 types </strong>of EBS volumes. First, You can choose <strong>gp2/gp3 </strong>or <strong>io1/io2</strong> as <strong>the SSD</strong>, and only these four types can be used as boot volumes for EC2 instances. Also, you can choose st1 and sc1 as HDD. Let’s review each item in more detail.</p><h4>1. General Purpose SSD: gp2 / gp3</h4><p>The General Purpose SSD volume has cost-effective storage and low latency. gp2 and gp3 balance price and performance for a wide variety of workloads. It can be used as System boot volumes, Virtual desktops, and Development / Test environments. The size can vary between one gigabyte to 16 terabytes.</p><p>There are some differences between gp2 and gp3. Because <strong>gp3 is a newer generation of volumes</strong>, if you use the gp series, you will most likely use gp3.</p><h4># gp3</h4><p>gp3 gives you a baseline of 3000 IOPS and a throughput of 125 megabytes per second. We can increase IOPS up to 16,000 and throughput up to 1000 megabytes per second independently. We can configure these settings in an independent way unlike with gp2.</p><h4># gp2</h4><p>For gp2, the baseline IOPS is 3000 and the maximum IOPS is 16,000. However, with gp2, volume and IOPS are linked and therefore cannot be configured independently. Because the size of the volume and the IOPS are linked, if you increase the size of your volume, then you’re going to get more IOPS.</p><h4>2. Provisioned IOPS (PIOPS) SSD: io1 / io2</h4><p>The provisioned IOPS SSD is for critical business applications with sustained IOPS performance. You can choose these types when you need a performance greater than 16,000 IOPS. So, it is great for database workloads because the databases require high storage performance and consistency. It can be used as a System boot volume. In addition, it is worth noting that it supports EBS Multi-attach which enables you to attach a single Provisioned IOPS SSD volume to multiple instances.</p><h4># io1</h4><p>io1 is the first generation of Provisioned SSDS, which can support between 4 TiB and 16 TiB. The max IOPS is 60,000 for Nitro EC2 instances, which gives you access to a higher level of IOPS, and a 32,000 IOPS maximum for others.</p><h4># io2</h4><p>io2 is a newer generation type, so it is most suitable to choose. It has improved durability and more IOPS per gigabyte at the same price as io1. io2 supports between 4 GiB and 64 terabytes and this gives you sub-millisecond latency. You’re going to get 256,000 IOPS maximum with a ratio of IOPS per gigabyte of one thousand per one.</p><p>Like gp3, you can increase PIOPS (io1 and io2) independently.</p><h4>3. Hard Disk Drives (HDD)</h4><p>The hard disk drives cannot be a boot volume; there are two types: Throughput Optimized HDD(st1) and Cold HDD (sc1).</p><p>First, st1 is a low-cost HDD volume designed for frequently accessed, throughput-intensive workloads.</p><p>Second, sc1 (HDD) is the lowest-cost HDD volume designed for less frequently accessed workloads.</p><h3>EBS Example attached to EC2 instances</h3><p>Let’s review the below diagram representing the relationship between EBS volumes and EC2 instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*h1F_0itXfKLTFU64.png" /><figcaption>Udemy — AWS Certified Solutions Architect Associate</figcaption></figure><p><strong>EBS is a network driver used by attaching to the EC2 instance</strong>, similar to plugging USB sticks, although not in physical form. In addition, it is very possible for us to have two EBS Volumes. But note that, EBS Volume can not be attached to two instances, except in case supporting Multi-Attach (io1/io2 family). Finally, it is possible for us to create EBS Volumes and leave them unattached. They don’t need to be necessarily attached to an EC2 instance, instead they can be attached on demand and that makes them very powerful.</p><h3>EBS Snapshots</h3><p>When you need to make a backup of your EBS volume at a point in time, you can make a snapshot of one point of your EBS volume. When you make a snapshot, it is not necessary to detach the volume to do a snapshot, but recommended by AWS. Also, by copying and restoring the snapshots to other AZs or Regions, you can use EBS that has the same syntax across AZ or Region.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8e5d326279c" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/aws-ebs-aws-elastic-block-storage-d8e5d326279c">AWS EBS — AWS Elastic Block Storage</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>