<?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 Stephen Azongo on Medium]]></title>
        <description><![CDATA[Stories by Stephen Azongo on Medium]]></description>
        <link>https://medium.com/@stephenazongo77?source=rss-5d61533533fc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hcwo4gqTkBLJ8QfqBLOSxQ.jpeg</url>
            <title>Stories by Stephen Azongo on Medium</title>
            <link>https://medium.com/@stephenazongo77?source=rss-5d61533533fc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 10:46:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@stephenazongo77/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[The Secret Math That Got Us to the Moon (And Drives Autonomous Cars Today)]]></title>
            <link>https://medium.com/@stephenazongo77/the-secret-math-that-got-us-to-the-moon-and-drives-autonomous-cars-today-a66ffc4043fc?source=rss-5d61533533fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/a66ffc4043fc</guid>
            <category><![CDATA[math]]></category>
            <category><![CDATA[physics]]></category>
            <category><![CDATA[self-driving-cars]]></category>
            <category><![CDATA[object-detection]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Stephen Azongo]]></dc:creator>
            <pubDate>Thu, 01 Oct 2026 15:43:16 GMT</pubDate>
            <atom:updated>2026-10-01T15:43:16.717Z</atom:updated>
            <content:encoded><![CDATA[<p>Imagine you are driving a car through a long, dark tunnel. You need to know <strong>exactly where you are</strong> at any given millisecond.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ihvBu8pQb0a_GxZdpyx0Kw.png" /></figure><p>But you have two massive problems:</p><ol><li><strong>Your odometer is imperfect:</strong> If you calculate your position just by multiplying your speed by time, your guess will drift. A tiny error adds up every second. After a few minutes, you could be off by a mile.</li><li><strong>Your GPS is glitchy:</strong> Because you are in a tunnel, the signal drops, lags, or jumps wildly. One second it says you are on the road; the next, it says you are in the river next to the highway.</li></ol><p>You have two sources of information, but <strong>neither can be trusted completely</strong>. What do you do?</p><p>Enter the <strong>Kalman Filter</strong>.</p><p>It acts like a brilliant co-pilot sitting in your passenger seat. It looks at your dashboard guess, looks at the messy GPS data, calculates the exact amount of uncertainty in both, and merges them into a single, highly accurate guess that is better than either source alone.</p><p>Why Should You Care? (Hint: Ask NASA)</p><p>If this sounds like a niche math trick, think again.</p><p>NASA practically invented the practical application of the Kalman filter. The original algorithm ran on the <strong>Apollo 11 computer</strong> to navigate Neil Armstrong and Buzz Aldrin to the moon. Without it, noisy radar data would have caused the lunar module to burn too much fuel or miss the moon entirely.</p><p>Today, it is the invisible engine behind self-driving cars, SpaceX rocket landings, and the navigation system in your smartphone.</p><p>The Core Concept: Predict vs. Update</p><p>At its heart, a Kalman filter is an <strong>optimal guessing machine</strong>. It works in a continuous, two-step loop: <strong>Predict</strong> and <strong>Update</strong>.</p><pre>    ┌────────────────────────────────────────┐<br>    │                                        │<br>    ▼                                        │<br>[ Predict ] ──► (State &amp; Uncertainty) ──► [ Update ]</pre><p>Phase 1: Predict (Trusting the Physics)</p><p>Before looking at any sensor data, the filter uses the laws of physics to guess where the system will be next.</p><ul><li><em>The Math:</em></li><li>𝑥̂−𝑘 = 𝐴𝑥𝑘−1 + 𝐵𝑢𝑘</li><li><em>In Plain English:</em> “My new position equals my old position plus how much I stepped on the gas pedal.”</li></ul><p>At the same time, it calculates how much its uncertainty grew because of unpredictable things like wind or road friction.</p><p>Phase 2: Update (Trusting the Reality)</p><p>Next, the filter looks at the noisy sensor data (the glitchy GPS) and corrects its physics guess. It uses a mathematical lever called the <strong>Kalman Gain (K)</strong>.</p><p>The Kalman Gain is the secret sauce. It constantly asks: <em>“Should I trust my physics prediction right now, or should I trust the noisy sensor?”</em></p><ul><li>If the sensor is perfect, the Kalman Gain tilts toward the sensor.</li><li>If the sensor is chaotic but the physics prediction is solid, the Kalman Gain tilts toward physics.</li></ul><p>Once it balances the two, it outputs a highly accurate “final answer” and shrinks its uncertainty matrix. Then, the loop starts all over again for the next millisecond.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*ivSRwnfpRkM18WjQgvBazg.png" /><figcaption>Kalman Filter Performance: Smoothing Noisy Measurements</figcaption></figure><p>Leveling Up: The “Dual” Kalman Filter</p><p>If a standard Kalman filter is amazing, a <strong>Dual Kalman Filter</strong> is mind-blowing.</p><p>In the standard version, you have to know the physics perfectly. But what if NASA is flying a drone on Mars, the atmospheric density changes, or a thruster gets damaged? The laws of physics themselves become a guessing game.</p><p>A Dual Kalman Filter runs <strong>two filters in parallel</strong>:</p><ul><li><strong>Filter 1 (The State):</strong> Calculates <em>Where am I right now?</em> (Position, velocity).</li><li><strong>Filter 2 (The Parameter):</strong> Calculates <em>What are my physical properties?</em> (Mass, friction, engine efficiency).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*P33FSDO_Bgr_yZO22IBhJQ.png" /><figcaption>The state and parameter filters</figcaption></figure><p>They constantly feed data to each other. The system <strong>literally learns its own physical properties while actively flying through space.</strong></p><p>The Takeaway</p><p>The Kalman filter reminds us that data is never perfect. The world is noisy, sensors glitch, and physics equations have to deal with real-world chaos.</p><p>But by combining what we <em>expect</em> to happen with what we <em>measure</em> happening; and strictly tracking our own uncertainty; we can navigate through the darkest tunnels and even land on the moon.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a66ffc4043fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LSM Trees in Action: Built a custom DB server from scratch]]></title>
            <link>https://medium.com/@stephenazongo77/lsm-trees-in-action-built-a-custom-db-server-from-scratch-c2172ed4dbc1?source=rss-5d61533533fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2172ed4dbc1</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[relational-databases]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Stephen Azongo]]></dc:creator>
            <pubDate>Wed, 27 May 2026 21:42:19 GMT</pubDate>
            <atom:updated>2026-05-27T21:42:19.440Z</atom:updated>
            <content:encoded><![CDATA[<p>I built StrataDB: a log-structured merge-tree key-value store in Go, from scratch. No external libraries. No storage engine borrowed from somewhere else.</p><figure><img alt="LSM Tree visualisation" src="https://cdn-images-1.medium.com/max/1024/1*jpUeshU8QlujqO__GxaDJw.jpeg" /></figure><p>This is what I learned.</p><h3>What Even Is an LSM-Tree?</h3><p>Before any code, the core idea.</p><p>A B-tree database (like Postgres) stores data in fixed-size pages on disk. When you write a key, it finds the right page and updates it in place. Reads are predictable: O(log n) page lookups. But writes are random I/O, which is expensive.</p><p>An LSM-tree flips this. Every write goes to memory first (the memtable), then gets flushed to disk as a new immutable file (an SSTable) once the buffer fills up. Writes are always sequential. The trade-off is that reads become more expensive: the same key might exist in multiple files, and you have to check them.</p><p>The name “strata” came from this structure. The files form geological layers: newer data sits at the top (L0), compacted and merged data sinks deeper (L1, L2). Old layers compress under the weight of new ones. That is literally how LSM-trees work.</p><h3>Phase 1: The Memtable</h3><p>The memtable is just a sorted write buffer in memory. Every Put lands here first. I implemented it as a Go map (O(1) reads and writes) with a sort on flush.</p><p>A production engine like LevelDB uses a skip list instead, which keeps entries always sorted. I used a map plus sort.Slice at flush time because the sort is a one-off cost, not a hot path. The result is simpler and correct.</p><p>One thing I had to handle from the start: tombstones. When you delete a key, you cannot simply remove it. The original value might already be sitting in an SSTable file on disk, which is immutable. So instead of deleting, you write a special marker with Deleted: true. The actual cleanup happens later during compaction.</p><p>This is the same reason Postgres has VACUUM. When you delete a row in Postgres, it marks the old row as a dead tuple. VACUUM reclaims that space. Different mechanism, same underlying problem.</p><h3>Phase 2 and 3: Writing and Reading SSTables</h3><p>An SSTable is an immutable, sorted file on disk. Once written, it never changes.</p><p>For the on-disk format I used length-prefix framing, the same technique I built in LogStream for Kafka segments:</p><pre>[key_len: 4 bytes][key bytes][value_len: 4 bytes][value bytes][deleted: 1 byte]</pre><p>Each record is self-describing. No delimiters to scan for, no escaping needed. The reader knows exactly how many bytes to consume before the next record starts.</p><p>Reading uses binary search. Because entries are sorted by key, you can find any key in O(log n) without loading the entire file. The sorted order is what makes this efficient, which is exactly why the memtable sorts before flushing.</p><h3>Phase 4: Write-Ahead Log</h3><p>The memtable is in RAM. If the process crashes, everything in it is gone.</p><p>The WAL fixes this. Every write goes to an append-only log file on disk <em>before</em> it touches the memtable. If the process restarts, it replays the WAL to rebuild the memtable exactly as it was.</p><p>Postgres does the same thing with pg_wal. The principle is identical: write to the log first, then update the in-memory structure. The log is the source of truth for crash recovery.</p><p>One nuance I got wrong initially: the WAL must be fsynced on every append. Without fsync, the OS write buffer can hold the data in memory. A crash before the OS flushes means the write is lost even though you “wrote” it. The fsync forces the physical flush. It costs ~20–50 microseconds per write, and it is non-negotiable if you want durability guarantees.</p><h3>Phase 5: Compaction</h3><p>Over time, flushing the memtable produces many small SSTable files. Two problems pile up:</p><ol><li>The same key exists in multiple files (original write, then an overwrite). Only the newest is valid.</li><li>Tombstones accumulate. A delete marker in a new file and the original value in an old file both sit on disk, wasting space.</li></ol><p>Compaction solves both. The algorithm is straightforward:</p><ol><li>Read all entries from all input files (oldest first).</li><li>Build a map, letting newer entries overwrite older ones for the same key. Last write wins.</li><li>Filter out tombstones.</li><li>Sort the result.</li><li>Write a single merged SSTable.</li></ol><p>The input files are then deleted. A key that was written, overwritten, and then deleted no longer exists anywhere after compaction.</p><p>This is called size-tiered compaction: merge files of similar size into one. LevelDB and RocksDB use leveled compaction, which is more sophisticated (non-overlapping key ranges per level, finer-grained file selection), but the principle is the same.</p><h3>Phase 6: The DB Layer</h3><p>The DB struct is where everything connects. The write path:</p><pre>Put(key, value)<br>  -&gt; WAL.Append     // durable first<br>  -&gt; memtable.Put   // fast, in memory<br>  -&gt; if ShouldFlush()<br>       -&gt; flush memtable to L0 SSTable<br>       -&gt; if len(L0) &gt;= threshold<br>            -&gt; compact L0 into L1</pre><p>The read path checks newest data first and stops at the first hit:</p><pre>Get(key)<br>  -&gt; memtable        // newest<br>  -&gt; L0 (newest to oldest)  // L0 files can overlap<br>  -&gt; L1              // compacted, non-overlapping<br>  -&gt; ErrNotFound</pre><p>One thing that took a moment to internalize: you stop reading the moment you find the key, even if what you find is a tombstone. A tombstone in a newer file overrides a live value in an older file. Finding it means “this key was deleted” and you return not found.</p><figure><img alt="data read visual" src="https://cdn-images-1.medium.com/max/675/0*SD-kMkxPJ9RokcYK.png" /></figure><h3>Phase 7: Bloom Filters</h3><p>The worst-case read in an LSM-tree is looking for a key that does not exist. Without bloom filters, every Get for a missing key reads every SSTable before giving up. That cost scales linearly with the number of files.</p><p>A bloom filter is a probabilistic bit array. When you write an SSTable, you build a filter from all the keys in it. When you read, you check the filter first. If any of the K hash positions is zero, the key is <em>definitely</em> not in that file. Skip it. If all positions are one, the key <em>might</em> be there. Read the file.</p><p>The filter can produce false positives (says “maybe” when the key is absent) but never false negatives. You might do an unnecessary file read, but you will never miss a key that is actually there.</p><p>The benchmark result tells the story better than any explanation:</p><pre>BenchmarkGet_Hit-8     7,600,336 ns/op   (~130 reads/sec)<br>BenchmarkGet_Miss-8           83 ns/op   (~12M misses/sec)</pre><p>A miss is 90,000 times faster than a hit. That is the bloom filter making zero disk reads while the hit path opens files and seeks through them.</p><h3>Persistence Across Restarts</h3><p>After building the full pipeline, I realized the DB did not survive a restart. Open created a blank database every time, ignoring the SSTable files sitting on disk.</p><p>The fix was loadExisting: scan the directory on startup, parse filenames to determine level membership, rebuild bloom filters by reading each file, and set the sequence counter past all existing file numbers so new files do not collide. Then replay the WAL to recover any writes that were in the memtable when the process last stopped.</p><p>This is how every persistent database opens. Postgres scans its data directory. LevelDB reads a MANIFEST file. We infer level membership from filenames. Same goal, different implementations.</p><h3>The SSTable Index</h3><p>The original SSTable reader called ReadAll, which loaded the entire file into memory before binary searching it. With many SSTables and large values, that is a lot of unnecessary I/O.</p><p>The fix is an index section appended to every SSTable file. The index stores one (key, offset) pair per record. When looking up a key, you read the small index, binary search it, then seek directly to the one record you need. No full scan.</p><p>The file layout:</p><pre>[data section  ]  records, sorted by key<br>[index section ]  (key, byte offset) per record<br>[footer        ]  index start offset + entry count, 12 bytes</pre><p>This is the same idea as a book’s table of contents, which tells you the page number for each chapter so you do not have to read the whole book to find what you want.</p><h3>What the Benchmarks Say About LSM-Trees</h3><p>Running on Windows 11, Go 1.25:</p><pre>BenchmarkPut-8              27,895 ns/op   -&gt;  35,800 writes/sec<br>BenchmarkGet_Hit-8       7,600,336 ns/op   -&gt;     130 reads/sec<br>BenchmarkGet_Miss-8             83 ns/op   -&gt;  12,000,000 misses/sec<br>BenchmarkPut_Concurrent-8   31,213 ns/op   -&gt;  32,000 writes/sec</pre><p>Write throughput is strong because writes are always sequential. Read throughput looks low, but the benchmark uses 5-byte values, making the index nearly as large as the data. With kilobyte-sized values, indexed seeks produce a 40x reduction in bytes read. The read numbers also reflect Windows file syscall overhead (4–5 system calls per lookup), which would be faster on Linux.</p><p>The miss number is the most interesting one. 83 nanoseconds per lookup for a key that does not exist. The bloom filter reduces it to three bit-checks in an in-memory byte array. No disk, no file open, no seek. This is why RocksDB, Cassandra, and every other LSM-based database ships with bloom filters turned on by default.</p><h3>What I Would Add Next</h3><p>A few things I left out deliberately:</p><p><strong>Index caching.</strong> Right now the index is re-read from disk on every Get. LevelDB&#39;s TableCache keeps parsed indexes in an LRU cache. That would bring the hit benchmark from 7ms down to microseconds.</p><p><strong>Block compression.</strong> LevelDB and RocksDB group records into 4KB blocks and compress each one with Snappy or LZ4. Better cache efficiency, smaller files.</p><p><strong>MVCC.</strong> Postgres keeps multiple versions of each row so readers never block writers. Our sync.RWMutex is much simpler: one writer at a time, many concurrent readers. MVCC is a separate project.</p><h3>The Full Picture</h3><p>StrataDB ended up being: a memtable, an SSTable writer and indexed reader, a WAL, a compaction engine, a two-level file hierarchy, bloom filters, persistence across restarts, and an HTTP API. About 1,000 lines of Go across seven packages.</p><p>Building it answered questions I had been carrying since I first read about storage engines. Why do LSM-trees win on write throughput? Because every write is sequential. Why do reads cost more? Because the same key can live in multiple files and you have to check them. Why do bloom filters matter so much? Because without them, a missing key forces a full scan of every file.</p><p>Kleppmann explains all of this in Chapter 3 of DDIA. But reading about it and building it are completely different things.</p><p>The code is on GitHub: <a href="https://github.com/steveAzo/StrataDB">link</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2172ed4dbc1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Drop the NITA Bill Now. Full Stop.]]></title>
            <link>https://medium.com/@stephenazongo77/drop-the-nita-bill-now-full-stop-d20eb5a39804?source=rss-5d61533533fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/d20eb5a39804</guid>
            <category><![CDATA[innovation]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[law]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[ghana]]></category>
            <dc:creator><![CDATA[Stephen Azongo]]></dc:creator>
            <pubDate>Fri, 22 May 2026 11:56:42 GMT</pubDate>
            <atom:updated>2026-05-22T11:56:42.832Z</atom:updated>
            <content:encoded><![CDATA[<p><em>The NITA Bill 2025 reads like a document written by people who’ve never shipped a product in their lives.</em></p><p>There is a bill sitting in Ghana’s Parliament right now that could require you to hold a government-issued certificate before you are legally allowed to work as an ICT professional in Ghana. Not a certificate from AWS. Not a degree from KNUST or Legon. A certificate from the National Information Technology Authority, a regulatory body that, under this same bill, will be granted sweeping powers to define who qualifies, set the criteria, and enforce the rules.</p><p>Section 46 of the National Information Technology Authority Bill, 2025 says it plainly:</p><blockquote>“A person shall not be appointed as an ICT professional in a public or private institution unless that person is certified by the Authority.”</blockquote><p>Read that again. <strong>Public or private.</strong> Not just government workers. Everyone.</p><p>And Section 35 goes further. If you’re running any kind of ICT business, providing any ICT service, or installing any ICT infrastructure, you need a licence from NITA first. Operate without one and you’re looking at a fine, imprisonment between six months and two years, or both.</p><p>This is not a minor administrative reform. This is a gate being erected at the entrance of one of Ghana’s most promising industries, and someone needs to say clearly: <strong>Kill the bill.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9HiN7UdcN8jaOhm1" /><figcaption>drop nita bill now</figcaption></figure><h3>First, let’s talk about what’s actually growing here</h3><p>Ghana’s tech ecosystem is not a charity case waiting for government management. It is a real, functioning, expanding industry.</p><p>In 2024, Ghanaian startups raised $127 million a 95% increase in deal volume compared to 2023. Fintech alone saw growth of over 1,600%. The ICT sector’s contribution to GDP went from GH¢4.4 billion in 2016 to GH¢21 billion in 2022. The ecosystem created over 20,000 new jobs in a single year. Companies like Zeepay, Aya Data, mPharma, and Complete Farmer are putting Ghana on the global map.</p><p>Ghana is increasingly being called the “Gateway to West Africa” for tech investment. Accra is the third-ranking startup ecosystem in West Africa. Visa, Launch Africa, and global VC funds are coming in.</p><p>This is the ecosystem NITA wants to gate behind a certification regime.</p><h3>The “scope of practice” problem</h3><p>In professional regulation, <strong>scope of practice</strong> is the concept that defines what a licensed professional is legally permitted to do. It is the cornerstone of how we regulate doctors, nurses, lawyers, pharmacists, and pilots.</p><p>The reason those professions are tightly licensed is specific: <strong>the consequences of incompetence in those fields are irreversible harm to another person.</strong> A bad surgeon can kill someone on the table. A bad pharmacist can dispense the wrong drug. A bad pilot can crash a plane with 200 people aboard. The public cannot easily assess the competence of a healthcare professional so the state steps in, sets minimum standards, and enforces them.</p><p>This is the <strong>public harm rationale</strong> for professional licensing. It is also why scope of practice is not applied indiscriminately to every occupation.</p><p>Tech does not fit this model cleanly and certainly not at the sweeping scale this bill proposes.</p><p>A developer who writes bad code doesn’t kill anyone. The market punishes them clients leave, products fail, companies close. A startup that builds a poor product finds out when users stop using it. This is how markets work. The discipline already exists. It is called consequences.</p><p>Now, there are <strong>specific intersections</strong> where tech and high-stakes public harm genuinely overlap a software engineer building the dosing algorithm inside a medical device, or an engineer configuring safety-critical aviation systems. In those cases, the relevant regulated profession (medical, aviation) already imposes its own standards. You don’t need a new NITA certificate on top. The scope of practice in those contexts is handled by the sector that owns the risk.</p><p>What NITA is proposing is something different: a blanket certification requirement across all of ICT every developer, every SaaS provider, every infrastructure installer, every cloud company. That is not scope of practice regulation. That is <strong>gatekeeping</strong>.</p><h3>Who decides the criteria? By what yardstick?</h3><p>This is the question the bill does not answer and it is the most important one.</p><p>“ICT” as defined in the bill includes: digital hardware and software systems; information systems and digital applications; data centres and cloud infrastructure; digital innovation, platforms, and emerging technologies. In other words, everything.</p><p>Are we certifying frontend developers separately from backend engineers? What about DevOps? Machine learning engineers? UX designers? Low-code builders? Blockchain developers? Someone who builds mobile apps in Flutter? A self-taught developer from Tamale who learned on YouTube and is building tools for farmers?</p><p>The bill hands the Authority the power to “determine the criteria and procedure for the certification of ICT professionals” with no legislative guardrails, no required consultation with industry, no defined framework. NITA will simply make it up, and you must comply or face prosecution.</p><p>That is not regulation. That is a blank cheque.</p><h3>The innovation tax on the kid from the village</h3><p>There is a human cost that policy documents never capture in their tables and definitions.</p><p>Ghana has a genuinely young, distributed, self-taught developer community. People who learned to code from online resources, from each other, from building real things for real problems. People who do not have the money or the time to sit a government exam, pay a certification fee, and wait for bureaucratic approval before they can work.</p><p>Section 37 of the bill restricts licences only to Ghanaian citizens or companies “wholly owned by a citizen.” So even foreign investors bringing capital and jobs face structural barriers. This, at a moment when the ecosystem explicitly needs more investment.</p><p>The bill’s own language acknowledges the need for “digital inclusion,” “support for local innovation,” and “capacity building.” Section 63 promises to “promote universal and inclusive access to ICT services, with particular focus on persons with disabilities, women, rural populations, and marginalized groups.”</p><p>Then Section 46 says you cannot practice unless you are NITA-certified.</p><p>You cannot simultaneously write “one million coders” campaigns, AI in education policies, and digital transformation agendas and then require a government certificate before any of those coders are allowed to work. These positions are incompatible.</p><h3>The self-contradiction at the heart of the bill</h3><p>Here is what is interesting about this bill: it actually contains provisions that reflect sophisticated regulatory thinking.</p><p>Section 60 establishes a <strong>Regulatory Sandbox</strong> for testing ICT innovations in a controlled environment. Section 61 calls for a <strong>risk-based and principles-oriented approach</strong> that is “proportionate to the risks posed.” Section 62 explicitly commits to <strong>technology-neutral regulation</strong> and says the Authority “shall not unduly constrain innovation.” Section 65 calls for periodic reviews of regulatory instruments for continued relevance.</p><p>These are good ideas. They reflect international best practice in ICT regulation.</p><p>They are also completely at odds with Section 46, which creates a blunt, universal certification requirement with no tiering by risk, no sandbox exception, no proportionality test. The sophisticated regulatory philosophy in the bill is undermined by the gatekeeping mechanism at its centre.</p><p>You cannot claim to be “principles-oriented” and “risk-based” while simultaneously requiring a single government body to certify every ICT professional in Ghana before they can be employed anywhere, by anyone.</p><h3>What should actually happen</h3><p>The parts of this bill worth keeping are real. Licensing of critical public-sector ICT infrastructure makes sense. Standards and technical clearance for government procurement fine. A dispute resolution framework for ICT service providers genuinely useful. Even some form of professional development framework for public-sector ICT roles there is a reasonable argument there.</p><p>But the certification regime as written applying to all ICT professionals in public <strong>and private</strong> institutions needs to go.</p><p>What a credible alternative looks like:</p><ol><li><strong>Limit mandatory certification to public-sector ICT roles</strong> where government systems, citizen data, and public infrastructure are at stake. The state can set standards for its own workforce.</li><li><strong>Let voluntary certification frameworks emerge</strong> from industry bodies, international standards (CompTIA, ISO, PMI, etc.), and universities. The market already rewards these. Mandate is unnecessary.</li><li><strong>Apply risk-based licensing</strong> only to specific high-stakes ICT activities critical national infrastructure, financial systems, health data systems not to the entire industry.</li><li><strong>Define criteria through multi-stakeholder consultation</strong>, not by executive fiat inside a regulatory body with no accountability mechanism in the certification process.</li><li><strong>Do not criminalise employment of an uncertified ICT professional.</strong> The penalties in this bill are not administrative inconveniences they are criminal sanctions. That is disproportionate.</li></ol><h3>This is the moment to speak</h3><p>Ghana’s tech ecosystem raised $90 million in 2025. It is fragile in some ways, growing in others, and watching carefully. Foreign investors, diaspora founders, and local entrepreneurs are all making decisions about where to build.</p><p>Overregulation is not a hypothetical risk in developing tech ecosystems it is a documented one. Regulations that drive up costs, create compliance barriers, and introduce uncertainty directly suppress investment and talent development.</p><p>The NITA Bill 2025, as written, creates exactly these conditions at exactly the wrong time.</p><p>The bill should be revised substantially. Section 46, as it stands, should be dropped.</p><p>Ghana’s developers do not need a government certificate to build great things. They need infrastructure, funding, markets, and space to fail and try again. They need a regulatory environment that protects without strangling.</p><p>This is not that bill. Not yet.</p><p><em>The NITA Bill 2025 is currently under consideration by Ghana’s Parliament. If you are a developer, founder, investor, or anyone who cares about Ghana’s digital future now is the time to engage. Write to your MP. Share this. Make noise.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d20eb5a39804" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tiny Kafka I built in Go to Understand Why Real Kafka Is Built the Way It Is]]></title>
            <link>https://medium.com/@stephenazongo77/tiny-kafka-i-built-in-goto-understand-why-real-kafka-is-built-the-way-it-is-87aa9442d512?source=rss-5d61533533fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/87aa9442d512</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[systems-thinking]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Stephen Azongo]]></dc:creator>
            <pubDate>Sat, 16 May 2026 14:41:03 GMT</pubDate>
            <atom:updated>2026-05-21T16:38:46.148Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A systems programming deep-dive triggered by a few chapters of DDIA</em></p><p>I am a software engineer trying to level up; not only by grinding LeetCode(Cuz I am obviously addicted to it btw…), but by reading <em>Designing Data-Intensive Applications</em> and building the things I read about. LogStream is what came out of chapters 3, 4, and 11: a minimal Kafka clone in Go, built from scratch, that taught me more about storage engines in two weeks than two years of using them as a black box.</p><p>This is the story of what I built, what broke, and what I now understand that I didn’t before.</p><figure><img alt="Kafka typical Architecture diagram" src="https://cdn-images-1.medium.com/max/866/0*EfLoyUlQxqN-w7LE.png" /></figure><h3>Why Build a Message Broker?</h3><p>Most engineers interact with Kafka as a configuration file. You point a producer at a topic and a consumer at an offset and you call it a day. What I wanted to understand is the <em>why</em> behind the design decisions; why Kafka stores messages in append-only files instead of a database, why it identifies messages by byte offset instead of a sequence number, why it can sustain millions of writes per second on commodity hardware.</p><p>The answer, it turns out, comes down to physics.</p><h3>The One Insight That Explains Everything</h3><p>Hard drives have a physical head that moves to read data. Seek time — the time it takes to move that head is measured in milliseconds. That’s slow. SSDs eliminated seek time but introduced a different constraint: erase-before-write cycles. Both storage media share one property: <strong>sequential access is dramatically faster than random access</strong>.</p><p>DDIA Chapter 3 states this plainly. What I wanted was to feel it in numbers.</p><p>So I built a segment a single append-only file; and benchmarked two versions of it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*epxSY6mRS-HDBWS7tM6QcA.png" /><figcaption>benchmark shot of appendwithsync and without sync</figcaption></figure><p>That 90× gap between synced and unsynced writes is why Kafka doesn’t fsync per message. Calling fsync forces the OS page cache to flush to physical storage synchronously. It is the correct thing to do for durability; but at ~979 messages per second on my i3 laptop, it is economically unusable at scale.</p><p>Kafka’s answer: replicate instead of sync. Writing the same message to 3 nodes over a network round trip (~1ms) costs approximately the same as one fsync, but you get fault tolerance on top of durability. This is not a software trick. It is a conscious trade-off between two physical realities.</p><p>I implemented both. The code made the trade-off visceral in a way that reading about it never did.</p><h3>How a Record Lands on Disk</h3><p>Before anything else, I had to solve a basic problem: how do you store variable-length records in a flat file and read them back?</p><p>You cannot store raw bytes without framing, because when you read the file back there is no way to know where one message ends and the next begins. Every binary protocol; Kafka, gRPC, PostgreSQL’s WAL all solves this the same way: <strong>length-prefix framing</strong>.</p><p>Every record in LogStream looks like this on disk:</p><pre>┌──────────────────┬──────────────┬──────────────────┬───────────────┐<br>│  4 bytes uint32  │  K bytes     │  4 bytes uint32  │  V bytes      │<br>│  key length      │  key bytes   │  value length    │  value bytes  │<br>└──────────────────┴──────────────┴──────────────────┴───────────────┘</pre><p>To read a record, you seek to its offset, read 4 bytes to get the key length, read that many bytes, read 4 more for the value length, read that many bytes. That is it. No index. No page structure. Just a file position.</p><p>This is why message offsets in LogStream and in Kafka are byte offsets, not sequence numbers. Seeking to byte offset 47 is an O(1) operation. The OS translates it to a single pread(2) syscall. No iteration, no scanning.</p><h3>The Bug That Taught Me How Files Actually Work</h3><p>Halfway through the project, I added replication: a leader node fanning writes out to two followers. I produced a message, got back {&quot;partition&quot;: 1, &quot;offset&quot;: 69}, tried to read it back, and got an EOF error.</p><p>The offset was correct. The data was in the file. Something was wrong with how I was writing.</p><p>The bug was subtle. When NewSegment opens an existing file on disk, the OS file descriptor starts with its position at byte 0, even though the file already contains data. My code correctly set nextOffset = baseOffset + fileSize ; it knew where the logical end of the log was but the file handle&#39;s cursor was still at the beginning. The next write didn&#39;t append. It overwrote from byte 0.</p><p>The file stayed the same size. nextOffset advanced correctly. But the data at the beginning was gone, replaced by new content. Reading at offset 69 (which now pointed past the end of actual content) returned EOF.</p><p>The fix was one line; f.Seek(0, io.SeekEnd) after opening; but finding it required understanding the difference between a logical file offset and an OS file descriptor position. That is not something you learn from a tutorial.</p><h3>Partitioning and Why the Same Key Always Goes to the Same Partition</h3><p>A single file cannot scale beyond one disk or one machine. LogStream splits each topic into 3 partitions, each a separate directory of segment files. When a producer sends a message with a key, the partition is determined by:</p><pre>partition = FNV-1a(key) % numPartitions</pre><p>The same key always produces the same hash, so the same key always lands in the same partition. This is the <strong>per-key ordering guarantee</strong> — if you need all events for user-123 to be processed in order, they must all land in the same partition and be consumed sequentially. Kafka uses this exact algorithm.</p><p>Messages with no key go to partition 0, trading ordering guarantees for round-robin-like distribution.</p><h3>Log Compaction</h3><p>For topics that represent current state; user profiles, configuration, CDC streams; retaining every historical write wastes disk. Only the latest value per key matters.</p><p>Log compaction scans all segments, builds a map[key]→latestRecord, writes the surviving records to a new single segment, replaces the old files. The algorithm is O(n) in the number of records. After compaction, the partition has one segment with one record per unique key.</p><p>This is DDIA Chapter 11’s core: the log as a state store, not just an event history.</p><h3>Replication</h3><p>The final piece was the leader-follower model. A leader node receives writes, appends locally, then fans out to all followers concurrently using goroutines and sync.WaitGroup. It waits for every follower to acknowledge before returning to the producer. Synchronous replication — maximum consistency, at the cost of latency equal to the slowest node.</p><p>Each node runs as an independent HTTP server with its own data directory. Followers expose a single internal endpoint /internal/replicate/{topic}/{partition} that writes directly to the specified partition, bypassing key routing. The leader already made the routing decision; followers just mirror it.</p><p>Running a 3-node cluster on one machine:</p><pre>go run . -addr=:8080 -role=leader -followers=:8081,:8082<br>go run . -addr=:8081 -role=follower<br>go run . -addr=:8082 -role=follower</pre><p>Produce to :8080. Read the same offset from :8081. The data is there.</p><h3>What I Actually Learned</h3><p>Reading DDIA tells you <em>that</em> sequential I/O is faster. Building a storage engine shows you <em>by how much</em> and <em>why it matters in practice</em>. These are different kinds of knowledge.</p><p>The specific things that are now concrete for me:</p><ul><li>Why Kafka identifies messages by byte offset and not sequence number</li><li>Why Kafka doesn’t fsync per write and how replication compensates</li><li>What log compaction actually does and what it trades away (offsets are invalidated)</li><li>Why the same key must always route to the same partition for ordering to hold</li><li>How a file descriptor’s position can silently diverge from your logical position, and what happens when it does</li></ul><p>LogStream is small enough to hold in your head. That is the point. I now have an intuition for a class of systems; Kafka, Kinesis, Pulsar, Redpanda; that I can reason about from first principles. That intuition does not come from the API documentation.</p><p>The code is on <a href="https://github.com/steveAzo/logstream">GitHub</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87aa9442d512" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kenkey Express Is the Food App That Isn’t an App]]></title>
            <link>https://medium.com/@stephenazongo77/kenkey-express-is-the-food-app-that-isnt-an-app-1f66b324f3bc?source=rss-5d61533533fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f66b324f3bc</guid>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[whatsapp]]></category>
            <category><![CDATA[food-delivery]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[food]]></category>
            <dc:creator><![CDATA[Stephen Azongo]]></dc:creator>
            <pubDate>Fri, 20 Mar 2026 17:39:21 GMT</pubDate>
            <atom:updated>2026-03-20T17:39:21.403Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How Quiverfood’s Kenkey Express quietly solved one of the most ignored problems in everyday life.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*BpFqsBC19-ZfqRSWa7ckSQ.jpeg" /></figure><p>I think about problems a lot. Not the big dramatic ones that make headlines. The small, everyday ones that people encounter, shrug at, and keep moving. The ones that never make it onto anyone’s product roadmap because they don’t look like problems on paper.</p><p>One of those problems is this: ordering things online is still too much work.</p><p>And before you push back, hear me out. Because I know what you’re thinking. We have Jumia. We have Amazon. We have Glovo and a dozen other delivery apps. Trust is not the problem. Those platforms have spent years and billions building that trust, and it works. I am not questioning that.</p><p>The problem is something quieter. It’s friction. It’s the moment you’re hungry and you have to decide which app to open, whether you even have it installed, whether you remember your login, whether you’re willing to scroll through a menu when all you really know is that you want food right now.</p><p>That moment of mild resistance is where a lot of orders never happen. Not because the product doesn’t exist. But because getting to it costs more energy than it should.</p><h3>The App You Already Have Open</h3><p>Here’s a question worth sitting with: why do we keep building new destinations for people to go to, when there’s already one place almost everyone is, all the time?</p><p>WhatsApp is not just an app in Ghana. It is infrastructure. It is the first thing people open in the morning and the last thing they check at night. Group chats, voice notes, business communication, family check-ins. Everything flows through it. And yet, when it comes to ordering food, we tell people to leave this world they live in and go to a different one.</p><p>Through the product Quiverfood, specifically the Kenkey Express brand, the decision was made not to do that.</p><p>Kenkey Express lives on WhatsApp. You don’t download anything. You don’t create an account on some website. You open your WhatsApp, you start a conversation, and you order your food in plain, natural language. Like you’re talking to a person. Because in terms of the experience, you basically are.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*8IHM7p_UJoMDxF5s6jgUqA.png" /></figure><h3>It Remembers You</h3><p>The first time you use it, there’s a quick, painless sign-up. Your name, your details, the basics. That’s it. One time.</p><p>After that, Kenkey Express knows you. You can pin the chat. It sits right there in your WhatsApp, ready whenever the craving hits. No searching, no re-entering information, no starting from scratch every single time. You just come back to it like you would any other conversation.</p><p>That small detail changes everything about the experience. It is no longer a transaction. It becomes a habit. And the best products are the ones that become habits without you noticing.</p><h3>Then Come the Payment</h3><p>Now here’s where it gets smart in a way that could have easily gone wrong.</p><p>You don’t want actual payment credentials flowing through a chat interface. That’s a real concern and a fair one. So when it’s time to pay, a pop-up appears from your MoMo provider, whether that’s MTN, Telecel, or AirtelTigo. You enter your PIN, you confirm, and that’s it. Done.</p><p>Crucially, it never feels like you left WhatsApp. The pop-up comes to you. You don’t go anywhere. The payment finds you, you confirm it, and you’re back in the conversation. Seamless is an overused word but I can’t think of a more accurate one here.</p><p>This works so naturally because MoMo is already trusted infrastructure for Ghanaians. It’s not a new thing being introduced. It’s the familiar thing, showing up exactly where you expect it, doing exactly what it’s supposed to do.</p><h3>Why This Actually Matters</h3><p>There is a version of innovation that is loud. It builds something completely new and asks everyone to come learn it, adopt it, adjust their behavior for it. Sometimes that works. Usually it doesn’t.</p><p>Then there is a quieter version. The kind that looks at where people already are, what they already trust, what they already do every single day, and asks: how do we fit into that? How do we make their existing life easier instead of asking them to build a new one?</p><p>Kenkey Express is that second kind. It didn’t try to compete with WhatsApp. It moved into it. It didn’t try to replace MoMo. It worked with it. It didn’t try to teach you a new behavior. It found the behavior you already had.</p><p>That’s not just good product design. That’s an understanding of people. Of how we actually live, not how we theoretically should.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*eYlfO8lBZyjdZgGcrXHCxw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*vU2-7pqvNP8MO-7Vi6aCsw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*VO8XCExrB_SN3oUtEe4CJA.png" /></figure><p>Go Try It</p><p>If you’re in Ghana and you haven’t used Kenkey Express yet, genuinely go try it. Not because I’m telling you to. But because some things are easier to understand after one experience than after a thousand words of explanation.</p><p>Order your food. Watch how little effort it takes. Notice how naturally it fits into the WhatsApp conversation you were probably already having. And then think about all the other problems in your everyday life that are waiting for someone to solve them the same way.</p><p>Because the best innovations don’t announce themselves. They just make you wonder why everything wasn’t always this simple.</p><p>233 55 009 8169<br><a href="https://wa.me/message/OGKQOIMBEYEUI1">https://wa.me/message/OGKQOIMBEYEUI1</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f66b324f3bc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“Buffer” Explained In Simple Terms]]></title>
            <link>https://medium.com/@stephenazongo77/buffer-explained-in-simple-terms-8f7678cdc77e?source=rss-5d61533533fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f7678cdc77e</guid>
            <category><![CDATA[buffer-overflow]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Stephen Azongo]]></dc:creator>
            <pubDate>Tue, 03 Mar 2026 02:01:47 GMT</pubDate>
            <atom:updated>2026-03-03T02:01:47.304Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*OumC2j73rjB8uqJzMWg_Zw.png" /><figcaption>visualisation of water flow with and without a tank for buffering</figcaption></figure><p>If you’ve ever opened a tap and water flowed instantly even though the pump wasn’t running, then you’ve experienced a buffer.</p><p>If you’re a developer, you’ve seen Buffer in Node.js, bytearray in Python, or heard “buffer overflow” in a security lecture.<br> Same word. Different layers. Same idea underneath.</p><h4>The core idea: two things moving at different speeds.</h4><p>A borehole pump sends water upward in bursts.<br> You open the tap whenever you feel like it; sometimes slowly, sometimes all at once.</p><p>If the pump were connected directly to the tap:</p><ul><li>Water would only flow when the pump runs.</li><li>Pressure would fluctuate wildly.</li><li>Every mismatch would be noticeable.</li></ul><p>Instead, we install a water tank between them.</p><p>The tank absorbs the difference.</p><p>When production is faster than consumption, it stores the excess.<br> When consumption is faster than production, it supplies temporarily.</p><p>It doesn’t exist to store water forever.<br> It exists to stabilize flow.</p><p>That tank is a buffer.</p><p>A buffer is a temporary holding area that absorbs the mismatch between two things running at different speeds. It doesn’t store data permanently. It doesn’t try to remember anything. It just holds things long enough for the slower side to catch up.</p><p>This same idea appears everywhere in computing, from hardware to high-level code.</p><h3>Layer 1: The concept; absorbing speed mismatches</h3><p>Your CPU processes data in nanoseconds. Your hard drive reads it in milliseconds. Your network delivers it in seconds, sometimes jittery seconds.</p><p>These don’t operate at the same pace, and they never will. So there are buffers everywhere. There are buffers between your CPU and RAM, between your app and the disk, between your video player and the internet.</p><p>The YouTube loading bar is the most visible one. Your connection isn’t a smooth pipe. It’s uneven. It is faster for a second, slower for the next. But video has to play at a constant pace. So the player pre-loads 15–30 seconds of video into a buffer. When your connection dips for two seconds, the player keeps running off what it already stored. That’s why you are still able to enjoy your YouTube video smoothly for the next 10 seconds after a sudden loss of internet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*5QiTfEbypdR4nEAMisrXVw.png" /></figure><p>When the buffer empties faster than it refills, that’s buffering. The spinner isn’t a failure; it’s the system just trying to tell you that the queue has ran dry.</p><h3>Layer 2: In code; a bucket for raw bytes</h3><p>High-level languages speak in strings, objects, and arrays. Files on disk, packets over a network, audio streams on the other hand speaks in raw bytes.</p><p>A Buffer class is your program claiming a fixed chunk of memory to hold those raw bytes before doing anything with them.</p><pre>const fs = require(&#39;fs&#39;);<br><br>fs.readFile(&#39;photo.png&#39;, (err, data) =&gt; {<br>  console.log(data);<br>  // &lt;Buffer 89 50 4e 47 0d 0a 1a 0a ...&gt;<br>  <br>  console.log(data[0]);<br>  // 137 - the first raw byte<br>  <br>  console.log(data.toString(&#39;hex&#39;, 0, 4));<br>  // &#39;89504e47&#39; - the PNG file signature<br>});</pre><p>data here isn&#39;t a string. It&#39;s a sequence of numbers; the actual bytes of the image file sitting in memory. The Buffer gives you direct access to them so you can decode, transform, or forward the data without converting everything to a string and back.</p><p>This matters the moment you work with images, audio, binary protocols, or anything that lives below the “human-readable” layer.</p><h3>Layer 3: Buffer vs. cache; the most common mix-up</h3><p>These two are different things with different jobs.</p><p>A buffer exists for <strong>movement</strong>. Its job is to synchronize two processes running at different speeds. Once the data moves from A to B, the buffer is cleared and reused.</p><p>A cache exists for <strong>repetition</strong>. Its job is to store a copy of data so you don’t have to fetch the original again.</p><p>Buffer Cache Purpose Synchronize speeds Avoid fetching twice Holds The original data, in transit A copy of data from elsewhere Cleared when Data reaches its destination Evicted by age, size, or policy</p><p>Your browser caches a website’s logo so it doesn’t re-download it on every page visit. That same browser uses a buffer to hold the bytes of a file you’re downloading while they’re being written to your disk.</p><p>Same data flow. Completely different jobs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*JgdTmjEbdD79CMhsDntNBQ.png" /><figcaption>buffer and cache visualised</figcaption></figure><h3>Why this matters in practice</h3><p><strong>Streaming large files</strong></p><p>If you load a 2GB file into a variable, your app claims 2GB of RAM. If you stream it through a 64KB buffer, your app uses 64KB; regardless of file size.</p><pre>// This loads the entire file into memory<br>const data = fs.readFileSync(&#39;large-video.mp4&#39;);</pre><pre>// This processes it in 64KB chunks<br>const stream = fs.createReadStream(&#39;large-video.mp4&#39;, { highWaterMark: 65536 });<br>stream.on(&#39;data&#39;, chunk =&gt; process(chunk));</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*4U9z5na7UFTvYGW2OjoVPA.png" /><figcaption>an architectural diagram on how buffer memory will look like</figcaption></figure><p>For small files, the difference is trivial. For large ones, it’s the difference between an app that works and one that runs out of memory.</p><p><strong>Buffer overflows</strong></p><p>A buffer overflow happens when you write more data into a buffer than it was sized to hold. In a managed language like JavaScript or Python, this throws an error. In C or C++, the extra data spills into adjacent memory; which might contain your program’s return addresses, function pointers, or security credentials.</p><p>This is one of the oldest and most exploited vulnerability classes in software. The fix sounds simple; check your sizes, but at low enough levels, it’s easy to get wrong, and the consequences are severe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*BWBiACnkae-L-PVdPqmPPA.png" /><figcaption>visualisation of buffer overflow</figcaption></figure><h3>Three sentences to carry with you</h3><p>Conceptually, a buffer is a waiting area for data between two things running at different speeds.</p><p>In code, it’s a fixed block of memory for holding raw binary data.</p><p>Versus a cache: buffers exist to move data, caches exist to remember it.</p><p><strong><em>The next time you see that loading spinner, you’re watching two systems negotiate a speed difference in real time. The buffer is doing its job. It just isn’t done yet.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f7678cdc77e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mach: A Go Web Framework Built for 2026, Not 2014]]></title>
            <link>https://medium.com/@stephenazongo77/mach-a-go-web-framework-built-for-2026-not-2014-61883cf6d727?source=rss-5d61533533fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/61883cf6d727</guid>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[web-framework]]></category>
            <category><![CDATA[go]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Stephen Azongo]]></dc:creator>
            <pubDate>Wed, 25 Feb 2026 00:02:08 GMT</pubDate>
            <atom:updated>2026-02-25T00:02:08.454Z</atom:updated>
            <content:encoded><![CDATA[<p>The Go web framework landscape hasn’t changed much in a decade. Gin, Echo, and Fiber are solid, but they’re all built on the same foundation: custom routers written before Go had proper routing in its standard library.</p><p>Then Go 1.22 dropped in February 2024 with native method matching and path parameters. Most frameworks ignored it ; they already had working routers. Why rewrite?</p><p>Shabel’s answer: start fresh. Build on what Go provides now, not what it lacked ten years ago.</p><p>I spent a day with Mach, built a production-ready blog API, found and fixed bugs in the framework itself, and came away convinced this is the direction Go web frameworks should have taken. Here’s why.</p><h3>What Makes Mach Different</h3><h4>It’s Built on Go 1.22’s Native Routing</h4><p>Every major Go framework uses a custom router implementation. Gin has a radix tree. Echo has its own. Fiber wraps Fasthttp. They had to; Go’s net/http wasn’t good enough in 2014.</p><p>But in 2024, Go 1.22 added enhanced routing to the standard library. Mach is the first framework I’ve seen that actually uses it as the foundation.</p><p><strong>What this means:</strong></p><ul><li>The routing layer is maintained by Google’s Go team, not community volunteers</li><li>Performance improvements to the stdlib directly benefit Mach</li><li>Zero additional attack surface from custom routing implementations</li><li>Simpler codebase; about 300 lines of core logic</li></ul><p>When your router is literally the Go standard library, you inherit 15 years of optimization and security hardening.</p><h3>Zero External Dependencies</h3><p>Check Mach’s go.mod:</p><pre>module github.com/mrshabel/mach<br>go 1.24.3</pre><p>That’s it. No dependencies. Compare this to the other frameworks; 5 to 20+ external packages.</p><p>In production, every dependency is:</p><ul><li>A potential CVE waiting to happen</li><li>A breaking change that can halt deployments</li><li>Another package to audit and trust</li><li>More licensing to review</li></ul><p>Mach’s approach: if the Go standard library can’t do it, maybe you don’t need it. This is refreshing in an ecosystem where “just add another dependency” is the default.</p><p>Context Pooling Built In</p><p>Mach uses sync.Pool to reuse Context objects across requests:</p><pre>app.pool.New = func() interface{} {<br>    return &amp;Context{app: app}<br>}<br><br>// Later, per request:<br>c := app.pool.Get().(*Context)<br>c.reset(w, r)<br>handler(c)<br>app.pool.Put(c)</pre><p>This is the kind of optimization you’d find in high-performance production systems, not typically included in “beginner-friendly” frameworks. Mach gives you both: an intuitive API with production-grade performance considerations.</p><h4>API Design for JavaScript Developers</h4><p>If you’re coming from Express or Koa, Mach feels immediately familiar:</p><p><strong>Express:</strong></p><pre>app.use(cors());<br>app.get(&#39;/posts/:id&#39;, (req, res) =&gt; {<br>  const id = req.params.id;<br>  res.json({ id });<br>});</pre><p>Mach:</p><pre>app.Use(mach.CORS(&quot;*&quot;))<br>app.GET(&quot;/posts/{id}&quot;, func(c *mach.Context) {<br>  id := c.Param(&quot;id&quot;)<br>  c.JSON(200, map[string]string{&quot;id&quot;: id})<br>})</pre><p>This isn’t accidental. The mental model transfers directly. Route groups, middleware chains, context objects; it’s all there. If you know Express, you know 80% of Mach already.</p><h3>Real Documentation, Not Just Examples</h3><p>Shabel built proper documentation: <a href="https://macha.shabel.me/docs">https://macha.shabel.me/docs</a></p><p>This isn’t a README with two examples. It’s comprehensive docs covering:</p><ul><li>Getting started and installation</li><li>Routing and middleware</li><li>Context methods and helpers</li><li>Deployment and production considerations</li><li>API reference</li></ul><p>When a framework has this level of documentation, it’s not a side project. It’s serious infrastructure.</p><h3>Building Production APIs</h3><p>I built a complete blog API to test everything:</p><ul><li>CRUD operations for posts</li><li>User authentication</li><li>Route groups with API versioning</li><li>Custom middleware (rate limiting, CORS, JSON validation)</li><li>Query parameter filtering</li><li>Statistics endpoints</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IW2c5oF585vyDiFpc98YNA.png" /></figure><figure><img alt="mach api postman test results" src="https://cdn-images-1.medium.com/max/1024/1*XyIUS6xUfsinks57ytr9wg.png" /></figure><p>The entire API is about 500 lines of code. No ORM, no database driver, no authentication library; because Mach forces you to understand what you’re building instead of hiding it behind abstractions.</p><p>Everything works in Postman exactly as you’d expect. Response times are solid. The middleware chain is clean. It feels like using a mature framework.</p><h3>I Found and Fixed Bugs</h3><p>The codebase is readable enough that I found three bugs in a few hours:</p><ol><li><strong>Infinite recursion in route groups</strong> — Route groups without middleware crashed. One-line fix.</li><li><strong>CORS wildcard not working</strong> — The CORS(“*”) example in docs didn’t actually work. Added wildcard detection.</li><li><strong>API inconsistency</strong> — Added BindJSON() alias to match documentation.</li></ol><p>These weren’t deep architectural issues. They were surface bugs that hadn’t been caught yet because the framework is new. But here’s the key: I could read the code, understand it, and fix it. That’s rare for web frameworks.</p><p>Try reading Gin’s router implementation. It’s 2000+ lines of radix tree logic. Mach’s entire routing layer? About 150 lines wrapping net/http.</p><h3>Performance Where It Counts</h3><p>In basic benchmarks, Mach competes directly with Gin and Echo:</p><ul><li>~130k requests/sec for simple JSON endpoints</li><li>~2.5KB memory per request with context pooling</li><li>Minimal allocation in hot paths</li></ul><p>The performance comes from:</p><ol><li>Go 1.22’s optimized stdlib router</li><li>Context pooling reducing GC pressure</li><li>Zero abstraction overhead from the framework itself</li></ol><p>For real applications, framework performance rarely matters; your database and business logic are the bottleneck. But it’s nice knowing the framework isn’t slowing you down.</p><h3>Where Mach Will Be</h3><p>Right now, Mach is new. The ecosystem is small. Community support is growing. Tell them we are coming…lol.</p><p><strong>What’s coming:</strong></p><ul><li>Production deployments (mine included)</li><li>Growing middleware ecosystem</li><li>Community contributions</li><li>Battle-testing at scale</li></ul><p>The foundation is solid. The design is right. The implementation is clean. Everything else is just time and adoption.</p><h3>Why This Matters</h3><p>Go’s web framework ecosystem has been stagnant. We’re using 2014 architecture in 2026 because “it works.” But Go evolved. The language got better. The standard library got better. Our frameworks should too.</p><p>Mach shows what’s possible when you build on modern Go instead of emulating what came before. It’s fast, simple, documented, and production-ready.</p><h3>Should You Use It?</h3><p><strong>Consider Mach if:</strong></p><ul><li>You’re starting a new Go project</li><li>You want minimal dependencies</li><li>You value understanding your stack</li><li>You’re coming from JavaScript/Node.js</li><li>You want something modern and clean</li></ul><p><strong>Stick with Gin/Echo if:</strong></p><ul><li>You need battle-tested stability at massive scale</li><li>You require extensive third-party middleware</li><li>Your team is already expert in another framework</li></ul><p>For new projects, Mach is legitimately compelling. For existing projects, maybe not worth migrating. But for the next thing you build? Take a serious look.</p><h3>Try It</h3><p>Read the docs: <a href="https://macha.shabel.me/docs">https://macha.shabel.me/docs</a></p><p>Build something. You’ll understand why I’m excited about this.</p><p>Shabel built something legitimately good. Not just clever or interesting; actually production-ready. That deserves recognition.</p><p><strong>Check out Mach:</strong> <a href="https://github.com/mrshabel/mach">https://github.com/mrshabel/mach</a><br><strong>Documentation:</strong> <a href="https://macha.shabel.me/docs">https://macha.shabel.me/doc</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61883cf6d727" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What I Learned Building a Ride-Hailing Backend (And What I’d Do Differently)]]></title>
            <link>https://medium.com/@stephenazongo77/what-i-learned-building-a-ride-hailing-backend-and-what-id-do-differently-d3143fe4eb42?source=rss-5d61533533fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3143fe4eb42</guid>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[websocket]]></category>
            <category><![CDATA[redis]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Stephen Azongo]]></dc:creator>
            <pubDate>Thu, 01 Jan 2026 21:54:50 GMT</pubDate>
            <atom:updated>2026-01-01T21:54:50.598Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>A deep dive into geospatial matching, real-time systems, and the lessons learned from shipping a production ride-hailing platform</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*62bcpfG5EoaLNdetZcfdDA.jpeg" /></figure><h3>Introduction: The Problem That Started It All</h3><p>In 2024, I joined Kada, a bike-hailing startup in Ghana, as a backend developer. My first major task? Build the core ride-matching system that would connect passengers to nearby drivers in real-time.</p><p>Simple enough, right? A user requests a ride, we find nearby drivers, notify them, and the first to accept gets the ride.</p><p>What I didn’t anticipate was the cascade of technical challenges hiding beneath that “simple” flow:</p><ul><li>How do you efficiently query drivers within a 5km radius from millions of location records?</li><li>What happens when 50 users request rides simultaneously in the same area?</li><li>How do you prevent two drivers from accepting the same ride?</li><li>How do you keep the API responsive when sending notifications to 20 drivers takes 3 seconds?</li></ul><p>This is the story of how I solved these problems, the mistakes I made, and what I’d do differently with the knowledge I have now.</p><h3>The Stack: What We Built With</h3><p>Before diving into the architecture, here’s what we used:</p><p><strong>Backend:</strong></p><ul><li>Node.js + Express (API and business logic)</li><li>MongoDB (primary database)</li><li>Redis (we didn’t use this initially — mistake #1)</li></ul><p><strong>Key Features:</strong></p><ul><li>Geospatial matching (find drivers near passenger)</li><li>Real-time ride assignment</li><li>Notification system for drivers and passengers</li><li>Driver online/offline status management</li><li>Ride history and analytics</li></ul><p><strong>The Scale:</strong> At launch, we handled ~50 daily rides across Accra with about 12 active drivers. Not massive scale, but enough to expose real problems.</p><h3>Part 1: The Geospatial Challenge</h3><h3>The Problem: Finding Nearby Drivers Fast</h3><p>When a passenger requests a ride, we need to:</p><ol><li>Find all drivers within a reasonable distance (say 5km)</li><li>Filter for drivers who are currently online</li><li>Rank them by proximity or some other metric</li><li>Do all this in under 200ms</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xr9Z7vaejgcwe2XPpO0zTQ.png" /></figure><h3>Our Solution: MongoDB’s Geospatial Indexes</h3><p>MongoDB has built-in support for geospatial queries using 2dsphere indexes. Here’s how we implemented it:</p><pre>// Driver schema<br>const driverSchema = new Schema({<br>  userId: { type: ObjectId, ref: &#39;User&#39; },<br>  location: {<br>    type: { type: String, enum: [&#39;Point&#39;], required: true },<br>    coordinates: { type: [Number], required: true } // [longitude, latitude]<br>  },<br>  isOnline: { type: Boolean, default: false },<br>  status: { type: String, enum: [&#39;available&#39;, &#39;busy&#39;, &#39;offline&#39;] }<br>});<br><br>// Create geospatial index<br>driverSchema.index({ location: &#39;2dsphere&#39; });<br>// Query for nearby drivers<br>async function findNearbyDrivers(passengerLocation, radiusInMeters = 5000) {<br>  const drivers = await Driver.find({<br>    location: {<br>      $near: {<br>        $geometry: {<br>          type: &#39;Point&#39;,<br>          coordinates: [passengerLocation.lng, passengerLocation.lat]<br>        },<br>        $maxDistance: radiusInMeters<br>      }<br>    },<br>    isOnline: true,<br>    status: &#39;available&#39;<br>  }).limit(20);<br>  <br>  return drivers;<br>}</pre><h4><strong>Why this works:</strong></h4><ul><li>The $near operator uses the 2dsphere index to efficiently query locations</li><li>MongoDB calculates distances using the Haversine formula (accurate for Earth’s spherical surface)</li><li>The compound query (location + isOnline + status) filters in a single database hit</li></ul><p><strong>Performance:</strong> With ~200 drivers in the database, this query consistently returned results in 20–50ms.</p><h3>What I’d Do Differently: Redis for Hot Data</h3><p>The problem with our approach? <strong>Every ride request hit the database.</strong></p><p>At &lt; 50 rides/day, this wasn’t an issue. But imagine 5,000 concurrent ride requests. MongoDB would struggle.</p><p><strong>Better approach: Redis Cache Layer</strong></p><pre>// Driver sends location update every 10 seconds<br>async function updateDriverLocation(driverId, location) {<br>  // Update Redis immediately (fast)<br>  await redis.geoadd(<br>    &#39;drivers:locations&#39;,<br>    location.lng,<br>    location.lat,<br>    driverId<br>  );<br>  await redis.expire(`drivers:locations`, 300); // 5 min TTL<br>  <br>  // Update MongoDB asynchronously (for persistence)<br>  await Driver.updateOne(<br>    { _id: driverId },<br>    { $set: { location, locationUpdatedAt: new Date() } }<br>  );<br>}<br><br>// Query nearby drivers from Redis<br>async function findNearbyDriversFromRedis(location, radiusKm = 5) {<br>  const driverIds = await redis.georadius(<br>    &#39;drivers:locations&#39;,<br>    location.lng,<br>    location.lat,<br>    radiusKm,<br>    &#39;km&#39;,<br>    &#39;WITHDIST&#39;,<br>    &#39;ASC&#39;<br>  );<br>  <br>  // Filter for online drivers (also cached in Redis)<br>  const onlineDrivers = await redis.smembers(&#39;drivers:online&#39;);<br>  <br>  return driverIds.filter(d =&gt; onlineDrivers.includes(d.id));<br>}</pre><p><strong>Why this is better:</strong></p><ul><li>Redis GEORADIUS query: ~0.5–1ms (vs 20–50ms for MongoDB)</li><li>Can handle 10,000+ queries/second</li><li>Driver locations auto-expire if not updated (handles offline drivers gracefully)</li></ul><h3>Part 2: The Notification Bottleneck</h3><h3>The Problem: Slow API Responses</h3><p>Our initial ride request flow looked like this:</p><pre>app.post(&#39;/rides&#39;, async (req, res) =&gt; {<br>  // 1. Find nearby drivers (50ms)<br>  const drivers = await findNearbyDrivers(req.body.pickup);<br>  <br>  // 2. Create ride record (100ms)<br>  const ride = await Ride.create({<br>    passengerId: req.user.id,<br>    pickup: req.body.pickup,<br>    status: &#39;pending&#39;<br>  });<br>  <br>  // 3. Create notifications for each driver (2000ms for 20 drivers!)<br>  for (const driver of drivers) {<br>    await Notification.create({<br>      userId: driver.userId,<br>      rideId: ride._id,<br>      type: &#39;ride_request&#39;<br>    });<br>  }<br>  <br>  // 4. Send push notifications (3000ms!)<br>  for (const driver of drivers) {<br>    await sendPushNotification(driver.fcmToken, {<br>      title: &#39;New Ride Request&#39;,<br>      body: `Pickup at ${req.body.pickup.address}`<br>    });<br>  }<br>  <br>  // User waits 5+ seconds for response<br>  res.json({ rideId: ride._id });<br>});</pre><p><strong>The problem:</strong> Users waited 5+ seconds for a response because we were doing everything synchronously.</p><h3>Our Solution: Background Jobs with BullMQ</h3><p>I had previously used BullMQ (a Redis-based job queue) for another project, so I knew it could solve this.</p><pre>const { Queue } = require(&#39;bullmq&#39;);<br><br>const rideNotificationQueue = new Queue(&#39;ride-notifications&#39;, {<br>  connection: redisConnection<br>});<br>app.post(&#39;/rides&#39;, async (req, res) =&gt; {<br>  // 1. Find nearby drivers (50ms)<br>  const drivers = await findNearbyDrivers(req.body.pickup);<br>  <br>  if (drivers.length === 0) {<br>    return res.status(404).json({ error: &#39;No drivers available&#39; });<br>  }<br>  <br>  // 2. Create ride record (100ms)<br>  const ride = await Ride.create({<br>    passengerId: req.user.id,<br>    pickup: req.body.pickup,<br>    status: &#39;pending&#39;,<br>    matchedDrivers: drivers.map(d =&gt; d._id)<br>  });<br>  <br>  // 3. Queue notification job (10ms)<br>  await rideNotificationQueue.add(&#39;notify-drivers&#39;, {<br>    rideId: ride._id,<br>    driverIds: drivers.map(d =&gt; d._id),<br>    pickupAddress: req.body.pickup.address<br>  });<br>  <br>  // User gets response in ~160ms!<br>  res.json({ <br>    rideId: ride._id,<br>    message: &#39;Finding drivers...&#39;<br>  });<br>});</pre><pre><strong>Worker process (separate file):</strong></pre><pre>const { Worker } = require(&#39;bullmq&#39;);<br><br>const worker = new Worker(&#39;ride-notifications&#39;, async (job) =&gt; {<br>  const { rideId, driverIds, pickupAddress } = job.data;<br>  <br>  // Create notifications in bulk<br>  const notifications = driverIds.map(driverId =&gt; ({<br>    userId: driverId,<br>    rideId,<br>    type: &#39;ride_request&#39;,<br>    createdAt: new Date()<br>  }));<br>  <br>  await Notification.insertMany(notifications);<br>  <br>  // Send push notifications (with retry logic)<br>  await Promise.allSettled(<br>    driverIds.map(driverId =&gt; <br>      sendPushNotification(driverId, {<br>        title: &#39;New Ride Request&#39;,<br>        body: `Pickup at ${pickupAddress}`<br>      })<br>    )<br>  );<br>  <br>  console.log(`Notified ${driverIds.length} drivers for ride ${rideId}`);<br>}, {<br>  connection: redisConnection<br>});</pre><h4><strong>Results:</strong></h4><ul><li>API response time: 5000ms → 160ms (97% improvement)</li><li>Failed notifications don’t block the main request</li><li>Automatic retry if notification service is down</li><li>Can scale by adding more workers</li></ul><h3>Lesson Learned: Decouple Heavy Operations</h3><p>The pattern here applies beyond notifications:</p><ul><li>Email sending</li><li>Image processing</li><li>Report generation</li><li>Analytics calculations</li></ul><p>If an operation:</p><ol><li>Takes more than 200ms</li><li>Doesn’t affect the immediate response</li><li>Can tolerate slight delays</li></ol><p>…then it belongs in a background job.</p><h3>Part 3: The Race Condition Problem</h3><h3>The Problem: Double-Booking Drivers</h3><p>We notify 20 drivers about a ride. Two drivers click “Accept” at the exact same time. What happens?</p><p><strong>Our buggy code:</strong></p><pre>socket.on(&#39;accept-ride&#39;, async (data) =&gt; {<br>  const { rideId, driverId } = data;<br>  <br>  // Check if ride is still available<br>  const ride = await Ride.findById(rideId);<br>  <br>  if (ride.status === &#39;pending&#39;) {<br>    // Update ride<br>    await Ride.updateOne(<br>      { _id: rideId },<br>      { $set: { driverId, status: &#39;accepted&#39; } }<br>    );<br>    <br>    // Update driver<br>    await Driver.updateOne(<br>      { _id: driverId },<br>      { $set: { status: &#39;busy&#39; } }<br>    );<br>    <br>    socket.emit(&#39;ride-accepted&#39;);<br>  }<br>});</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oxOQRm3wWtrI1f_iD4IG3g.png" /></figure><p><strong>The bug:</strong> Between checking ride.status and updating it, another driver&#39;s request might also pass the check. Both update the ride. Double booking.</p><h3>The Solution: Atomic Operations</h3><pre>socket.on(&#39;accept-ride&#39;, async (data) =&gt; {<br>  const { rideId, driverId } = data;<br>  <br>  // Atomic update - check and update in ONE operation<br>  const result = await Ride.updateOne(<br>    { <br>      _id: rideId,<br>      status: &#39;pending&#39;,<br>      driverId: { $exists: false } // Ensure not already claimed<br>    },<br>    { <br>      $set: { <br>        driverId,<br>        status: &#39;accepted&#39;,<br>        acceptedAt: new Date()<br>      }<br>    }<br>  );<br>  <br>  if (result.modifiedCount === 0) {<br>    // Another driver got it first<br>    socket.emit(&#39;ride-already-taken&#39;);<br>    return;<br>  }<br>  <br>  // Only the winning driver gets here<br>  await Driver.updateOne(<br>    { _id: driverId },<br>    { $set: { status: &#39;busy&#39; } }<br>  );<br>  <br>  // Notify passenger<br>  io.to(`passenger:${ride.passengerId}`).emit(&#39;ride-accepted&#39;, {<br>    driverId,<br>    estimatedArrival: &#39;5 minutes&#39;<br>  });<br>  <br>  socket.emit(&#39;ride-accepted&#39;);<br>});</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2I9s7-YWWIDVD6RVOhUkNQ.png" /></figure><p><strong>Key insight:</strong> MongoDB’s updateOne is atomic. The condition and update happen in a single operation, preventing race conditions.</p><p><strong>PostgreSQL equivalent:</strong></p><pre>UPDATE rides <br>SET driver_id = $1, status = &#39;accepted&#39;, accepted_at = NOW()<br>WHERE id = $2 AND status = &#39;pending&#39; AND driver_id IS NULL<br>RETURNING *;</pre><p>If RETURNING * gives you no rows, someone else claimed it first.</p><h3>Part 4: Real-Time Updates with WebSockets</h3><h3>The Problem: Polling is Expensive</h3><p>Initially, we had drivers polling for new rides every 5 seconds:</p><pre>// Driver app (bad approach)<br>setInterval(async () =&gt; {<br>  const response = await fetch(&#39;/api/rides/pending&#39;);<br>  const rides = await response.json();<br>  // Update UI<br>}, 5000);</pre><p><strong>Problems:</strong></p><ul><li>200 drivers × 12 requests/minute = 2,400 requests/minute just for ride checks</li><li>5-second delay before drivers see new rides</li><li>Wasted bandwidth when there are no new rides</li></ul><h3>Our Solution: WebSockets with Socket.io</h3><pre>// Backend<br>const io = require(&#39;socket.io&#39;)(server);<br><br>io.on(&#39;connection&#39;, (socket) =&gt; {<br>  const userId = socket.handshake.auth.userId;<br>  const userType = socket.handshake.auth.userType; // &#39;driver&#39; or &#39;passenger&#39;<br>  <br>  // Join user-specific room<br>  socket.join(`${userType}:${userId}`);<br>  <br>  console.log(`${userType} ${userId} connected`);<br>  <br>  // Driver updates location<br>  socket.on(&#39;location-update&#39;, async (data) =&gt; {<br>    await updateDriverLocation(data.driverId, data.location);<br>    <br>    // If driver has active ride, notify passenger<br>    const activeRide = await getActiveRide(data.driverId);<br>    if (activeRide) {<br>      io.to(`passenger:${activeRide.passengerId}`).emit(&#39;driver-location&#39;, {<br>        location: data.location,<br>        estimatedArrival: calculateETA(data.location, activeRide.pickup)<br>      });<br>    }<br>  });<br>  <br>  socket.on(&#39;disconnect&#39;, () =&gt; {<br>    console.log(`${userType} ${userId} disconnected`);<br>  });<br>});<br>// When ride is created, notify specific drivers<br>async function notifyDrivers(rideId, driverIds) {<br>  const ride = await Ride.findById(rideId);<br>  <br>  for (const driverId of driverIds) {<br>    io.to(`driver:${driverId}`).emit(&#39;ride-request&#39;, {<br>      rideId,<br>      pickup: ride.pickup,<br>      estimatedDistance: &#39;2.3 km&#39;<br>    });<br>  }<br>}</pre><p><strong>Frontend (Driver app):</strong></p><pre>import io from &#39;socket.io-client&#39;;<br><br>const socket = io(&#39;https://api.kada.com&#39;, {<br>  auth: { <br>    userId: currentUser.id,<br>    userType: &#39;driver&#39;,<br>    token: authToken<br>  }<br>});<br>// Listen for ride requests<br>socket.on(&#39;ride-request&#39;, (ride) =&gt; {<br>  showNotification(&#39;New Ride Request!&#39;, ride);<br>});<br>// Send location every 10 seconds<br>setInterval(() =&gt; {<br>  if (isOnline) {<br>    socket.emit(&#39;location-update&#39;, {<br>      driverId: currentUser.id,<br>      location: currentLocation<br>    });<br>  }<br>}, 10000);</pre><p><strong>Results:</strong></p><ul><li>Instant notifications (sub-second latency)</li><li>2,400 requests/minute → ~200 persistent connections (90% reduction)</li><li>Better user experience (real-time feels responsive)</li></ul><h3>Part 5: What I’d Build Differently Today</h3><p>If I were to rebuild Kada’s backend from scratch with what I know now, here’s the architecture I’d choose:</p><h3>The Full Stack</h3><p><strong>Database:</strong></p><ul><li><strong>PostgreSQL (Primary)</strong> with PostGIS for geospatial queries</li><li>Better for transactional integrity (ACID guarantees)</li><li>Stronger query capabilities for analytics</li><li>Better tooling and ecosystem maturity</li><li><strong>Master-Slave replication</strong> (1 master for writes, 2 replicas for reads)</li></ul><p><strong>Caching Layer:</strong></p><ul><li><strong>Redis Cluster</strong> for distributed caching</li><li>Driver locations (geospatial data)</li><li>Online driver list</li><li>Active ride sessions</li><li>User sessions</li></ul><p><strong>Job Queue:</strong></p><ul><li><strong>BullMQ with Redis</strong></li><li>Notification sending</li><li>Location history archiving</li><li>Analytics processing</li><li>Report generation</li></ul><p><strong>Real-Time Communication:</strong></p><ul><li><strong>Socket.io with Redis Adapter</strong> for multi-server support</li><li>Allows horizontal scaling of WebSocket servers</li><li>Shared state across server instances</li></ul><p><strong>Load Balancer:</strong></p><ul><li><strong>Nginx</strong> for distributing traffic across multiple Node.js instances</li></ul><h3>The Architecture Diagram</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*z6sIM0SAFlTYRjOLaSbogQ.png" /><figcaption>architecture diagram</figcaption></figure><h3>Key Design Decisions</h3><p><strong>1. PostgreSQL over MongoDB</strong></p><ul><li>Ride data is inherently relational (users → rides → drivers)</li><li>Need strong transactional guarantees for payments</li><li>Better analytics capabilities with SQL</li><li>PostGIS is just as good as MongoDB for geospatial queries</li></ul><p><strong>2. Redis for Hot Data</strong></p><ul><li>Driver locations change every 10 seconds (too write-heavy for Postgres)</li><li>Query latency: 0.5ms (Redis) vs 20ms (Postgres)</li><li>TTL automatically handles stale data</li></ul><p><strong>3. BullMQ for Background Jobs</strong></p><ul><li>Learned this from a previous project — game changer for API responsiveness</li><li>Automatic retries and failure handling</li><li>Easy to scale horizontally (add more workers)</li></ul><p><strong>4. WebSockets for Real-Time</strong></p><ul><li>Polling doesn’t scale beyond a few hundred users</li><li>Users expect instant updates (modern UX standard)</li><li>Enables features like live driver tracking</li></ul><p><strong>5. Master-Slave Postgres</strong></p><ul><li>Ride-hailing is read-heavy (viewing history, analytics)</li><li>Separating reads from writes reduces contention</li><li>Can scale reads by adding more replicas</li></ul><h3>Lessons Learned</h3><h3>1. Don’t Optimize Prematurely, But Know the Path</h3><p>Our MongoDB + polling approach worked fine for 500 rides/day. We didn’t need Redis or WebSockets at launch.</p><p><strong>But I should have known:</strong></p><ul><li>What the bottlenecks would be</li><li>How to scale when needed</li><li>The migration path from v1 to v2</li></ul><p>Building for scale from day 1 would have over-engineered the system. But being ignorant of scaling strategies would have caused pain later.</p><h3>2. Background Jobs Are Non-Negotiable</h3><p>The single biggest improvement to our system was adding BullMQ. It transformed our API from “sometimes slow” to “consistently fast.”</p><p><strong>Rule of thumb:</strong> If an operation takes &gt;200ms and doesn’t affect the immediate response, queue it.</p><h3>3. Atomic Operations Prevent Subtle Bugs</h3><p>Race conditions are hard to catch in testing because they’re timing-dependent. In production with concurrent users, they’re inevitable.</p><p>Always use atomic updates for critical state changes (ride assignment, inventory management, etc.).</p><h3>4. Real-Time is Table Stakes Now</h3><p>Users expect instant updates. Polling feels broken in 2024.</p><p>If you’re building anything with real-time components (chat, notifications, live tracking), budget for WebSockets from the start.</p><h3>5. Separate Hot and Cold Data</h3><p>Not all data deserves the same storage:</p><ul><li><strong>Hot data</strong> (frequently accessed, changes often): Redis</li><li><strong>Warm data</strong> (frequently accessed, rarely changes): Cache with DB fallback</li><li><strong>Cold data</strong> (rarely accessed): Database or archive storage</li></ul><p>This separation dramatically improves performance and reduces costs.</p><h3>Conclusion</h3><p>Building Kada taught me that real-world backend engineering is about tradeoffs:</p><ul><li>Speed vs consistency</li><li>Simplicity vs scalability</li><li>Cost vs performance</li><li>Present needs vs future growth</li></ul><p>The “best” architecture isn’t the most sophisticated — it’s the one that solves today’s problems while leaving room to evolve.</p><p>If you’re building a similar system, I hope this deep-dive gives you a clearer picture of the challenges ahead and the solutions that actually work in production.</p><h3>Resources</h3><p><strong>Geospatial Queries:</strong></p><ul><li><a href="https://docs.mongodb.com/manual/geospatial-queries/">MongoDB Geospatial Queries</a></li><li><a href="https://postgis.net/docs/">PostGIS Documentation</a></li></ul><p><strong>Background Jobs:</strong></p><ul><li><a href="https://docs.bullmq.io/">BullMQ Documentation</a></li><li><a href="https://www.cloudamqp.com/blog/why-is-a-rabbitmq-message-queue-so-important.html">Why Job Queues Matter</a></li></ul><p><strong>WebSockets:</strong></p><ul><li><a href="https://socket.io/docs/">Socket.io Documentation</a></li><li><a href="https://ably.com/topic/websockets-vs-http">WebSocket vs HTTP</a></li></ul><p><strong>System Design:</strong></p><ul><li><a href="https://dataintensive.net/">Designing Data-Intensive Applications</a> (book)</li><li><a href="https://github.com/donnemartin/system-design-primer">System Design Primer</a></li></ul><p><em>Have you built a similar system? What challenges did you face? Let’s discuss in the comments.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3143fe4eb42" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Tested My Friend’s AI Chatbot and Now I Understand Why Businesses Are Going Crazy]]></title>
            <link>https://medium.com/@stephenazongo77/i-tested-my-friends-ai-chatbot-and-now-i-understand-why-businesses-are-going-crazy-f4d64f79a6e5?source=rss-5d61533533fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4d64f79a6e5</guid>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[saas]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Stephen Azongo]]></dc:creator>
            <pubDate>Tue, 16 Dec 2025 11:25:21 GMT</pubDate>
            <atom:updated>2025-12-16T19:42:13.746Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A UG student built this. And it’s actually insane.</em></p><p>You know that friend who’s always working on “projects”? The one who’s coding something at 2 AM while everyone else is sleeping? The one who says “I’m building something” and you just nod like “yeah yeah, sure bro”?</p><p>I have that friend. His name is Joy Owusu Ansah. He’s a Level 400 CS student at UG.</p><p>And last week, he showed me what he’s been building.</p><p>I tested it. Played around with it. Tried to break it. Asked it dumb questions. Smart questions. Confusing questions.</p><p>And herh…</p><p><strong>This thing is actually mad.</strong></p><h3>The “Wait, WHAT?!” Moment</h3><p>Let me paint the picture for you.</p><p>Joy shows me his laptop. Opens up this platform called <strong>Formachat</strong>. And he’s like “chale, I built a SaaS that lets businesses create AI chatbots for customer support.”</p><p>Me: <em>nodding</em> “Okay cool cool…” <em>(thinking: another chatbot thing, we move)</em></p><p>Him: “You can set it up in 5 minutes. Just add your business info, and the AI learns everything about your business instantly.”</p><p>Me: “Mhmm…” <em>(still not impressed, I’ve seen chatbots before)</em></p><p>Him: “Then you can deploy it anywhere. Put it on your website, share a link, or get this; <strong>generate a QR code and stick it on your physical products.</strong>”</p><p>Me: “Wait, what?”</p><p>Him: “Yeah. Someone scans the QR code on your product packaging, and boom , they’re chatting with an AI that knows EVERYTHING about your business. Instant support. 24/7.”</p><p><strong>That’s when my brain broke.</strong></p><h3>Let Me Explain Why This Is Mad</h3><p>Picture this:</p><p>You run a small business. Maybe you sell hair products. Or you’re a restaurant. Or you do graphic design. Whatever.</p><p>Every day, people ask you the same questions:</p><ul><li>“What are your prices?”</li><li>“Do you deliver?”</li><li>“Are you open on Sundays?”</li><li>“What’s the difference between Product A and Product B?”</li><li>“Can I get a refund?”</li></ul><p>And you’re trying to run your business, but you’re constantly on your phone answering these questions. Sometimes you’re sleeping. Sometimes you’re busy. Sometimes you just… miss the message.</p><p><strong>And that’s how you lose customers.</strong></p><p>Now imagine:</p><p>Someone sends you a message at 2 AM asking “Do you have this in stock?”</p><p><strong>Your AI chatbot answers. Instantly.</strong></p><p>Not “Our business hours are 9–5, we’ll get back to you tomorrow.”</p><p><strong>Actual answer. Right now. Accurate.</strong></p><p>That customer doesn’t leave. They don’t go to your competitor. They get their answer and they BUY.</p><h3>The Part Where I Became a Believer</h3><p>Joy gave me access to the beta. Told me to try it out.</p><p>So I created a fake business; let’s say I’m selling sneakers. I added some basic info:</p><ul><li>Business name</li><li>What I sell</li><li>Prices</li><li>Delivery options</li><li>Return policy</li></ul><p>Setup time? <strong>Literally 4 minutes.</strong></p><p>Then I deployed the chatbot. Joy generated a link for me. And a QR code. And an embed code for a website.</p><p>I opened the chat link on my phone and started asking questions like I’m a customer:</p><p><strong>Me:</strong> “Do you have size 42?”</p><p><strong>The AI:</strong> “Yes, we have sizes 38–44 available in stock. Which style are you interested in?”</p><p><strong>Me:</strong> “How much is delivery to Legon?”</p><p><strong>The AI:</strong> “Delivery to Legon is GH₵15 and takes 1–2 business days. Would you like to place an order?”</p><p><strong>Me:</strong> <em>(trying to break it)</em> “What if I don’t like it when it arrives?”</p><p><strong>The AI:</strong> “We have a 7-day return policy. If you’re not satisfied, you can return the item in its original condition for a full refund or exchange.”</p><p>Chale.</p><p>CHALE.</p><p>This thing was answering like a real human. No “I don’t understand.” No “Please rephrase your question.” Just… accurate, helpful responses.</p><p>And remember, I set this up in <strong>4 minutes.</strong></p><h3>The Analytics Made Me Emotional</h3><p>Okay so after testing the chatbot, Joy showed me the analytics dashboard.</p><p>And this is where I lost it.</p><p>The dashboard shows:</p><ul><li><strong>Message count</strong> — How many people have chatted with your bot</li><li><strong>Lead count</strong> — How many people showed buying interest</li><li><strong>Conversion rate</strong> — Percentage of chats that turned into potential customers</li><li><strong>Full conversation history</strong> — You can read every single chat</li></ul><figure><img alt="The analytics page of my sample business chatbot" src="https://cdn-images-1.medium.com/max/1024/1*CIFuRoHLE_yvDQHyM7pnYw.png" /></figure><figure><img alt="chat history of formchat" src="https://cdn-images-1.medium.com/max/1024/1*6JKU75JGBabvJGKoLCG3dQ.png" /></figure><p>Now let me tell you why this hit different.</p><p>I did my internship at [Name Witheld]. One of the things they were building was a system to track customer interactions, to see who’s just browsing vs who’s actually interested vs who’s ready to buy.</p><p>That’s a WHOLE CRM (Customer Relationship Management) system. Companies pay thousands of dollars for software like that.</p><p>And Joy’s system? <strong>It already does this. Out of the box.</strong></p><p>You can literally see:</p><ul><li>Which conversations are hot leads (people ready to buy)</li><li>Which products people ask about most</li><li>What questions people ask most (so you know what info to add to your chatbot)</li><li>Peak hours when people message your bot</li></ul><p><strong>This is business intelligence. This is marketing data. This is GOLD.</strong></p><p>And small businesses get this for FREE during the beta period.</p><p>Mad. Absolutely mad.</p><h3>The QR Code Thing Still Has Me Shook</h3><p>Can we talk about the QR code feature again? Because I don’t think you understand how game-changing this is.</p><p>You’re a business. You make products. Maybe handmade jewelry. Or food items. Or skincare.</p><p>You stick a QR code on your packaging that says: <strong>“Questions? Scan here for instant help!”</strong></p><p>Customer scans it. <strong>Boom.</strong> They’re chatting with your AI support.</p><p>They want to reorder? The AI can capture their info as a lead.</p><p>They have a complaint? The AI handles it (and you can see the conversation later and follow up personally if needed).</p><p>They want to know ingredients, or care instructions, or anything? <strong>AI answers instantly.</strong></p><p>No app to download. No account to create. Just scan and chat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*STxWG_HM2yho6LMXxySiKg.png" /></figure><figure><img alt="chat conversation page" src="https://cdn-images-1.medium.com/max/1024/1*LJChKlOn8bLSFRKusy2xqw.png" /></figure><p>Think about this for:</p><ul><li><strong>Restaurants</strong> — Put QR codes on tables. Customers ask about menu items, allergens, recommendations. AI handles it.</li><li><strong>Retail shops</strong> — Put QR codes on products. Customers get instant info without hunting for a staff member.</li><li><strong>Service businesses</strong> — Put QR codes on your business card. Clients can ask questions anytime.</li></ul><p>This is the kind of innovation that makes you go “why didn’t this exist before?!”</p><h3>The Guy Behind It: Joy Owusu Ansah</h3><p>Let me tell you about Joy because his story is actually inspiring.</p><p>Joy’s been building chatbots since Level 200. LEVEL 200. Most of us were still struggling with Java basics, and this guy was building AI assistants.</p><p>One of his projects was called <strong>Maternal AI</strong> — a chatbot that helped pregnant women get answers to their pregnancy questions without having to visit a doctor for every small thing.</p><p>The idea was brilliant. But it didn’t get the support it needed.</p><p>Most people would’ve given up. “Ah, I tried, it didn’t work, let me move on.”</p><p>Not Joy.</p><p>He learned about RAG (Retrieval-Augmented Generation — basically how to make AI chatbots smart by feeding them specific knowledge). And he thought:</p><p><strong>“What if I use this for small businesses who need customer support but can’t afford to hire people or pay for expensive software?”</strong></p><p>I asked him why he’s building this, and his answer hit me:</p><blockquote>“I just wanted to build something more than a personal project. Something I could turn into a business that my close friends can work on or work with us while in school for experience.”</blockquote><p>Read that again.</p><p>He’s not just building for himself. He’s building something his friends can work on. Something that creates opportunities.</p><p>He’s a Level 400 student building a legitimate SaaS product that businesses are actually using. While handling school. While probably stressing about exams like the rest of us.</p><p><strong>That’s the kind of energy we need to celebrate.</strong></p><h3>What Businesses Get (And It’s A LOT)</h3><p>Let me break down what you actually get with Formchat:</p><h3>What’s Live Right Now</h3><ol><li><strong>AI agent that knows your business</strong> — Just feed it your info, and it becomes an expert on your products/services</li><li><strong>Deploy anywhere</strong> — Website widget, direct chat link, or QR code</li><li><strong>Lead capture</strong> — Automatically identifies and tracks potential customers</li><li><strong>Conversation tracking</strong> — See every chat, export data, analyze patterns</li><li><strong>Instant updates</strong> — Change your business info and the AI learns it immediately</li><li><strong>Human handoff</strong> — If the AI can’t handle something, it can transfer to a real person</li></ol><h3>Coming Soon</h3><p>Joy’s not stopping here. The roadmap includes:</p><ul><li><strong>WhatsApp &amp; Telegram integration</strong> — Meet customers where they already are</li><li><strong>Voice support</strong> — AI that can actually TALK to customers</li><li><strong>Payment processing</strong> — Customers can buy directly through the chat</li><li><strong>Developer API</strong> — For technical businesses that want custom integrations</li></ul><figure><img alt="bot set-up page of formchat" src="https://cdn-images-1.medium.com/max/1024/1*cj-v6g6sSvrYo6Heb2GTLw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iCa_M_9MUzj6KgEpxv9YpA.png" /></figure><p>And here’s the crazy part; he’s already planning features based on user feedback. The UI is getting polished. Color customization is coming (so your chatbot matches your brand).</p><p>But the ultimate goal? Joy told me:</p><blockquote>“The ultimate goal is not to be known as a chatbot company…”</blockquote><p>He’s thinking bigger. This is just the beginning.</p><h3>The Beta Deal (This Is Insane)</h3><p>Okay so during the beta period, businesses get:</p><ul><li><strong>100% FREE access</strong> — Zero cost during the entire beta</li><li><strong>40% discount</strong> — For the first 6 months after official launch</li><li><strong>Priority support</strong> — Direct access to Joy and the core team</li><li><strong>Shape the product</strong> — Your feedback actually influences what features get built</li><li><strong>Early access</strong> — Get new features before everyone else</li></ul><p>Let me put this in perspective:</p><p>Professional chatbot software like Intercom or Drift costs <strong>$39-$999 per month.</strong></p><p>Customer support tools like Zendesk? <strong>$19-$99 per agent per month.</strong></p><p>Formchat during beta? <strong>FREE.</strong></p><p>And even after launch, with that 40% discount, you’re looking at a fraction of what the big players charge.</p><p>For small Ghanaian businesses that are bootstrapping, counting every cedi, trying to compete with bigger companies…</p><p><strong>This is a game-changer.</strong></p><h3>Why This Matters for Ghanaian Businesses</h3><p>Look, we all know the struggle.</p><p>You’re running a small business in Ghana. You’re on Instagram, maybe WhatsApp Business, maybe a simple website.</p><p>Customers message you at all hours. You’re trying to respond fast because if you don’t, they’ll go to your competitor who replied first.</p><p>But you can’t be online 24/7. You’re human. You sleep. You have a life.</p><p><strong>So you lose customers.</strong></p><p>Not because your product is bad. Not because your prices aren’t competitive.</p><p><strong>Just because you couldn’t reply fast enough.</strong></p><p>Formachat solves this.</p><p>Your AI works while you sleep. While you’re in class. While you’re busy with another customer. While you’re spending time with family.</p><p><strong>Your business never stops responding.</strong></p><p>And for businesses that are growing, trying to scale, but can’t afford to hire a customer support team yet?</p><p><strong>This is your customer support team.</strong></p><p>One that never sleeps. Never gets tired. Never asks for a salary increase. Never calls in sick.</p><h3>The Real Test: Beta Users Are Hyped</h3><p>Joy’s already got beta users testing this. Real businesses. Real use cases.</p><p>The feedback? People are loving it. Yes, there are some UI tweaks needed (Joy’s already on it). But the core product? <strong>Solid.</strong></p><p>Businesses are seeing:</p><ul><li>Faster response times (obviously — it’s instant)</li><li>More leads captured (because no one falls through the cracks)</li><li>Better customer satisfaction (people get answers immediately)</li><li>Time saved (not answering the same questions over and over)</li></ul><p>And this is just the beta. Imagine when all the planned features roll out.</p><p>WhatsApp integration alone is going to be HUGE for Ghanaian businesses. That’s where our customers already are.</p><h3>My Honest Take</h3><p>I’m writing this as a friend, yes. But I’m also writing this as someone who tested the product and was genuinely impressed.</p><p>I’ve seen a lot of student projects. Some are cool concepts that don’t work properly. Some work but are too complicated. Some are solutions looking for a problem.</p><p>Formchat is different.</p><p>It solves a <strong>real problem</strong> (customer support is expensive and time-consuming)<br> For <strong>real people</strong> (small businesses that can’t afford enterprise software)<br> With a <strong>real solution</strong> (AI that actually works, at a price that makes sense)<br> Built by a <strong>real student</strong> (not some Silicon Valley startup with millions in funding)</p><p>Joy is building this at UG. While probably stressed about exams. While dealing with all the wahala we students face.</p><p>And he’s not just building for himself. He’s building something that creates value. For businesses. For customers. For his friends who want to work with him.</p><p><strong>That deserves support.</strong></p><h3>What Happens Next</h3><p>If you’re a business owner reading this:</p><p><strong>Try the beta.</strong> It’s free. Setup takes 5 minutes. You literally have nothing to lose.</p><p>Even if you’re skeptical about AI, even if you think “this won’t work for my business,” just TRY it.</p><p>Generate that QR code. Stick it somewhere. See what happens.</p><p>Check that analytics dashboard. See the conversations. See the leads.</p><p><strong>Then decide.</strong></p><p>If you’re a student reading this:</p><p><strong>This is what’s possible.</strong></p><p>Joy is a student just like us. He’s not some genius with a trust fund and unlimited resources.</p><p>He just had an idea, learned the skills, built the thing, and put it out there.</p><p>If he can do it, we can do it. In our own ways. With our own ideas.</p><p>If you’re just someone who loves seeing Ghanaian innovation:</p><p><strong>Spread the word.</strong> Share this. Tell a business owner. Tell your mom who runs a side hustle. Tell your cousin with the online shop.</p><p>The best way to support Ghanaian tech is to USE Ghanaian tech.</p><h3>The Bottom Line</h3><p>Formchat is a UG student’s solution to a problem every business faces.</p><p>It’s well-built. It’s useful. It’s affordable. It’s made by one of us.</p><p>And it’s available RIGHT NOW.</p><p>Will it become the next big thing? I don’t know. Maybe. Maybe not.</p><p>But what I DO know is that Joy is building something real, something useful, and something that deserves attention.</p><p>So I’m giving it attention.</p><p>And if you made it this far, maybe you should too.</p><p><strong>Try Formchat Beta:</strong><br><a href="http://www.formachat.com/">Link to Site</a></p><p><strong>Connect with Joy:</strong><br> Joy Owusu Ansah — Level 400, Computer Science, University of Ghana</p><p><a href="https://www.linkedin.com/in/joy-owusu-ansah/">Linkedin</a></p><p><a href="http://owusujoyansah@gmail.com/">Email</a></p><p><em>Written by someone who tested his friend’s product, got genuinely impressed, and decided to tell everyone about it.</em></p><p><em>Support Ghanaian innovation. Support student entrepreneurs. Support good ideas.</em></p><p><em>And if you’re a business that tries this and it helps you? Let Joy know. Feedback is how good products become great products.</em> 🇬🇭</p><p><strong>P.S.: </strong>That analytics dashboard? I told Joy he should add more tracking features in the future. More data points. More insights. Turn this into a full customer intelligence platform.</p><p>He’s already thinking about it.</p><p>This is just the beginning. Watch this space.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f4d64f79a6e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I’m a CS Student and I Just Found Out What Bitcoin Actually Is]]></title>
            <link>https://medium.com/@stephenazongo77/im-a-cs-student-and-i-just-found-out-what-bitcoin-actually-is-9e5b524ccda2?source=rss-5d61533533fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e5b524ccda2</guid>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Stephen Azongo]]></dc:creator>
            <pubDate>Fri, 31 Oct 2025 23:06:22 GMT</pubDate>
            <atom:updated>2025-10-31T23:06:22.906Z</atom:updated>
            <content:encoded><![CDATA[<p><em>And honestly, I feel like a fraud</em></p><p>You know that feeling when everyone is talking about something, nodding like they understand, and you’re just there smiling and vibing, but deep down you’re lost? Yeah, that was me with Bitcoin.</p><p>I’m a computer science student. I’ve heard about Bitcoin since… I don’t even know when. Everyone talks about it. “Bitcoin this, crypto that, blockchain revolution.” My timeline is full of it. People are making money, losing money, arguing about it.</p><p>And me? I just knew it was “digital money” or something. Maybe like mobile money but… different? I don’t know. Nobody really explains it. They just throw around words like “decentralized” and “blockchain” and everyone nods like we all get it.</p><p><strong>But last week, I spent 2 hours going back and forth with ChatGPT, asking dumb questions, feeling stupid, and learning what Bitcoin ACTUALLY is.</strong></p><p>And herh. HERH.</p><p>This thing broke my brain.</p><h3>The First Shock: It’s Just… Code?</h3><p>So apparently, Bitcoin is code. Like, actual code. C++ code. Sitting on GitHub. <strong>Just THERE.</strong></p><p>Not locked in some bank vault. Not guarded by government secrets. Not hidden in some Swiss server that only billionaires can access.</p><p><a href="https://github.com/bitcoin/bitcoin"><strong>It’s literally here.</strong></a> Free. Open. For anyone to read.</p><p>When I found this, I just sat there staring at my screen like… “Wait. This thing that people are fighting about, that countries are banning, that’s worth over a trillion dollars… is just CODE on GITHUB?!”</p><p>The same GitHub where we submit our school assignments???</p><p>The same GitHub where that guy in my class copied his project from and forgot to change the name???</p><p><strong>THAT GitHub?!</strong></p><p>I felt like I’d been lied to my whole life. Or maybe nobody knew either. I don’t know which is worse.</p><h3>The Part Where I Felt Really Dumb</h3><p>Let me be honest with you. When I started asking questions, I didn’t even know what a “block” was.</p><p>Everyone says “blockchain.” Okay cool. Block… chain. Blocks in a chain. But what’s IN the blocks? Who makes the blocks? Why chains? How many chains? Who’s holding the chains??</p><p>I had to ask ChatGPT like I was five years old:</p><ul><li>“What’s a block?”</li><li>“Okay but WHO puts transactions in the block?”</li><li>“Wait, so ANYONE can be a miner?”</li><li>“But if anyone can be a miner, how do we know they won’t cheat?”</li><li>“What do you MEAN proof of work?!”</li></ul><p>Two hours. I went back and forth for TWO HOURS. And I’m a CS student oo. Imagine someone who doesn’t even code.</p><p>But you know what? By the end of those 2 hours, the things I learned… ah, too much. Let me try explain am for you.</p><h3>Bitcoin for People Who Don’t Know Anything about bitcoin(Like Me 1 Week Ago)</h3><h3>The Basic Idea</h3><p>You know mobile money, right? MTN MoMo, Vodafone Cash, all that. You have money in your “wallet” on your phone. When you want to send money to your friend, you dial the code, enter their number, enter the amount, boom. Done.</p><p>But who’s controlling that transaction? <strong>MTN.</strong> Or Vodafone. Or whatever telco.</p><p>They’re the ones who:</p><ul><li>Check if you have the money</li><li>Take it from your account</li><li>Add it to your friend’s account</li><li>Keep the records</li></ul><p>If MTN says “system is down,” you can’t send money. If they make a mistake, you need to call customer service and beg them. If they decide to block your account, that’s it. <strong>They’re in charge.</strong></p><p>Now imagine if we could do the SAME thing — send money from person to person — but WITHOUT MTN. Without ANY company. Without ANY bank. Without ANYONE in the middle.</p><p>“Ah but that’s not possible. Someone has to control it.”</p><p><strong>THAT’S THE WHOLE POINT. That’s Bitcoin.</strong></p><p>Nobody controls it. Not one person. Not one company. Not one country.</p><p>Let that sink in for a sec.</p><h3>The “Blockchain” Thing (Not As Scary As It Sounds)</h3><p>Okay so if there’s no MTN in the middle, how do we keep track of who sent what to who?</p><p><strong>Simple: Everyone keeps track. Together.</strong></p><p>Imagine this: You and your guys start a susu group. Every week, everyone contributes ₵50. But instead of giving the money to one person to hold, you ALL write it down in your own notebooks:</p><ul><li>Week 1: Skimmer paid ₵50, Ama paid ₵50, Kofi paid ₵50</li><li>Week 2: Skimmer paid ₵50, Ama paid ₵50, Kofi paid ₵50</li><li>And so on…</li></ul><p>Everyone has the SAME list. So if Skimmer suddenly says “ah I paid ₵100 last week oo,” everyone can check their notebooks and say “chale, you paid ₵50. We all have it written here. fraud guy”</p><p><strong>That’s basically blockchain.</strong></p><p>Instead of notebooks, it’s computers. Instead of your susu group, it’s thousands of computers around the world. Instead of ₵50 contributions, it’s Bitcoin transactions.</p><p>Every computer has a copy of ALL the transactions that have EVER happened. Every single one. From 2009 till now.</p><p>So if someone tries to cheat; let’s say they try to spend the same Bitcoin twice, all the other computers will look at their records and say “chale, that Bitcoin was already spent. We all saw it. Fraud alert.”</p><p>No CEO. No customer service. Just thousands of computers agreeing on the truth.</p><h3>The “Mining” Thing (This One Shocked Me)</h3><p>Now here’s where it gets wild.</p><p>Remember in the susu example, we’re writing transactions in notebooks. But WHO actually writes it down? Who decides which transactions are valid?</p><p>In Bitcoin, these people are called <strong>miners.</strong> Not some Galamsey type shit, lol, they’re not actually digging anything. They’re just… running computers.</p><p>Here’s how it works:</p><p>When you send Bitcoin to someone, that transaction gets broadcast to the network. It’s like shouting it in a group chat with 50,000 people: “Yo, I’m sending 0.5 BTC to Ama!”</p><p>But it doesn’t immediately go into the “notebook” (the blockchain). First, it sits in a waiting room called the <strong>mempool.</strong> Think of it like transactions chilling, waiting for their turn.</p><p>Now, miners are competing to be the ones who get to write the next “page” in the notebook (in Bitcoin, we call it a <strong>block</strong>).</p><p>But here’s the crazy part: <strong>To win the right to write the next block, you have to solve a really hard math puzzle.</strong></p><p>And I mean REALLY hard. Like, your computer has to try TRILLIONS of random guesses until it finds the right answer.</p><p>The first miner to solve it gets to:</p><ol><li>Write the block (bundle of transactions)</li><li>Add it to the blockchain</li><li>Collect a REWARD in Bitcoin</li></ol><p>That’s right. You solve the puzzle, you get free Bitcoin. That’s how new Bitcoin is created. That’s why they call it “mining” — you’re mining for digital gold.</p><p><strong>But here’s the part that made me go “wait, WHAT?!”</strong></p><p>Anyone can be a miner. <strong>ANYONE.</strong></p><p>You. Me. Your laptop. My 4GB RAM laptop that barely runs Chrome.</p><p>Obviously, my laptop won’t win against the big mining farms with thousands of specialized computers. But technically? I CAN run the Bitcoin software, participate in the network, validate transactions, and even try to mine.</p><p>No permission needed. No license. No application form.</p><p>Just download the software and run it. Boom. You’re part of a trillion-dollar global network.</p><h3>The Parts That Broke My Brain</h3><h3>Part 1: Only 21 Million Bitcoin Will EVER Exist</h3><p>You know how our cedi keeps losing value? How things that cost ₵10 last year now cost ₵20? That’s because the Bank of Ghana can print more cedis whenever they want.</p><p>Dollar too. The US Federal Reserve printed TRILLIONS of dollars during COVID. Just… printed it.</p><p>Bitcoin? <strong>There will only EVER be 21 million of them.</strong></p><p>It’s not a promise. It’s not a policy that can change. <strong>It’s written in the code.</strong> Hardcoded. Permanent.</p><p>Right now, about 19.5 million have been mined. The remaining ~1.5 million will be mined gradually until the year 2140.</p><p>After that? <strong>No more Bitcoin. Ever.</strong> Zero. Finished. The party is over.</p><p>You can’t print more. You can’t “quantitative ease” your way out. You can’t have an “emergency monetary policy meeting” and decide to create more.</p><p>The number is fixed. Forever.</p><p>Think about that.</p><h3>Part 2: Every 4 Years, The Reward Cuts in Half</h3><p>Remember I said miners get rewarded with Bitcoin for solving the puzzle? Well, that reward isn’t fixed.</p><p>When Bitcoin started in 2009, the reward was <strong>50 BTC per block.</strong></p><p>Then in 2012: <strong>25 BTC</strong><br> Then in 2016: <strong>12.5 BTC</strong><br> Then in 2020: <strong>6.25 BTC</strong><br> And in 2024: <strong>3.125 BTC</strong></p><p>Every 4 years (technically every 210,000 blocks), the reward cuts in half. This is called <strong>“the halving.”</strong></p><p>This will continue until around 2140, when the reward becomes essentially zero.</p><p>And you know the wildest part? <strong>This isn’t decided by some committee. It’s automatic. It’s in the code.</strong></p><p>A few lines of code control the entire supply schedule of a trillion-dollar asset. No votes. No debates. No “let’s adjust this based on economic conditions.”</p><p>Just math. Cold, automatic, unchangeable math.</p><h3>Part 3: A New Block Every ~10 Minutes. For 16 Years Straight.</h3><p>Bitcoin creates a new block approximately every 10 minutes.</p><p>Not 8 minutes. Not 15 minutes. Always around 10 minutes.</p><p>For <strong>16 YEARS.</strong></p><p>No downtime. No “system maintenance.” No “our servers are experiencing issues.”</p><p>How?</p><p>Because Bitcoin automatically adjusts the difficulty of the puzzle based on how many miners are working on it.</p><p>Too many miners? Puzzle gets harder. Takes longer to solve. Blocks slow down to ~10 minutes.</p><p>Too few miners? Puzzle gets easier. Solves faster. Blocks speed up to ~10 minutes.</p><p>It’s self-regulating. No one controls it. The code just… adapts.</p><p>That’s why Bitcoin has maintained this 10-minute rhythm despite:</p><ul><li>Going from a few computers to millions of specialized machines</li><li>Hash rate (computing power) increasing by BILLIONS of times</li><li>Countries banning it, embracing it, banning it again</li><li>Price going from $0 to $69,000 and crashing and rising again</li></ul><p>The code doesn’t care. The math adjusts. The heartbeat continues.</p><h3>Part 4: Your Laptop Can Run This Whole Thing</h3><p>This is the one that really got me.</p><p>I can download Bitcoin Core (the main software), install it on my laptop, and:</p><ul><li>Download the ENTIRE Bitcoin blockchain (every transaction since 2009)</li><li>Verify EVERY SINGLE transaction myself</li><li>Validate that all the rules are being followed</li><li>Participate in the network as an equal node</li></ul><p>My laptop. My 4GB RAM laptop that struggles with Google Docs.</p><p>Can run a node in a trillion-dollar global financial network.</p><p>No permission. No account. No application. No “are you qualified for this?”</p><p>Just download and run.</p><p>And once it’s running? My laptop has the SAME power as any other node. Whether you’re a billionaire with a server farm or a broke student with a laptop, <strong>one node = one vote</strong> in the network consensus.</p><p>That’s… that’s not supposed to be possible. But it is.</p><h3>Why Should Ghanaians Care?</h3><p>Look, I know what you’re thinking. “This is interesting and all, but what does this have to do with me?”</p><p>Fair question. Let me break it down:</p><h3>1. The Cedi Is Falling, and We All Know It</h3><p>I don’t need to explain this one. We all see it. The cedi keeps dropping. Things keep getting expensive. Our savings keep losing value.</p><p>Why? Because the system is designed that way. More money gets printed. Currency gets devalued. We, the regular people, are the ones who suffer.</p><p>Bitcoin can’t be printed. The supply is fixed. No president, no bank, no IMF can change that.</p><h3>2. Sending Money Abroad Is Expensive and Slow</h3><p>You have a relative abroad who wants to send you money? Western Union, MoneyGram, all these services take HUGE cuts. And it takes time.</p><p>Bitcoin? Send it directly. Person to person. No middleman. No “transfer fees.” No “exchange rate markup.” No “3–5 business days.”</p><p>Just wallet to wallet. Usually confirms in 10–30 minutes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EW2TE8xIbMEIqUmS.png" /><figcaption>how transactions are made</figcaption></figure><h3>3. No One Can Block Your Account</h3><p>Bank can freeze your account. Mobile money can lock you out. Government can seize your assets.</p><p>Bitcoin? If you control your private keys (basically your password), <strong>no one can take your Bitcoin from you.</strong> Not the bank. Not the government. Not anyone.</p><p>Your money. Your control.</p><h3>4. It’s Permissionless</h3><p>You don’t need:</p><ul><li>A bank account</li><li>A credit score</li><li>Government ID</li><li>Permission from anyone</li></ul><p>You just… use it.</p><p>For a continent where millions don’t have access to traditional banking, this is revolutionary.</p><h3>The Questions I Had (You Probably Have Them Too)</h3><p><strong>Q: Is this another scam? Like MMM or whatever?</strong></p><p>Look, I get it. We’ve been burned before. But here’s the difference: Bitcoin is open source. The code is PUBLIC. You can literally go read it yourself. There’s no “founder” promising 50% returns. No one running the show. It’s just… code and math.</p><p>Can the PRICE crash? Yes. Is it volatile? Very. But the system itself? It’s been running for 16 years without anyone being able to hack it or shut it down.</p><p><strong>Q: But I heard it’s for criminals and drugs and stuff</strong></p><p>Herh, people use cedis for crime too oo. And dollars. And every currency.</p><p>Actually, Bitcoin is WORSE for criminals because every single transaction is public and traceable. Forever. If you use Bitcoin for crime and someone finds out your wallet address, they can trace EVERYTHING you’ve ever done with it.</p><p>Cash is actually way better for crime. That’s why criminals still use cash.</p><p><strong>Q: How do I even start?</strong></p><p>Honest answer? Start by learning. You don’t need to buy Bitcoin today. Just understand what it is.</p><p>Read the Bitcoin whitepaper (it’s only 9 pages, written by the mysterious Satoshi Nakamoto(some anime name type shii right?) — no one knows who they are).</p><p>Watch some videos. Ask questions. Play around with a wallet (you can get a wallet without buying any Bitcoin, just to see how it works).</p><p><strong>Q: Is this another “get rich quick” thing?</strong></p><p>No. Well, maybe. I don’t know.</p><p>What I DO know is that understanding Bitcoin is valuable whether you ever buy any or not. Because this is a new way of thinking about money, trust, and power.</p><p>Whether Bitcoin specifically succeeds or fails, the IDEAS behind it are changing how we think about finance.</p><h3>For My Tech People: Let Me Show You Something</h3><p>(Okay, if you’re not technical, you can skip this part. But if you’re curious…)</p><p>Remember when I said the halving is “hardcoded”? Let me show you the ACTUAL code.</p><p>This is from Bitcoin Core’s <a href="https://github.com/bitcoin/bitcoin/blob/master/src/validation.cpp">validation.cpp</a> file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*peV5GCMYIK-SgBoKeirBdw.png" /><figcaption>original github shot</figcaption></figure><pre>CAmount GetBlockSubsidy(int nHeight, const Consensus::Params&amp; consensusParams)<br>{<br>    int halvings = nHeight / consensusParams.nSubsidyHalvingInterval;<br>    <br>    if (halvings &gt;= 64) <br>        return 0;<br>    <br>    CAmount nSubsidy = 50 * COIN;<br>    nSubsidy &gt;&gt;= halvings;<br>    <br>    return nSubsidy;<br>}</pre><p><strong>See that?</strong> That’s it. That’s the code that controls Bitcoin’s entire monetary policy.</p><p>nSubsidyHalvingInterval = 210000 (defined elsewhere)</p><p>Every 210,000 blocks, the subsidy (reward) halves. The &gt;&gt;= operator is a bitwise right shift - it divides by 2.</p><p>After 64 halvings? Return 0. Game over.</p><p><strong>This is what I mean by “hardcoded.”</strong> No committee. No votes. Just this code running on thousands of computers.</p><p>The 10-minute block time? Also in the <a href="https://github.com/bitcoin/bitcoin/blob/master/src/kernel/chainparams.cpp">code</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GMz84qRPcFofdwmRUZo1kQ.png" /><figcaption>original github shot</figcaption></figure><pre>consensus.nPowTargetSpacing = 10 * 60;  // 10 minutes in seconds</pre><p>The 21 million limit? Also in the code:</p><pre>static constexpr CAmount MAX_MONEY = 21000000 * COIN;</pre><p>You can go verify this yourself: <a href="https://github.com/bitcoin/bitcoin">https://github.com/bitcoin/bitcoin</a></p><p>That’s the beauty of open source. <strong>Don’t trust, verify.</strong></p><h3>The Conclusion I’ve Come To</h3><p>I spent 2 hours learning about Bitcoin. Then I spent another few hours exploring the code, reading articles, watching videos.</p><p>And here’s what I think:</p><p><strong>Whether you believe in Bitcoin or not, you should at least understand what it is.</strong></p><p>Because it represents something bigger than just “digital money.”</p><p>It represents the idea that maybe — just maybe — we don’t need middlemen for everything.</p><p>Maybe we can have money that no one controls.</p><p>Maybe we can have systems that run on math instead of trust.</p><p>Maybe we can have financial networks where a broke student in Ghana has the same power as a billionaire in America.</p><p>Is Bitcoin perfect? No.<br> Will it succeed? I don’t know.<br> Should you buy some? That’s up to you.</p><p>But should you understand it? <strong>Absolutely.</strong></p><p>Because even if Bitcoin fails, the ideas it introduced aren’t going anywhere.</p><p>And as someone who spent years studying computer science without knowing what Bitcoin actually WAS…</p><p>I’m done being in the dark.</p><p><strong>Resources if you want to learn more:</strong></p><ul><li>Bitcoin whitepaper: <a href="https://bitcoin.org/bitcoin.pdf">https://bitcoin.org/bitcoin.pdf</a> (9 pages, seriously worth it)</li><li>Bitcoin Core GitHub: <a href="https://github.com/bitcoin/bitcoin">https://github.com/bitcoin/bitcoin</a></li><li>Run a node: <a href="https://bitcoin.org/en/full-node">https://bitcoin.org/en/full-node</a></li></ul><p>Don’t trust me. Don’t trust anyone. <strong>Verify it yourself.</strong></p><p>That’s the whole point.</p><p><a href="https://www.linkedin.com/in/stephen-azongo-671823257/">Stephen Azongo</a>,</p><p>University of Ghana, Computer Science</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e5b524ccda2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>