<?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 TechnoCraft on Medium]]></title>
        <description><![CDATA[Stories by TechnoCraft on Medium]]></description>
        <link>https://medium.com/@TechnoCraft?source=rss-eacdd28370d4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0OY3I8iMyL0ve3XD0PsA9A.png</url>
            <title>Stories by TechnoCraft on Medium</title>
            <link>https://medium.com/@TechnoCraft?source=rss-eacdd28370d4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 00:48:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@TechnoCraft/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[Designing Dark Mode That Scales]]></title>
            <link>https://medium.com/@TechnoCraft/designing-dark-mode-that-scales-57c3e32154ec?source=rss-eacdd28370d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/57c3e32154ec</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[dark-mode-design]]></category>
            <category><![CDATA[themes]]></category>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[TechnoCraft]]></dc:creator>
            <pubDate>Tue, 03 Feb 2026 12:21:01 GMT</pubDate>
            <atom:updated>2026-02-03T12:21:01.879Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Semantic color tokens for maintainable UI systems</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UlhRYkj9Ao7XHC7YJS4Cng.png" /></figure><p>Dark mode is easy to ship.<br>It’s hard to <strong>maintain</strong>.</p><p>Most teams build dark mode once, then slowly watch it decay. Colors get duplicated, components start overriding each other, and every new feature adds more exceptions. After a few months, nobody knows which color token is safe to touch anymore.</p><p>That’s not a theming issue.<br>That’s a <strong>system design issue</strong>.</p><p>If you want dark mode to scale, color must be treated like infrastructure — boring, predictable, and invisible.</p><p>This article shows the system that makes that possible.</p><p><strong>Who this is for:</strong><br>Frontend engineers, design system owners, and anyone maintaining large component libraries or multiple themes.</p><h3>The One Rule That Makes Dark Mode Scale</h3><p>Separate <strong>intent</strong> from <strong>value</strong>.</p><p>That’s it.</p><p>Components should never care about color values. They should only care about <em>meaning</em>.</p><p>When you make this separation, dark mode stops being a feature and starts being configuration.</p><blockquote><strong><em>If a component needs to know which theme it’s in, the system is already broken.</em></strong></blockquote><h3>The 3-Layer Token Architecture</h3><p>Every scalable theming system has three layers.</p><p>Anything else eventually collapses under its own weight.</p><h4>1. Primitive Palette (Raw Values)</h4><p>These are your raw color values.</p><pre>--p-grey-100: #f3f4f6;<br>--p-grey-900: #111827;<br><br>--p-blue-500: #3b82f6;<br>--p-blue-400: #60a5fa;<br><br>--p-red-600: #dc2626;<br>--p-red-400: #f87171;</pre><p>They are stable.<br>They rarely change.<br>Components never reference them directly.</p><p>Think of them as paint buckets in a warehouse.</p><h4>2. Semantic Tokens (Intent Layer)</h4><p>This is the API your UI uses.</p><p>Instead of values, you define meaning:</p><ul><li>text-primary</li><li>surface-default</li><li>border-subtle</li><li>action-primary</li></ul><p>Themes decide which primitive value each token maps to.<br>Components don’t care.</p><p>This is the most important layer in the entire system.</p><h4>3. Component Tokens (Escape Hatch)</h4><p>Some things don’t belong globally:</p><ul><li>charts</li><li>shadows</li><li>complex visuals</li></ul><p>That’s fine.</p><p>Use component tokens intentionally and sparingly, or you’ll recreate the mess you were trying to fix.</p><h3>Theme Switching Without Conditional Logic</h3><p>Theme switching is just remapping.</p><p>bg-page<br> light → #FFFFFF<br> dark → #121212</p><p>text-primary<br> light → #000000<br> dark → #F5F5F5</p><p>border-subtle<br> light → Grey 200<br> dark → Grey 700</p><p>action-primary<br> light → Blue 600<br> dark → Blue 400</p><p>Nothing else changes.</p><p>No component overrides.<br>No if (darkMode) logic.<br>No duplication.</p><h3>Three Rules That Save You Months Later</h3><p>These rules exist because every large system eventually learns them the hard way.</p><h4>1. Contrast Beats Brand Accuracy</h4><p>Brand colors that look great on white often fail on dark surfaces.</p><p>Desaturate them.<br>Adjust lightness.<br>Prioritize contrast.</p><p>Accessibility issues are system bugs, not design nitpicks.</p><h4>2. Lightness Communicates Elevation</h4><p>Shadows barely work in dark mode.</p><p>Elevated surfaces should be <em>lighter</em> than the background — not darker.</p><p>That’s how depth is perceived in low-light environments.</p><h4>3. Name by Intent, Not Appearance</h4><p>Never do this:</p><pre>text-white<br>bg-black<br>border-grey</pre><p>Do this instead:</p><pre>text-primary<br>text-inverse<br>text-on-brand</pre><p>If the name survives a theme change, it’s correct.</p><h3>The 90/10 Rule for Token Design</h3><p>You don’t need 100 tokens.</p><p>In real systems:</p><ul><li><strong>90% of your UI</strong> uses <strong>20–30 semantic tokens</strong></li><li><strong>10% of your UI</strong> needs component-level exceptions</li></ul><p>If everything needs a custom token, your semantic layer is too weak.</p><h3>A Minimal Token Set That Works in Real Apps</h3><p>This covers most products.</p><pre>:root {<br>  // ---- BACKGROUNDS ----<br>  --bg-page: #ffffff;           /* Main page background */<br>  --bg-surface: #ffffff;        /* Cards, panels, modals */<br>  --bg-surface-muted: #f5f5f5;  /* Subtle inset areas */<br>  --bg-overlay: rgba(0,0,0,0.5); /* Modal/drawer overlays */<br><br>  // ---- TEXT ----<br>  --text-primary: #0a0a0a;      /* Body text, headings */<br>  --text-secondary: #525252;    /* Subtitles, captions */<br>  --text-disabled: #a3a3a3;     /* Disabled text */<br>  --text-inverse: #ffffff;      /* Text on dark backgrounds */<br>  <br>  // ---- INTERACTION ----<br>  --interactive-primary: #2563eb;       /* Primary actions */<br>  --interactive-primary-hover: #1d4ed8;<br>  --interactive-secondary: #e5e5e5;     /* Secondary actions */<br>  --interactive-link: #2563eb;          /* Links */<br><br>  // ---- BORDERS &amp; FOCUS ----<br>  --border-default: #e5e5e5;    /* Standard borders */<br>  --border-strong: #a3a3a3;     /* Emphasis */<br>  --border-focus: #2563eb;      /* Focus rings */<br><br>  // ---- FEEDBACK ----<br>  --feedback-success: #16a34a;<br>  --feedback-error: #dc2626;<br>  --feedback-warning: #ea580c;<br>  --feedback-info: #0284c7;<br><br>  // ---- SHADOWS ----<br>  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);<br>  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);<br>}</pre><h4>The Simplest Possible Implementation</h4><p>You don’t need a framework to do this well.</p><pre>:root {<br>  --bg-page: #ffffff;<br>  --text-primary: #1a1a1a;<br>}<br><br>[data-theme=&#39;dark&#39;] {<br>  --bg-page: #121212;<br>  --text-primary: #f5f5f5;<br>}</pre><pre>.card {<br>  background: var(--bg-page);<br>  color: var(--text-primary);<br>}</pre><p>That’s the whole system.</p><h3>Make Dark Mode Boring</h3><p>When dark mode works, you don’t notice it.</p><p>It doesn’t break.<br>It doesn’t fight you.<br>It doesn’t require refactors.</p><p>Semantic color tokens turn theming into infrastructure — and infrastructure should always be boring.</p><p>If this saved you future pain, highlight a line or drop a clap so other developers can find it too.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57c3e32154ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Nitro: The Hidden Engine Powering Modern EC2 Performance]]></title>
            <link>https://medium.com/@TechnoCraft/aws-nitro-the-hidden-engine-powering-modern-ec2-performance-d2e1fc73ae1b?source=rss-eacdd28370d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2e1fc73ae1b</guid>
            <category><![CDATA[cloud-architecture]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[noisy-neighbors]]></category>
            <category><![CDATA[cloud-hypervisor]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[TechnoCraft]]></dc:creator>
            <pubDate>Wed, 28 Jan 2026 15:16:01 GMT</pubDate>
            <atom:updated>2026-01-28T15:16:01.820Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MoftaJiN6xDdQHpX582fVQ.png" /></figure><p>Amazon EC2 is the backbone of AWS cloud computing. When we launch an instance, it feels instantaneous, seamless, and powerful. Behind the scenes, however, a sophisticated stack of hardware, virtualization, and isolation mechanisms works together to deliver <strong>high performance, strong security, and predictable behavior</strong>.</p><p>At the heart of all this is the <strong>AWS Nitro System</strong> — a combination of purpose-built hardware and lightweight software that has fundamentally redefined how EC2 operates.</p><p>In this post, we’ll explore <strong>what Nitro is, how it works, and why problems like noisy neighbors and resource contention are mostly a thing of the past</strong>.</p><h3>1. The Physical Host: Where It All Begins</h3><p>Every EC2 instance ultimately runs on a <strong>physical host</strong> — essentially a high-performance server equipped with:</p><ul><li>Multiple CPUs with many cores</li><li>Hundreds of GBs (or even TBs) of RAM</li><li>High-speed network interface cards</li><li>Optional NVMe local storage</li><li><strong>Nitro hardware cards</strong> (for networking, storage, and security)</li></ul><p>A single host can run <strong>multiple EC2 instances</strong> using virtualization. Each instance behaves as if it owns the machine, while a <strong>hypervisor</strong> safely partitions CPU, memory, and I/O resources.</p><h3>2. The Nitro System: A High-Level Overview</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SnDc8MKor_zcLEKVMjGGEw.png" /><figcaption>AWS Nitro System architecture diagram</figcaption></figure><p>AWS Nitro is a <strong>hardware-accelerated platform</strong> that offloads most virtualization work from the main CPU:</p><h4>Dedicated Nitro Cards</h4><p>These specialized cards handle:</p><ul><li><strong>Networking:</strong> ENA, VPC traffic, bandwidth enforcement</li><li><strong>Storage:</strong> EBS I/O, encryption, and throttling</li><li><strong>Security:</strong> Isolation, encryption, and monitoring</li></ul><h4>Nitro Hypervisor</h4><p>The Nitro hypervisor is intentionally <strong>minimal</strong>:</p><ul><li>Schedules vCPUs</li><li>Enforces memory isolation</li><li>Leaves nearly all other work to hardware</li></ul><p><strong>Why this matters:</strong><br>Traditional hypervisors are software-heavy, which introduces CPU overhead, increases the attack surface, and can lead to unpredictable performance. Nitro moves these responsibilities into <strong>dedicated hardware</strong>, dramatically improving performance, security, and isolation.</p><h3>3. CPU Scheduling: How Instances Share Cores</h3><p>Each EC2 instance is allocated <strong>vCPUs</strong>, which are scheduled on physical CPU cores:</p><ul><li>The hypervisor schedules vCPUs using millisecond-level time slices</li><li><strong>Dedicated-core</strong> and <strong>bare metal</strong> instances provide exclusive access to physical cores</li><li><strong>Burstable instances</strong> are governed by CPU credits to prevent monopolization</li></ul><h4>Example: Two Instances Sharing One Core</h4><p>| Time Slice | Core Executes |<br>| — — — — — | — — — — — — — |<br>| 0–1 ms | Instance A |<br>| 1–2 ms | Instance B |<br>| 2–3 ms | Instance A |<br>| 3–4 ms | Instance B |</p><ul><li>Each instance experiences the CPU as “continuous”</li><li>Context switching is extremely fast (~10–100 ns)</li><li>Fair scheduling ensures predictable performance</li></ul><p><strong>Result:</strong> Consistent CPU behavior, even on shared hosts.</p><h3>4. Memory Isolation: Hardware-Enforced Sandboxing</h3><p>Nitro provides <strong>strong, hardware-level memory isolation</strong>, ensuring one instance cannot read or modify another’s memory:</p><ul><li>Each instance has its own <strong>virtual address space</strong></li><li>Hardware MMUs translate virtual addresses to physical memory</li><li>Nitro offloads memory protection from software to hardware</li></ul><p>Even if a guest OS is compromised, it <strong>cannot escape its memory sandbox</strong>, providing isolation that is extremely difficult to achieve with traditional software-only hypervisors.</p><h3>5. The Noisy Neighbor Problem — Largely Eliminated</h3><p>A “noisy neighbor” occurs when one tenant overuses shared resources, degrading performance for others. Nitro minimizes this risk at every layer:</p><ul><li><strong>CPU:</strong> Fair scheduling and dedicated cores prevent starvation</li><li><strong>Networking:</strong> Nitro hardware enforces bandwidth per instance</li><li><strong>Storage:</strong> EBS I/O limits are enforced in hardware</li></ul><p>With Nitro, EC2 performance is <strong>predictable, secure, and close to bare metal</strong>, even in multi-tenant environments.</p><h3>6. Bare Metal vs. Nitro-Powered Virtual Instances</h3><p>Nitro also enables <strong>bare metal EC2 instances</strong>, where workloads run directly on physical hardware — without a hypervisor layer.</p><h4>Benefits</h4><ul><li>Full access to CPU features</li><li>Maximum performance for latency-sensitive workloads</li><li>Strong security via Nitro hardware isolation</li></ul><h4>Trade-offs</h4><ul><li>One instance per host</li><li>Less flexibility for resizing and consolidation</li></ul><h3>7. Why Nitro Matters for Cloud Architects</h3><p>For architects and engineers, Nitro delivers:</p><ul><li><strong>Performance:</strong> Near bare-metal speed for compute, network, and storage</li><li><strong>Isolation:</strong> Hardware-enforced boundaries for CPU, memory, and I/O</li><li><strong>Security:</strong> Minimal hypervisor attack surface, no host OS exposure</li><li><strong>Predictability:</strong> Consistent performance without noisy neighbors</li></ul><p>In short, <strong>Nitro is the foundation that makes modern EC2 fast, safe, and reliable</strong> — enabling AWS to scale cloud workloads with confidence and consistency.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2e1fc73ae1b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CQRS and Event Sourcing: Does Data Size Become a Problem?]]></title>
            <link>https://medium.com/@TechnoCraft/cqrs-and-event-sourcing-does-data-size-become-a-problem-2335cdc77d3d?source=rss-eacdd28370d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/2335cdc77d3d</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[database-design]]></category>
            <category><![CDATA[event-sourcing]]></category>
            <category><![CDATA[cqrs]]></category>
            <dc:creator><![CDATA[TechnoCraft]]></dc:creator>
            <pubDate>Mon, 05 Jan 2026 12:30:14 GMT</pubDate>
            <atom:updated>2026-01-05T12:30:14.784Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hEtKclT8-E0hqo-36mKbvQ.png" /></figure><p>Command Query Responsibility Segregation (CQRS) and Event Sourcing are two architectural patterns that often come packaged together to build scalable, auditable, and high‑performance systems. But as soon as developers understand how these patterns work, a natural question arises:</p><p><strong>If we are storing <em>every</em> event forever, won’t the data size become too large? And won’t that cause performance problems?</strong></p><p>The short answer: <strong>Yes, event sourcing systems do store more data — but no, it’s not a practical problem when designed correctly.</strong> In fact, these systems are engineered to handle this characteristic exceptionally well.</p><p>This blog breaks down why.</p><h3>Understanding CQRS and Event Sourcing</h3><h3>CQRS: Separation for Efficiency</h3><p>CQRS divides the system into:</p><ul><li><strong>Command side</strong>: Handles writes and business logic</li><li><strong>Query side</strong>: Handles reads, optimized for fast and flexible data access</li></ul><p>This allows each side to scale independently and use different storage mechanisms.</p><h3>Event Sourcing: Storing Every Change</h3><p>Event Sourcing stores <em>all changes</em> as a sequence of events, rather than just the latest database row. The current state is derived by replaying these events.</p><p>The result is a perfect historical audit of everything that ever happened.</p><h3>Yes, Event Sourcing Uses More Storage</h3><p>At first glance, this feels risky:</p><ul><li>More events = more storage</li><li>More storage = more system weight</li><li>More system weight = more potential latency or cost</li></ul><p>But in practice, this is rarely a problem. Here are the reasons why.</p><h3>1. Events Are Small and Append‑Only</h3><p>Most domain events are tiny. A few hundred bytes, often less.</p><p>Even at high scale:</p><ul><li><strong>1 million events ≈ a few hundred MB</strong></li><li><strong>100 million events ≈ a few dozen GB</strong></li></ul><p>Modern databases easily handle this size — many CRUD systems grow far larger.</p><p>Append‑only writes are also incredibly efficient for most storage engines.</p><h3>2. Storage Is Cheap and Scales Easily</h3><p>Storage has become one of the cheapest architectural resources available.</p><p>Event stores — like EventStoreDB, DynamoDB streams, Kafka — are designed to scale:</p><ul><li>horizontally</li><li>reliably</li><li>inexpensively</li></ul><p>It’s far harder to scale a relational CRUD system with huge update-heavy tables than it is to scale an append-only event log.</p><h3>3. Snapshots Prevent Slow Rebuilds</h3><p>Event sourcing doesn’t replay millions of events every time.</p><p>It uses <strong>snapshots</strong>.</p><p>A snapshot captures the aggregate state at a moment in time:</p><pre>{<br>  &quot;balance&quot;: 4200,<br>  &quot;lastEventNumber&quot;: 29500<br>}</pre><p>Instead of replaying 29,500 events, you replay only the events <em>after</em> the snapshot.</p><p>This keeps startup and load times extremely fast even for massive systems.</p><h3>4. Old Events Can Be Archived</h3><p>Events are immutable, which means:</p><ul><li>You can move old events</li><li>You can compress them</li><li>You can store them in cold storage</li><li>You can delete them <em>once they are no longer needed for rebuilding</em></li></ul><p>Active systems only need:</p><ul><li>recent events in fast storage</li><li>all-time events in cheap archive</li></ul><p>This keeps primary data lean.</p><h3>5. Read Models Are Disposable and Rebuildable</h3><p>Read models (projections) don’t duplicate full history.</p><p>They store only what’s needed for fast queries:</p><ul><li>denormalized views</li><li>summaries</li><li>search indices</li><li>analytics tables</li></ul><p>If they are lost or corrupted, you just <strong>rebuild them from events</strong>.</p><p>This prevents unnecessary data growth.</p><h3>6. Event Streams Are Naturally Small</h3><p>A common misconception is that a single entity will accumulate millions of events.</p><p>In practice:</p><ul><li>Most aggregates have tens or hundreds of events</li><li>High-traffic aggregates might have thousands</li><li>If one grows too large, that’s a sign the model needs to be split</li></ul><p>Event sourcing encourages well‑bounded domain design.</p><h3>7. Event Stores Are Optimized for Large Logs</h3><p>Unlike relational databases, event stores are built to:</p><ul><li>Handle massive append-only logs</li><li>Use compression techniques</li><li>Store data in segments or chunks</li><li>Optimize sequential writes</li></ul><p>They operate efficiently even at billions of events.</p><p>This performance profile is better than update-heavy CRUD systems.</p><h3>So, Is Data Size a Problem?</h3><p><strong>Not really.</strong> It’s a characteristic to plan for, but not a bottleneck.</p><p>Event sourcing systems use more disk space, but they gain:</p><ul><li>perfect audit logs</li><li>traceability</li><li>time-travel debugging</li><li>flexible read model rebuilding</li><li>reliable history</li><li>scalable append-only writes</li></ul><p>These benefits easily outweigh the cost of additional storage.</p><h3>When Data Size Can Become a Problem</h3><p>Event sourcing may be overkill if:</p><ul><li>you do not require historical events</li><li>your domain is CRUD and simple</li><li>you don’t need auditability</li><li>your team is not ready to manage event schemas</li></ul><p>For the right use cases, however, event sourcing’s extra storage consumption is a feature — not a bug.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2335cdc77d3d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding CQRS and Event Sourcing: A Practical Guide for Modern Systems (With Examples)]]></title>
            <link>https://medium.com/@TechnoCraft/understanding-cqrs-and-event-sourcing-a-practical-guide-for-modern-systems-with-examples-2a4d9a9d7e4f?source=rss-eacdd28370d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a4d9a9d7e4f</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[cqrs]]></category>
            <category><![CDATA[domain-driven-design]]></category>
            <category><![CDATA[event-sourcing]]></category>
            <category><![CDATA[microservice-architecture]]></category>
            <dc:creator><![CDATA[TechnoCraft]]></dc:creator>
            <pubDate>Tue, 25 Nov 2025 17:07:26 GMT</pubDate>
            <atom:updated>2025-11-25T17:07:26.640Z</atom:updated>
            <content:encoded><![CDATA[<p>Modern systems need to deliver speed, scale, correctness, and a smooth user experience — even as business rules get more complex and data volume explodes. This is exactly where <strong>CQRS (Command Query Responsibility Segregation)</strong> and <strong>Event Sourcing</strong> shine.</p><p>These two architectural patterns help teams build systems that are reliable, auditable, scalable, and easier to evolve over time. Let’s explore them with clear examples that illustrate when — and how — they matter.</p><h3>1. What Is CQRS?</h3><p>CQRS separates <strong>commands</strong> (operations that change state) from <strong>queries</strong> (operations that read state).</p><h3>Traditional Approach Example</h3><p>Imagine a simple Orders table:</p><p>| OrderId | Status | Items | Total | CustomerId |</p><p>You use the same table for:</p><ul><li>Placing an order</li><li>Updating the order</li><li>Showing all orders</li><li>Displaying a customer’s order summary</li><li>Showing dashboard statistics</li></ul><p>As requirements grow, this single model becomes overloaded. Reads become slow because the schema isn’t optimized for them. Writes become complex because every change touches the same model.</p><h3>CQRS Example</h3><p>Under CQRS:</p><ul><li>The <strong>write model</strong> focuses on enforcing business rules<br> E.g., “You cannot pay for an order that isn’t submitted.”</li><li>The <strong>read model</strong> is optimised for UI queries<br> E.g., A customer order summary projection:<br>| CustomerId | RecentOrderCount | LastOrderDate | TotalSpent |</li></ul><p>This projection is fast to query because it is precomputed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UJcNs4lZuju47gus1hqhBQ.png" /><figcaption><strong>Command Query Responsibility Segregation Diagram</strong></figcaption></figure><h3>Real Example: E-Commerce Checkout</h3><p>Instead of reading order data from the same schema where you run complex validations:</p><ul><li><strong>Command Side:</strong> Receives AddItemToOrder or SubmitOrder commands, validates rules, updates domain state.</li><li><strong>Query Side:</strong> Reads from a projection like OrderDetailsView or OrdersByCustomer, optimized for quick UI rendering.</li></ul><p>This separation dramatically improves performance and clarity.</p><h3>2. What Is Event Sourcing?</h3><p>Event Sourcing stores <strong>a series of events</strong> instead of storing only the final state.</p><h3>Example</h3><p>Instead of updating Order.Status = &#39;Paid&#39;, you store:</p><ul><li>OrderCreated</li><li>ItemAdded</li><li>ItemAdded</li><li>OrderSubmitted</li><li>PaymentAuthorized</li></ul><p>Then the current state is rebuilt by replaying these events.</p><h3>State Reconstruction Example</h3><p>Replaying the above events yields:</p><ul><li>Items = 2</li><li>Status = Paid</li><li>TotalAmount = Computed from events</li></ul><p>This is exactly how Git works: commits (events) determine the final state of your repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-QM9KoFJBsZPrkaTKEywVg.png" /><figcaption>Event Sourcing Diagram</figcaption></figure><h3>3. Why CQRS and Event Sourcing Work So Well Together</h3><p>Commands produce events → Events build new read models → Queries read from these models.</p><h3>Example: Order Submitted Flow</h3><ol><li>User clicks <strong>Submit Order</strong></li><li>Command Side validates rules</li><li>Emits OrderSubmitted event</li><li>Read side projection updates:<br>- Customer dashboard<br>- Merchant order list<br>- Analytics metrics</li></ol><p>Each projector updates its own view independently. No coupling.</p><h3>4. Making Event Sourcing Practical (With Examples)</h3><h3>A. “Will event streams grow too large?”</h3><p>Yes, they grow — but that’s fine if you design aggregates correctly.</p><h3>Good Aggregate Example</h3><p>An <strong>Order</strong> aggregate:</p><ul><li>Typically 10–30 events</li><li>Short lifecycle</li><li>Predictable boundaries<br> → Example events: OrderCreated, ItemAdded, OrderCancelled</li></ul><h3>Bad Aggregate Example</h3><p>A <strong>Customer</strong> aggregate that:</p><ul><li>Stores login attempts</li><li>Stores address changes</li><li>Stores payment history</li><li>Stores browsing history</li><li>Stores notifications</li></ul><p>This will grow forever, become slow to replay, and violate aggregate rules.</p><h3>Better Alternative</h3><p>Split into:</p><ul><li>Customer Profile Aggregate</li><li>Payment Methods Aggregate</li><li>Notification Preferences Aggregate</li><li>Browsing Activity Stream (not an aggregate — just analytics events)</li></ul><h3>B. Snapshot Example</h3><p>If rebuilding 10,000 events becomes slow:</p><ul><li>Create a snapshot every 500 events</li><li>On load: replay 500 events instead of 10,000</li></ul><p>Most event stores support snapshots automatically.</p><h3>5. Practical CQRS + Event Sourcing Scenarios</h3><h3>Example 1: Banking / Wallet Systems</h3><p>Event Sourcing is ideal because:</p><ul><li>You must track every transaction</li><li>You need perfect audit trails</li></ul><p>Event stream for one wallet might be:</p><ul><li>WalletCreated</li><li>FundsDeposited(₹1000)</li><li>FundsWithdrawn(₹200)</li><li>FundsWithdrawn(₹500)</li></ul><p>Current balance is replayed or projected.</p><h3>Example 2: Inventory Systems</h3><p>Events like:</p><ul><li>StockAdded(10)</li><li>StockRemoved(3)</li><li>StockReserved(2)</li></ul><p>Produce accurate, real-time projections of remaining inventory.</p><h3>Example 3: IoT &amp; Telemetry</h3><p>Millions of events flow in:</p><ul><li>TemperatureReading(68 °C)</li><li>MachineStarted</li><li>MachineStopped</li></ul><p>Projections build dashboards and anomaly-detection statistics.</p><h3>6. Real-World Usage Examples</h3><h3>Netflix</h3><p>Netflix uses event-driven patterns for:</p><ul><li>User recommendations</li><li>Playback telemetry</li><li>Device state &amp; configuration</li><li>Data pipelines</li></ul><p>They project events into many different views — for mobile, web, TV apps, and real-time monitoring.</p><h3>Kafka-Based Systems</h3><p>Kafka topics act like event streams:</p><ul><li>Consumers replay events to rebuild state</li><li>Streams create projections/materialized views</li><li>Logs are append-only → natural event-sourcing model</li></ul><p>Example:</p><ul><li>“Orders” topic stores all order events</li><li>“OrdersByCustomer” is a projection stored in a separate database</li></ul><h3>EventStoreDB</h3><p>Purpose-built for Event Sourcing:</p><ul><li>Streams per aggregate (order-123, wallet-999)</li><li>Subscriptions for building projections</li><li>Built-in idempotency and concurrency checks</li></ul><p>Used in finance, logistics, gaming, and IoT platforms.</p><h3>7. When to Use CQRS + Event Sourcing</h3><h3>Great Fit</h3><p>✔ Complex business workflows<br> ✔ Need for a perfect audit log<br> ✔ Event-driven architecture<br> ✔ Highly scalable read models<br> ✔ Multiple external integrations</p><h3>Avoid When</h3><p>✘ You just need basic CRUD<br> ✘ Domain logic is trivial<br> ✘ Team lacks event-driven experience<br> ✘ Replaying past data offers no real benefits</p><h3>Conclusion</h3><p>CQRS and Event Sourcing are not silver bullets — but when they fit, they can fundamentally transform how you build systems.</p><p>They bring:</p><ul><li>Clarity through separation of commands and queries</li><li>Rich history and auditability through events</li><li>Scalable and customizable read models</li><li>Easier debugging, replay, and future evolution</li></ul><p>With real-world backing from Netflix, Kafka ecosystems, and EventStoreDB-powered platforms, these patterns have proved their value at extreme scale.</p><p>Used thoughtfully, CQRS and Event Sourcing help you build systems that model real-world workflows more naturally, deliver better performance, and remain adaptable as business needs change.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a4d9a9d7e4f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Out-of-Vocabulary (OOV) Words in NLP]]></title>
            <link>https://medium.com/@TechnoCraft/understanding-out-of-vocabulary-oov-words-in-nlp-c67846a01b85?source=rss-eacdd28370d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/c67846a01b85</guid>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[out-of-vocabulary]]></category>
            <category><![CDATA[tokenization]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[TechnoCraft]]></dc:creator>
            <pubDate>Thu, 25 Sep 2025 14:32:24 GMT</pubDate>
            <atom:updated>2025-09-25T14:32:24.973Z</atom:updated>
            <content:encoded><![CDATA[<p>When working with Natural Language Processing (NLP), one recurring challenge is dealing with <strong>out-of-vocabulary (OOV)</strong> words. These are words that a model has never encountered during training but appear during inference or real-world usage. Let’s explore what OOV means, why it’s a problem, and how modern techniques — particularly <strong>subword tokenization</strong> — address it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NWM_rPhPDb7XinQjvgu1-w.png" /></figure><h3>What Are Out-of-Vocabulary Words?</h3><p>Every NLP model is trained on a <strong>fixed vocabulary</strong> derived from the training dataset. If a word outside this vocabulary shows up during testing or deployment, it’s classified as <strong>out-of-vocabulary (OOV)</strong>. Since the model has no learned representation for the word, it cannot interpret or process it directly.</p><p><strong>Example:</strong><br> If the training data contains words like cat, dog, and bird, but during inference the input contains kitten, the word kitten would be considered OOV.</p><h3>Why OOV Is a Problem</h3><p>OOV words introduce several issues:</p><ol><li><strong>Loss of Meaning</strong> — The model cannot assign embeddings to the new word.</li><li><strong>Performance Degradation</strong> — Tasks like translation, sentiment analysis, or speech recognition suffer when unknown words appear.</li><li><strong>Domain Mismatch</strong> — Models trained on one domain (e.g., news) may not recognize jargon from another (e.g., medicine or gaming).</li><li><strong>Named Entities &amp; Trends</strong> — New names, slang, or brand terms appear rapidly and may be unseen in training data.</li></ol><p><strong>Example in Machine Translation:</strong><br> If we try to translate <em>“I love jalebi”</em> to French, but jalebi is OOV, the model may output:<br> &quot;J&#39;aime UNK&quot; (losing the meaning entirely).</p><h3>Examples of OOV Words</h3><ul><li>Slang: <em>yeet</em>, <em>sus</em>, <em>glow-up</em></li><li>Tech terms: <em>NFTs</em>, <em>chatbotting</em>, <em>blockchainify</em></li><li>Names: <em>Zomato</em>, <em>TikTok</em>, <em>Elon</em></li><li>Domain-specific words: <em>myocardial infarction</em> (medical)</li><li>Foreign words: <em>schadenfreude</em>, <em>jalebi</em>, <em>kimchi</em></li></ul><h3>Addressing OOV Words in NLP</h3><h3>1. Subword Tokenization</h3><p>Instead of treating words as atomic units, subword tokenization splits them into smaller, reusable chunks:</p><p><strong>Example:</strong></p><ul><li><em>“unhappiness”</em> → [&quot;un&quot;, &quot;happiness&quot;]</li><li><em>“nationalization”</em> → [&quot;nation&quot;, &quot;al&quot;, &quot;ization&quot;]</li><li><em>“bookstore”</em> → [&quot;book&quot;, &quot;store&quot;]</li></ul><p>This approach allows models to:</p><ul><li>Handle unseen words by breaking them into known subwords.</li><li>Reuse familiar components (prefixes, roots, suffixes).</li><li>Reduce reliance on &lt;UNK&gt; tokens.</li></ul><h3>2. Character-Level Tokenization</h3><p>When even subwords don’t help, tokenizers may split into characters:</p><ul><li><em>“gluff”</em> → [&quot;g&quot;, &quot;l&quot;, &quot;u&quot;, &quot;f&quot;, &quot;f&quot;]</li><li><em>“squindle”</em> → [&quot;s&quot;, &quot;q&quot;, &quot;u&quot;, &quot;i&quot;, &quot;n&quot;, &quot;d&quot;, &quot;l&quot;, &quot;e&quot;]</li></ul><p>This guarantees every word can be represented, but at the cost of losing higher-level meaning.</p><h3>3. Contextual Embeddings (Transformers)</h3><p>Modern models like <strong>BERT</strong> and <strong>GPT</strong> don’t just look at isolated words — they rely on <em>context</em>. Through self-attention, they generate embeddings based on surrounding tokens.</p><ul><li>Example sentence: <em>“The gluff quickly jumped over the squindle.”</em></li><li>Even if <em>“gluff”</em> and <em>“squindle”</em> are OOV, the model sees surrounding words like <em>“quickly”</em>, <em>“jumped”</em>, <em>“over”</em>.</li><li>From context, it infers that <em>“gluff”</em> and <em>“squindle”</em> are likely nouns (objects/creatures).</li></ul><p>Thus, embeddings are <strong>contextualized</strong>, not static — making OOV handling much more robust.</p><h3>4. Fallback to Special Tokens</h3><p>Some models still use &lt;UNK&gt; or &lt;OOV&gt; tokens when words can’t be decomposed.</p><ul><li><em>“The gluff jumped”</em> → <em>“The </em><em>&lt;UNK&gt; jumped”</em></li><li>This approach signals an unknown word but is less informative than contextual embeddings.</li></ul><h3>5. Subword Composition and Generalization</h3><p>Even when subwords don’t have inherent meaning (like <em>“gl”</em> in <em>“gluff”</em>), models learn statistical patterns from large datasets:</p><ul><li>Recognizing familiar prefixes, suffixes, or phonetic structures.</li><li>Generalizing across words with similar patterns.</li></ul><h3>6. Training on Massive Data</h3><p>Finally, exposure to <strong>huge datasets</strong> makes models better at guessing meanings of unseen words:</p><ul><li>Rare words, typos, or fictional terms may resemble known words.</li><li>The model can infer approximate meanings by analogy.</li></ul><h3>Key Takeaways</h3><ul><li>OOV words break traditional NLP models.</li><li>Subword tokenization reduces OOV frequency by reusing smaller units.</li><li>When subwords themselves are OOV, character-level modeling and contextual embeddings help.</li><li>Self-attention and training on massive datasets allow modern models to infer meaning even for completely unseen words.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c67846a01b85" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How We Built a Smart Jira Assistant with RAG Technology]]></title>
            <link>https://medium.com/@TechnoCraft/how-we-built-a-smart-jira-assistant-with-rag-technology-cf5f49f9b04d?source=rss-eacdd28370d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf5f49f9b04d</guid>
            <category><![CDATA[llm-applications]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[jira]]></category>
            <dc:creator><![CDATA[TechnoCraft]]></dc:creator>
            <pubDate>Wed, 03 Sep 2025 12:44:34 GMT</pubDate>
            <atom:updated>2025-09-03T12:58:32.950Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How we combined real-time data and historical insights to create an intelligent Jira assistant using Retrieval-Augmented Generation (RAG)</em></p><h3>Introduction</h3><p>In today’s fast-paced software development world, project managers and developers are drowning in Jira data. With thousands of tickets spanning years, it’s hard to see the big picture. Real-time Jira searches give only a snapshot of the present — without the historical trends and patterns needed for better decision-making.</p><p>We set out to solve this problem by building an <strong>AI-powered Jira Assistant</strong> using <strong>Retrieval-Augmented Generation (RAG)</strong>. Our solution combines <strong>live Jira API data</strong> with a <strong>historical vector store</strong>, enabling natural language queries that instantly deliver context-rich answers about project health, trends, and specific issues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7u6JB_M01psAkVqBUV_ilQ.png" /></figure><h3>The Problem: Too Much Data, Not Enough Insight</h3><h3>Challenges We Faced</h3><ul><li><strong>Missing historical perspective</strong> — Real-time queries don’t reveal long-term patterns.</li><li><strong>Rigid search experiencec</strong> — Jira’s search is powerful but doesn’t understand natural language.</li><li><strong>Scattered insights</strong> — Data lives in multiple dashboards and reports.</li><li><strong>Scaling struggles</strong> — 30,000+ tickets across years is hard to manage efficiently.</li></ul><h3>Why Traditional Solutions Fall Short</h3><ul><li><strong>Manual analysis</strong> — Slow, tedious, and error-prone.</li><li><strong>Static reports</strong> — Outdated as soon as they’re generated.</li><li><strong>Limited integration</strong> — Hard to combine live and historical data seamlessly.</li></ul><h3>Our Solution: Hybrid RAG Architecture</h3><h3>What is RAG Technology?</h3><p><strong>Retrieval-Augmented Generation (RAG)</strong> blends two powerful AI steps:</p><ol><li><strong>Retrieval</strong> — Pulling relevant information from a knowledge base.</li><li><strong>Generation</strong> — Using a large language model (LLM) to create a coherent, contextual answer.</li></ol><p>This ensures responses are based on <em>real data</em>, not just the LLM’s training.</p><h3>Architecture Overview</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DnXRXHkppIMhETOcj2YcVg.jpeg" /><figcaption>Application Architecture</figcaption></figure><p>Application Architecture</p><p><strong>In short:</strong> Jira data is ingested, transformed into embeddings, and stored in FAISS for similarity search. When a query is made, it is processed to fetch either real-time data or historical data, depending on the query type. This retrieved data is then provided to a large language model (LLM) along with the query to generate a response.</p><h3>Key Components</h3><h3>1. Hybrid Data Sources</h3><ul><li><strong>Real-time Jira API</strong> — Live issue status, assignee, priority.</li><li><strong>Vector store</strong> — Historical data embedded for semantic search.</li><li><strong>Smart query routing</strong> — Decides whether to use live or stored data.</li></ul><h3>2. Intelligent Ingestion Pipeline</h3><ul><li>Bulk processing for 30,000+ historical tickets with date-based batching.</li><li>Incremental updates for new or modified issues.</li><li>Automatic garbage collection to manage memory.</li></ul><h3>3. Vector Search Engine</h3><ul><li><strong>FAISS index</strong> for high-performance similarity search.</li><li><strong>Sentence Transformers</strong> for local embeddings (privacy-friendly).</li><li>Metadata preserved during chunking for accurate context retrieval.</li></ul><h3>Technical Deep Dive</h3><h3>Technology Stack</h3><pre>langchain&gt;=0.1.0                 # LLM orchestration<br>sentence-transformers&gt;=2.2.2     # Local embeddings<br>faiss-cpu&gt;=1.7.4                 # Vector search<br>jira&gt;=3.5.2                      # Jira API integration<br>streamlit&gt;=1.29.0                # Web interface</pre><h3>Smart Query Detection</h3><p>Our system automatically determines whether a query requires <strong>real-time Jira data</strong> or <strong>historical vector search</strong>.</p><pre>def is_realtime_query(query: str) -&gt; bool:<br>    &quot;&quot;&quot;Check if a query requires live Jira data.&quot;&quot;&quot;<br>    patterns = [<br>        r&#39;JRA-\d+&#39;,<br>        r&#39;status of&#39;,<br>        r&#39;who is assigned&#39;,<br>        r&#39;current&#39;,<br>    ]<br>    return any(re.search(p, query, re.IGNORECASE) for p in patterns)</pre><p>Currently, this detection uses <strong>pattern matching</strong> for speed and simplicity.<br> However, this could be replaced with a <strong>small, fine-tuned LLM</strong> in the future for more flexible and accurate query classification, especially for complex or ambiguous natural language requests.</p><h3>Chunking Strategy</h3><ul><li>800-character chunks with 100-character overlap.</li><li>Sentence and paragraph boundaries respected.</li><li>Metadata preserved for contextual answers.</li></ul><h3>Bulk Historical Ingestion</h3><pre># Process 3 years of data<br>python3 bulk_ingest.py --project JRA --years 3 --batch-size 500 --batch-days 15</pre><pre># Resume if interrupted<br>python3 bulk_ingest.py --project JRA --years 3 --resume</pre><p><strong>Key Features:</strong><br> ✅ Date-based batching<br> ✅ Progress tracking with ETA<br> ✅ Resume on failure<br> ✅ Automatic cleanup</p><h3>Real-World Usage Examples</h3><p><strong>1. Real-time Status</strong></p><pre>python3 query_assistant.py --query &quot;What is the status of JRA-7266?&quot;</pre><p><strong>2. Historical Analysis</strong></p><pre>python3 query_assistant.py --query &quot;Show me all issues related to performance problems&quot;</pre><p><strong>3. Project Health</strong></p><pre>python3 query_assistant.py --analyze-project JRA</pre><h3>Deployment Strategies</h3><p><strong>Automated Updates with Cron</strong></p><pre>./setup_cron.sh</pre><p><strong>Environment Configuration</strong></p><pre>JIRA_URL=https://your-domain.atlassian.net<br>JIRA_USER=your-email@example.com<br>JIRA_TOKEN=your-api-token<br>LLM_MODEL=gemini-2.5-flash<br>EMBED_MODEL_NAME=sentence-transformers/all-MiniLM-L6-v2<br>CHUNK_SIZE=800<br>CHUNK_OVERLAP=100</pre><h3>Performance and Scalability</h3><ul><li><strong>Memory management</strong> — Batching + garbage collection.</li><li><strong>Search speed</strong> — FAISS-optimized vector lookups.</li><li><strong>Rate limiting</strong> — Jira API retries with graceful recovery.</li></ul><h3>Impact</h3><p><strong>Before →</strong> <strong>After</strong> <br>2–3 hours per project review → Instant query responses <br>Surface-level reports → Rich insights + historical context<br>No trend analysis → Proactive issue prevention<br>Manual status checks → Automated, natural language answers</p><p><strong>Results:</strong></p><ul><li>Query response time: &lt;5s</li><li>Coverage: 30,000+ tickets</li></ul><h3>Lessons Learned</h3><ol><li><strong>Data quality first</strong> — Validate API responses, maintain vector integrity.</li><li><strong>Memory management matters</strong> — Use date-based batching.</li><li><strong>UX drives adoption</strong> — CLI + web UI + progress indicators.</li><li><strong>Security</strong> — Local embeddings, secure API key storage.</li></ol><h3>Future Enhancements</h3><ul><li>Multi-project support</li><li>Predictive analytics for issue trends</li><li>Integration with other PM tools</li><li>Mobile-friendly UI</li></ul><h3>Conclusion</h3><p>The Jira Assistant shows that <strong>RAG is not just a research concept — it’s a practical enterprise tool</strong>. By combining live and historical data, it provides instant, context-rich insights that improve project management decision-making.</p><p><strong>Key Takeaways:</strong></p><ul><li>RAG + hybrid data = better answers</li><li>Efficient processing ensures adoption</li><li>UX is just as important as accuracy</li></ul><p><strong>Technologies Used</strong>: Python, LangChain, FAISS, Sentence Transformers, Jira API, Streamlit</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf5f49f9b04d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FAISS and the World of Vector Databases: Powering AI Search at Scale]]></title>
            <link>https://medium.com/@TechnoCraft/faiss-and-the-world-of-vector-databases-powering-ai-search-at-scale-512ec5ea8209?source=rss-eacdd28370d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/512ec5ea8209</guid>
            <category><![CDATA[faiss]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[vector-database]]></category>
            <category><![CDATA[vector-search]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <dc:creator><![CDATA[TechnoCraft]]></dc:creator>
            <pubDate>Wed, 27 Aug 2025 09:17:25 GMT</pubDate>
            <atom:updated>2025-08-27T09:17:25.855Z</atom:updated>
            <content:encoded><![CDATA[<p>In the AI era, search is no longer just about matching keywords. Whether you’re finding similar images, retrieving documents with the same meaning, or building recommendation systems, modern search relies on <strong>vector embeddings</strong> — numerical representations of data in high-dimensional space.</p><p>But storing and searching millions or billions of these vectors quickly is no easy task.<br> That’s where <strong>FAISS</strong> (Facebook AI Similarity Search) and other vector databases come in.</p><h3>What is FAISS?</h3><p>FAISS, developed by <strong>Meta AI</strong>, is an open-source library for <strong>efficient similarity search and clustering of dense vectors</strong>.<br> It’s designed to answer one powerful question:<br> <em>“Given a vector, what are the most similar vectors in my dataset?”</em></p><h3>How FAISS Works</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kPbjd280U3IFWy_Y4IvhRw.png" /><figcaption>Working of FAISS</figcaption></figure><p>FAISS itself doesn’t create vectors — that’s the job of an <strong>embedding model</strong>. Instead, FAISS stores and searches them efficiently. Here’s the process:</p><p><strong>Step 1 — Convert data into vectors:</strong><br> Text, images, or audio are transformed into embeddings — arrays of numbers that capture meaning. For example, the sentences “AI is amazing” and “Artificial intelligence is great” will have embeddings that are close together in vector space.</p><p><strong>Step 2 — Choose an index type:</strong></p><ul><li>Flat index for exact search.</li><li>IVF (Inverted File) for clustering and faster searches on huge datasets.</li><li>PQ (Product Quantization) for compression and memory savings.</li><li>HNSW (Hierarchical Navigable Small World) for fast approximate searches.</li></ul><p><strong>Step 3 — Search efficiently:</strong><br> A query is also turned into a vector. FAISS compares it to stored vectors using similarity measures like cosine similarity or Euclidean distance, returning the most similar matches in milliseconds.</p><p><strong>Step 4 — Accelerate with GPU:</strong><br> FAISS supports CUDA-based GPU search, allowing billions of comparisons per second.</p><h3>Major Applications of FAISS</h3><p>FAISS is used in many AI-powered applications, including:</p><ul><li>Semantic search to find results based on meaning, not just keywords.</li><li>Image and video retrieval to locate visually similar content.</li><li>Recommendation systems that suggest similar products, movies, or music.</li><li>Document retrieval for AI assistants that need context.</li><li>Duplicate and near-duplicate detection in large datasets.</li><li>Anomaly detection to identify unusual patterns.</li><li>Audio and music search to match similar sound patterns.</li><li>Large-scale clustering for machine learning preprocessing.</li></ul><h3>FAISS vs Other Vector Stores</h3><p>FAISS is incredibly fast and supports GPU acceleration, but it is not a full database. You must handle persistence, scaling, and metadata filtering yourself.<br> Other vector databases take a different approach:</p><p><strong>Pinecone</strong><br> Fully managed cloud service. Easy setup, automatic scaling, metadata filtering. Great for production systems that need zero infrastructure management.</p><p><strong>Weaviate</strong><br> Open source with a managed option. Offers built-in vectorization modules, hybrid (keyword + vector) search, and rich metadata filtering. Good for flexible deployments.</p><p><strong>Milvus</strong><br> Distributed open-source database built for billions of vectors. Strong scaling capabilities and supports multiple indexing methods. Ideal for enterprise-scale vector search.</p><p><strong>Chroma</strong><br> Simple, developer-friendly open source store. Great for prototyping and smaller apps, with easy integration into Python workflows.</p><h3>When to Choose Which</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*rzYrJ4G0Wqm67JbU0xuP-A.png" /><figcaption>Comparison of Vector Stores</figcaption></figure><ul><li>Choose <strong>FAISS</strong> if you want maximum speed, GPU acceleration, and control over infrastructure.</li><li>Choose <strong>Pinecone</strong> if you prefer a managed cloud service with no setup hassle.</li><li>Choose <strong>Weaviate</strong> if you want open-source flexibility with hybrid search capabilities.</li><li>Choose <strong>Milvus</strong> if you need to handle billions of vectors in a distributed system.</li><li>Choose <strong>Chroma</strong> if you are prototyping or building small to medium-scale applications.</li></ul><h3>Why FAISS Stands Out</h3><p>FAISS remains one of the fastest and most flexible vector search tools available. Its C++ core with Python bindings delivers outstanding performance, and its indexing options let you balance speed, accuracy, and memory usage. For research, experimentation, or production systems with custom infrastructure, FAISS is hard to beat.</p><h3>Final Thoughts</h3><p>Vector search is becoming a key building block of AI-driven applications. While managed databases offer convenience, FAISS offers unmatched speed and flexibility for teams ready to manage their own systems. From semantic search to recommendation engines, it’s a proven technology powering some of the most advanced AI systems in production today.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=512ec5ea8209" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Event-Driven Architecture (EDA): The Future of Reactive Systems]]></title>
            <link>https://medium.com/@TechnoCraft/event-driven-architecture-eda-the-future-of-reactive-systems-012eb56900a7?source=rss-eacdd28370d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/012eb56900a7</guid>
            <category><![CDATA[event-driven-architecture]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[realtime-applications]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[TechnoCraft]]></dc:creator>
            <pubDate>Mon, 11 Aug 2025 12:36:17 GMT</pubDate>
            <atom:updated>2025-08-11T12:36:17.995Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s always-connected world, people expect systems to respond as quickly as they think. Imagine ordering food through a delivery app: the moment you hit “Place Order,” you instantly see the restaurant confirm it, your delivery time updates in real-time, and a driver gets assigned within seconds — all without you refreshing the page. Behind the scenes, this seamless magic is often powered by <strong>Event-Driven Architecture (EDA)</strong>, where every action triggers a chain of automated, lightning-fast reactions.</p><p>EDA isn’t just a buzzword; it’s a proven architectural style used by tech giants like Amazon, Netflix, and Uber to build <strong>scalable, resilient, and real-time systems</strong>. Let’s unpack how it works, where it shines, and when you should (and shouldn’t) use it.</p><h3>What is Event-Driven Architecture?</h3><p>At its core, Event-Driven Architecture is a design pattern where the <strong>flow of the application is determined by events</strong> — signals that <em>something happened</em>.</p><p>An <strong>event</strong> can be anything meaningful to your business: a user signs up, a payment is processed, a temperature sensor detects a change, or a player scores a goal in an online game.</p><p>Instead of one service directly telling another what to do, <strong>events are published</strong> to a central system, and other services <strong>react</strong> to them asynchronously.</p><h3>Basic Flow of Event-Driven Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9nk2YaF_ip4GrcNAO-cSTA.png" /><figcaption><em>Figure: A simple EDA setup where an Event Producer sends data to an Event Broker, which then distributes it to multiple Event Consumers.</em></figcaption></figure><h3>Key Components</h3><p><strong>Event</strong><br>A record of something that happened, such as “order_placed”, “user_registered”, or “payment_failed”.</p><p><strong>Event Producer</strong><br>The system or service that generates the event. For example, a checkout service emitting “order_placed” when a customer completes payment.</p><p><strong>Event Broker</strong><br>Middleware that routes events from producers to consumers. Examples include <strong>Apache Kafka</strong>, <strong>RabbitMQ</strong>, <strong>AWS SNS/SQS</strong>, and <strong>Azure Event Grid</strong>. Think of it as a <em>postal service for events</em>.</p><p><strong>Event Consumer</strong><br> A service that listens for specific events and takes action. For example, a notification service sends an email after “user_registered”. Another example: an inventory service updates stock after “order_placed”.</p><h3>EDA in Action — Example Scenario</h3><p>Let’s revisit an <strong>e-commerce order flow</strong>.</p><p><strong>Traditional Approach</strong><br><em>Checkout calls Payment → Payment calls Inventory → Inventory calls Notification.</em><br> Each step happens in sequence, and if one service fails, the whole process stalls.</p><p><strong>EDA Approach</strong><br> Checkout publishes “order_placed”.<br> From there, Inventory Service reduces stock. Payment Service processes the charge. Notification Service sends a confirmation email. Analytics Service logs purchase trends.</p><p>None of these services depend on each other — they only care about the event.</p><h3>EDA vs. Traditional Request–Response Architecture</h3><p>Feature <strong>Traditional / Request–Response</strong> <strong>Event-Driven Architecture</strong> <strong>Communication</strong> Direct API calls Publish/subscribe via broker <strong>Coupling</strong> Tight Loose <strong>Scalability</strong> Scale entire app Scale individual components <strong>Consistency</strong> Immediate Eventual <strong>Complexity</strong> Simpler More complex (async flows) <strong>Resilience</strong> Failure can break chain Broker can store/retry events</p><h3>Advantages of EDA</h3><ul><li>Loose coupling — Components evolve independently.</li><li>High scalability — Only scale services under heavy load.</li><li>Real-time processing — Instant reactions to user actions or system events.</li><li>Extensibility — Add new consumers without touching existing ones.</li><li>Resilience — Consumers can recover missed events via broker replay.</li></ul><h3>Disadvantages of EDA</h3><ul><li>Complex debugging — Harder to trace an async event flow.</li><li>Ordering issues — Events may arrive in a different sequence.</li><li>Eventual consistency — Not ideal for strict transactional guarantees.</li><li>Infrastructure overhead — Requires message brokers and monitoring.</li><li>Testing challenges — Simulating event-driven systems is harder.</li></ul><h3>When to Use EDA</h3><ul><li>E-commerce platforms for order updates and inventory management.</li><li>Real-time analytics and dashboards.</li><li>IoT systems such as sensor alerts or automation triggers.</li><li>Financial fraud detection.</li><li>Multiplayer gaming events.</li><li>Microservices needing loose coupling.</li></ul><h3>When NOT to Use EDA</h3><ul><li>Applications that are simple CRUD with no real-time needs.</li><li>Systems requiring strong, immediate consistency such as core banking balances.</li><li>Workflows that are linear and predictable.</li><li>Projects without budget or DevOps expertise to manage brokers.</li></ul><h3>Hybrid Approach — The Best of Both Worlds</h3><p>Many modern systems blend EDA with traditional architecture.<br> Critical transactions (such as payment confirmations) can remain synchronous.<br> Non-critical tasks (such as sending emails or logging analytics) can be offloaded to event-driven flows.</p><p>This gives scalability where it’s needed without overwhelming the system with async complexity.</p><h3>Conclusion</h3><p>Event-Driven Architecture offers a flexible, scalable, and real-time approach to building modern systems — but it’s not a silver bullet. The right choice depends on your application’s complexity, performance needs, and operational capabilities.</p><p>If your system needs to be fast, scalable, and easily extendable, EDA is worth serious consideration. Otherwise, a traditional or hybrid approach might suit you better.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=012eb56900a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Perform a Clean and Proper Installation of Cursor AI on Ubuntu 20.04]]></title>
            <link>https://medium.com/@TechnoCraft/how-to-perform-a-clean-and-proper-installation-of-cursor-ai-on-ubuntu-20-04-73ee5fa54060?source=rss-eacdd28370d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/73ee5fa54060</guid>
            <category><![CDATA[software-installation]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[cursor-ai]]></category>
            <category><![CDATA[cursor]]></category>
            <category><![CDATA[appimage]]></category>
            <dc:creator><![CDATA[TechnoCraft]]></dc:creator>
            <pubDate>Tue, 05 Aug 2025 17:19:58 GMT</pubDate>
            <atom:updated>2025-08-05T17:19:58.835Z</atom:updated>
            <content:encoded><![CDATA[<p>Installing <strong>Cursor AI</strong> on Ubuntu 20.04 isn’t difficult — but doing it cleanly, safely, and in a way that integrates well with your system takes a bit of care.</p><p>Since Cursor AI is distributed as an <strong>AppImage</strong> — a portable, self-contained application bundle — we’ll walk through a user-focused installation method that:</p><ul><li>Keeps your system organized</li><li>Avoids root or sudo unless necessary</li><li>Lets you <strong>launch from the app menu</strong> or <strong>terminal</strong></li><li>Enables <strong>automatic updates</strong> through the built-in updater</li></ul><p>Let’s get started.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t9HNUTzp5M0ud-l17jtbEg.png" /></figure><h3>✅ Prerequisites</h3><p>Before anything else, install libfuse2 — a required dependency for many AppImages on Ubuntu 20.04:</p><pre>sudo apt update<br>sudo apt install libfuse2</pre><h3>📥 Step 1: Download and Organize the AppImage</h3><p>We’ll keep things tidy by creating a user-level ~/Applications folder just for Cursor AI.</p><p>First, download the Cursor AI AppImage from the official <a href="https://www.cursor.so/">Cursor AI website</a> and save it to your Downloads folder.</p><p>Next, create a dedicated folder for Cursor AI:</p><pre>mkdir -p ~/Applications/cursor</pre><p>Move the downloaded AppImage to the new folder and rename it:</p><pre>mv ~/Downloads/cursor-*.AppImage ~/Applications/cursor/cursor.AppImage</pre><p>If you have an icon file (cursor.png), move it to the same folder:</p><pre>mv ~/Downloads/cursor.png ~/Applications/cursor/cursor.png</pre><p>Finally, make the AppImage executable:</p><pre>chmod +x ~/Applications/cursor/cursor.AppImage</pre><h3>🖥 Step 2: Add Cursor AI to Your Application Menu</h3><p>To integrate Cursor AI into your system menu, you’ll create a .desktop launcher.</p><p>Create the file using a text editor:</p><pre>nano ~/.local/share/applications/cursor.desktop</pre><p>Paste the following content:</p><pre>[Desktop Entry]<br>Name=Cursor AI<br>Exec=/home/your_username/Applications/cursor/cursor.AppImage --no-sandbox<br>Icon=/home/your_username/Applications/cursor/cursor.png<br>Type=Application<br>Categories=Development;</pre><p>Replace your_username with your actual Ubuntu username.</p><p>To apply the change, log out and log back in. Cursor AI should now appear in your application launcher/menu.</p><h3>💻 Step 3: Add cursor Command to the Terminal</h3><p>Let’s add a handy terminal command to launch Cursor AI directly.</p><p>Instead of modifying your .bashrc file directly, it’s recommended to update the .bash_aliases file. This keeps your configurations clean and modular, especially if .bashrc sources .bash_aliases by default.</p><p>Edit your bash aliases:</p><pre>nano ~/.bash_aliases</pre><p>Add the following line at the end:</p><pre>alias cursor=&quot;~/Applications/cursor/cursor.AppImage&quot;</pre><p>Apply the changes to your current session:</p><pre>source ~/.bashrc</pre><p>You can now launch Cursor AI by typing:</p><pre>cursor .</pre><h3>🔄 Seamless Auto-Updates</h3><p>One of the benefits of installing Cursor AI using this method is that <strong>updates are handled automatically</strong>.</p><p>When Cursor AI prompts you to update, simply accept, and the application will replace itself in place. There’s <strong>no need to redownload or reconfigure</strong> anything. Your launcher and terminal alias will continue to work as expected.</p><h3>🧠 Final Thoughts</h3><p>By following this guide, you’ve installed Cursor AI in a clean, non-invasive, and update-friendly way — all without touching system files or relying on third-party integration tools.</p><p>This setup works not just for Cursor AI, but for nearly <strong>any AppImage</strong> you might want to manage neatly as a regular application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73ee5fa54060" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Initialize a PostgreSQL Docker Container with a SQL Dump (and Avoid Common Pitfalls)]]></title>
            <link>https://medium.com/@TechnoCraft/how-to-initialize-a-postgresql-docker-container-with-a-sql-dump-and-avoid-common-pitfalls-b4628b25b253?source=rss-eacdd28370d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b4628b25b253</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker-compose]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[TechnoCraft]]></dc:creator>
            <pubDate>Mon, 04 Aug 2025 16:20:36 GMT</pubDate>
            <atom:updated>2025-08-04T16:20:36.851Z</atom:updated>
            <content:encoded><![CDATA[<p>Using PostgreSQL in Docker is a reliable way to simplify your development and testing environments. But initializing a PostgreSQL container with an existing SQL dump can lead to confusing issues — especially when it <strong>silently fails</strong> or <strong>doesn’t import your data</strong>.</p><p>This guide walks you through:</p><ul><li>✅ Setting up PostgreSQL in Docker with a SQL dump</li><li>🕐 Understanding when initialization scripts actually run</li><li>🔁 Safely resetting only the PostgreSQL volume</li><li>🔍 Verifying that your SQL dump is loaded correctly</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FxFiNoieCBv68FuByriBdw.png" /></figure><h3>🛠️ Step-by-Step: Set Up PostgreSQL with a SQL Dump in Docker</h3><h3>📦 1. Define Your Docker Compose File</h3><p>Here’s a simple docker-compose.yml for a project called acme_project:</p><pre>services:<br>  db:<br>    image: postgres:15<br>    environment:<br>      POSTGRES_USER: acme_user<br>      POSTGRES_PASSWORD: secure_password<br>      POSTGRES_DB: acme_db<br>    volumes:<br>      - ./tmp/pgdata:/var/lib/postgresql/data<br>      - ./db/init:/docker-entrypoint-initdb.d<br>    ports:<br>      - &quot;5432:5432&quot;</pre><ul><li>./tmp/pgdata: PostgreSQL data directory (bind-mounted for persistence)</li><li>./db/init: Initialization scripts or SQL dump files to load <strong>on first startup only</strong></li></ul><h3>📂 2. Place Your SQL Dump in the Init Folder</h3><p>Let’s say your SQL dump is named initial_data.sql. Place it in:</p><pre>./db/init/initial_data.sql</pre><p><strong>Supported formats:</strong></p><ul><li>.sql: Plain SQL, executed by psql</li><li>.sql.gz: Automatically unzipped and run</li><li>.sh: Shell scripts for setup logic</li><li>.dump: Used with pg_restore (typically wrapped in .sh for correct handling)</li></ul><h3>🔁 3. Ensure a Clean Initialization</h3><p>PostgreSQL runs /docker-entrypoint-initdb.d <strong>only when the data directory is empty</strong>.</p><p>To reset the state:</p><pre>rm -rf ./tmp/pgdata<br>mkdir ./tmp/pgdata<br>docker compose up --build db</pre><p>This brings up only the db container and keeps logs clear for debugging.</p><h3>✅ Confirm That Init Scripts Are Running</h3><p>To verify that your initialization scripts are being executed, you can create a debug script:</p><pre># ./db/init/zzz_debug.sh<br>#!/bin/bash<br>echo &quot;✅ DB INIT SCRIPT IS RUNNING&quot;</pre><p>Make it executable:</p><pre>chmod +x ./db/init/zzz_debug.sh</pre><p>If you see this message in your logs, your init scripts are running correctly.</p><h3>🔐 Resetting Only the PostgreSQL Volume (Safely)</h3><p>Avoid using docker compose down -v, which <strong>removes volumes for all services</strong>, not just PostgreSQL.</p><p>Instead, to safely reset <strong>only the Postgres volume</strong>:</p><pre>docker compose down<br>rm -rf ./tmp/pgdata<br>mkdir ./tmp/pgdata<br>docker compose up --build db</pre><p>This clears just the data used by the Postgres container, without affecting other volumes in your project.</p><h3>🚀 Why Use PostgreSQL in Docker?</h3><p>Using PostgreSQL in Docker helps you:</p><ul><li>🧼 Avoid system-wide installations and conflicts</li><li>⚙️ Create consistent environments across machines</li><li>🧑‍🤝‍🧑 Onboard team members faster</li><li>🧪 Run isolated, easily resettable DBs for each project</li><li>🔄 Align local dev with CI/CD or staging environments</li></ul><h3>💬 Final Thoughts</h3><p>Dockerizing PostgreSQL and using auto-imported SQL dumps can massively streamline your dev workflow — as long as you understand how initialization works and how to manage the volume cleanly.</p><p>With just a little setup, you can recreate reliable and consistent development databases across teams and machines.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b4628b25b253" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>