<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Isaac Odeh</title>
    <description>The latest articles on DEV Community by Isaac Odeh (@kaasikodes).</description>
    <link>https://dev.to/kaasikodes</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F769058%2Fa0e26c53-b10f-4219-ba3d-3feaad3de503.jpg</url>
      <title>DEV Community: Isaac Odeh</title>
      <link>https://dev.to/kaasikodes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kaasikodes"/>
    <language>en</language>
    <item>
      <title>Designing the Architecture for an E-commerce Microservice Project</title>
      <dc:creator>Isaac Odeh</dc:creator>
      <pubDate>Mon, 12 May 2025 17:28:19 +0000</pubDate>
      <link>https://dev.to/kaasikodes/designing-the-architecture-for-an-e-commerce-microservice-project-11ef</link>
      <guid>https://dev.to/kaasikodes/designing-the-architecture-for-an-e-commerce-microservice-project-11ef</guid>
      <description>&lt;p&gt;Architecture is the backbone of any successful project — but let’s be honest, it’s often the most ignored part too. Sometimes it’s because the engineering team is new to this, sometimes it’s lack of clarity from the product side, and other times it’s just us developers getting excited and diving in without a clear plan (we’ve all done it).&lt;/p&gt;

&lt;p&gt;And while these reasons are valid, they don’t excuse skipping a proper architecture document — or at least a basic diagram — before building anything.&lt;/p&gt;




&lt;h2&gt;
  
  
  Let’s paint a picture:
&lt;/h2&gt;

&lt;p&gt;Company A gets a new client and agrees to deliver a shiny new system in three months — &lt;strong&gt;without any technical consultation&lt;/strong&gt; to check if that’s even doable. So, they call on the office superstar dev (you know the one) to either take it on solo (yikes!) or lead a small team.&lt;/p&gt;

&lt;p&gt;The dev jumps in, follows the prototype or functional document, assigns tickets, reviews code, and the rest of the team breathes easy because “they’ve got this.” Everyone just sticks to their task, checks if the PR looks okay, merges it, and calls it a day. All smooth on the surface.&lt;/p&gt;

&lt;p&gt;But here’s the problem: &lt;strong&gt;every project has an architecture&lt;/strong&gt;, whether you write it down or not. The issue? In this case, the architecture lives inside the head of that one engineer. No shared doc, no diagram, just vibes.&lt;/p&gt;

&lt;p&gt;So what happens when that superstar moves on? Maybe their contract ends, maybe they switch jobs. For a while, things still run fine. Then it starts getting harder to make changes. Product wants updates, and now the devs are stuck untangling code they didn’t design. Leadership starts asking questions. Another “super” dev joins, brings their own style, and the codebase becomes a patchwork of different ideas. Devs come and go, and maintaining the project becomes a nightmare.&lt;/p&gt;

&lt;p&gt;All this could’ve been avoided with just one shared document at the start.&lt;/p&gt;




&lt;p&gt;A project’s culture is set in the beginning. If the person kicking it off is in too much of a hurry to document the structure, that pressure usually trickles down.&lt;/p&gt;

&lt;p&gt;But as engineers, we should get into the habit of documenting our architecture, even if it’s not perfect from day one. &lt;strong&gt;Trust me, future-you (or the next dev) will thank you.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  So, about our e-commerce project...
&lt;/h2&gt;

&lt;p&gt;We’re going to build it using &lt;strong&gt;microservices&lt;/strong&gt; — mainly for the sake of learning.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In most cases, I’d recommend starting with a monolith and then splitting it up later once things get more complex. Microservices can get messy fast and there is usually a lot of technical debt to be paid in the long run.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We’ll pretend our product team gave us a functional spec and a Figma prototype. With that, here’s how we’ll break things down before designing our architecture:&lt;/p&gt;




&lt;h2&gt;
  
  
  Questions to answer before designing:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;What services do we need, and what should each do?&lt;/li&gt;
&lt;li&gt;What pieces of code will be shared?&lt;/li&gt;
&lt;li&gt;How will services find each other?&lt;/li&gt;
&lt;li&gt;How will services talk to each other?&lt;/li&gt;
&lt;li&gt;What does our infrastructure look like?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once we’ve thought this through, we’ll draw up an architecture diagram and write a supporting doc in our next article.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧱 Services and What They Do
&lt;/h2&gt;

&lt;p&gt;We’re going all-in on &lt;strong&gt;Go&lt;/strong&gt; for this one — every service will be written in Golang. Here's a rough list:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Auth Service&lt;/strong&gt;: Handles user creation, login, and role management (admin, vendor, customer).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Notification Service&lt;/strong&gt;: Sends in-app, email, or SMS messages.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Order Service&lt;/strong&gt;: Allows customers to place product orders from vendors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Product Service&lt;/strong&gt;: Stores product details like name, color, description, etc.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Payment Service&lt;/strong&gt;: Handles order payments, subscriptions, and transactions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Review &amp;amp; Rating Service&lt;/strong&gt;: Enables users to rate and review products and vendors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Search &amp;amp; Recommendation Service&lt;/strong&gt;: Search and recommend products intelligently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Subscription &amp;amp; Traffic Service&lt;/strong&gt;: Manages plans and vendor traffic quotas.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vendor Service&lt;/strong&gt;: Lets vendors manage stores, inventory, orders, and deliveries.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each of these services will have &lt;strong&gt;its own database&lt;/strong&gt; — keeping things loosely coupled and scalable.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔁 Shared Code
&lt;/h2&gt;

&lt;p&gt;Some things show up across multiple services — we’ll put these in a shared library:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API Signatures/Types&lt;/li&gt;
&lt;li&gt;Message Broker Code&lt;/li&gt;
&lt;li&gt;Database Connections&lt;/li&gt;
&lt;li&gt;Env Configs&lt;/li&gt;
&lt;li&gt;Events&lt;/li&gt;
&lt;li&gt;Logging&lt;/li&gt;
&lt;li&gt;Tracing (OpenTelemetry)&lt;/li&gt;
&lt;li&gt;Protobuf Definitions&lt;/li&gt;
&lt;li&gt;Utilities (pagination, request parsing, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ Heads-up: Too much shared code = tight coupling. We'll keep it modular.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🧭 How Services Find Each Other (Service Discovery)
&lt;/h2&gt;

&lt;p&gt;To start, we’ll hardcode service routes into the API Gateway — works fine during early dev.&lt;/p&gt;

&lt;p&gt;Later, when we move to a multi-node Kubernetes setup, we’ll explore tools like &lt;strong&gt;Istio&lt;/strong&gt; for smarter service discovery.&lt;/p&gt;




&lt;h2&gt;
  
  
  📡 How Services Communicate
&lt;/h2&gt;

&lt;p&gt;Two main ways:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Synchronous (Blocking)&lt;/strong&gt; — Using &lt;strong&gt;gRPC&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Use this when we need an instant response — e.g. during user registration:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Auth Service&lt;/li&gt;
&lt;li&gt;Vendor Profile Service&lt;/li&gt;
&lt;li&gt;Subscription Service&lt;/li&gt;
&lt;li&gt;Payment Service&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. &lt;strong&gt;Asynchronous (Non-blocking)&lt;/strong&gt; — Using &lt;strong&gt;Message Brokers&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;For example: A "payment successful" webhook triggers an event. Services like Subscription can pick it up and react independently.&lt;/p&gt;

&lt;p&gt;This helps decouple services and improve system resilience.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚙️ Infrastructure Setup
&lt;/h2&gt;

&lt;p&gt;To start:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;All services run on the same server&lt;/li&gt;
&lt;li&gt;Each service exposed via different ports&lt;/li&gt;
&lt;li&gt;API Gateway in front&lt;/li&gt;
&lt;li&gt;Dockerize all services and third-party tools like prometheus, postgres, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Later on we'll:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Move to &lt;strong&gt;Kubernetes (multi-node)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Try &lt;strong&gt;AWS deployment&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Explore &lt;strong&gt;GitOps&lt;/strong&gt; tools like &lt;strong&gt;ArgoCD&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📊 Monitoring and Observability
&lt;/h2&gt;

&lt;p&gt;Microservices = more moving parts. So we’ll need strong observability:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Logging&lt;/strong&gt;: Consistent, searchable logs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tracing&lt;/strong&gt;: End-to-end request tracking with OpenTelemetry&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Metrics&lt;/strong&gt;: Expose metrics with Prometheus; visualize with Grafana&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧩 Wrapping Up
&lt;/h2&gt;

&lt;p&gt;This was just an intro to how we’ll approach architecture for our e-commerce project.&lt;/p&gt;

&lt;p&gt;We’ll dive deeper into each section later and share code, diagrams, and repos along the way.&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ What’s Next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Sketch the architecture diagram&lt;/li&gt;
&lt;li&gt;Define all service APIs&lt;/li&gt;
&lt;li&gt;Set up the dev environment + repos&lt;/li&gt;
&lt;li&gt;Start building — &lt;strong&gt;first stop: Auth Service&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>go</category>
      <category>microservices</category>
      <category>kubernetes</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Byzantine Generals’ Problem</title>
      <dc:creator>Isaac Odeh</dc:creator>
      <pubDate>Sat, 02 Sep 2023 00:16:38 +0000</pubDate>
      <link>https://dev.to/kaasikodes/byzantine-generals-problem-242k</link>
      <guid>https://dev.to/kaasikodes/byzantine-generals-problem-242k</guid>
      <description>&lt;p&gt;Ever since I decided to get into the wonderful world of web3 and decentralization I’ve decided to make a conscious effort to share what I learn. I recently learnt about the byzantine problem and how the blockchain resolves the issue.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding the Byzantine General’s Predicament
&lt;/h2&gt;

&lt;p&gt;Picture a medieval kingdom, besieged by a coalition of four generals set on conquering it. In an era devoid of smartphones and walkie-talkies, generals are reliant on messengers to synchronize their assaults. But wait — there is a problem. These messages can be intercepted or fabricated, throwing a wrench into their strategic plans. The challenge emerges: How can generals reach a unanimous decision when trust is scarce?&lt;/p&gt;

&lt;h2&gt;
  
  
  Blockchain and its Solution to the Problem
&lt;/h2&gt;

&lt;p&gt;In today’s era, the blockchain emerges as the remedy for the Byzantine Generals’ headache. The blockchain being a decentralized and trustless network in which computers (nodes) come together to process and validate transactions. Nodes that wield computational power to keep the blockchain operating in a decentralized manner, are referred to as miners. These nodes can join and leave the network freely, as the blockchain is permissionless system, and anyone (computer) can be a miner.&lt;/p&gt;

&lt;p&gt;The problem still remains how is Consensus reached in a decentralized network, with nodes striving to agree on transaction validity, even with some playing dirty or sprinting ahead in the processing race.&lt;/p&gt;

&lt;p&gt;In order to crack the consensus conundrum, let’s explore how blockchain transactions journey from initiation to validation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Transaction Ignition and Verification:&lt;/strong&gt; A user kickstarts the transaction by signing it with a private key, giving it a digital signature. This verified transaction is broadcasted to the blockchain, where it’s assessed and parked in the mempool — a pit stop for pending transactions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Transaction Selection and Mining:&lt;/strong&gt; Miners spring into action, cherry-picking transactions from the mempool. Transactions with generous fees often snag the spotlight. These chosen transactions are bundled into blocks, setting the stage for the the block to be mined.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Proof of Work (PoW):&lt;/strong&gt; Miners roll up their sleeves for PoW, a computational treasure hunt involving a cryptographic puzzle. The puzzle is designed in such a way that it extremely difficult to solve but really easy to verify its solution. With computers racing against time, the goal is to unearth a nonce, this is a value that is continuously tweaked in order for the puzzle to be solved, that fits a particular criteria — such as the cryptographic hash of the previous block has to be prefixed by a certain number of zero’s. This intensive process flexes blockchain’s security muscles.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validation and Embrace of the Mightiest Chain:&lt;/strong&gt; Once a miner cracks the puzzle, they present their discovery to the network. Other miners do a quick check, and if it’s a bingo, they rally around this new block. The “heaviest” chain, the one with the most computational sweat, takes the throne. It's important to note that the nodes don’t blindly accept that a miner has solve a problem, but they first verify the solution before proceeding.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Partition Puzzles and Converging Paths:&lt;/strong&gt; In the rare event of network partitioning, where chains of equal length emerge, the network taps into its toolkit for convergence. Economics plays its magic, encouraging miners to rally around the most rewarding block. Time-based rules or favoring the earliest mined chain can also steer the ship back to harmony.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And that’s it ! Stay tuned as I voyage deeper into the realms of web3 technology, sharing insights and discoveries along the way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=f1ZJPEKeTEY"&gt;Blockchain Consensus Short Lecture&lt;/a&gt;&lt;br&gt;
&lt;a href="https://mempool.space/block/000000000000000000018919b43910f2f472eef7a651b7588fe81884e1073c12"&gt;Realtime Illustration of the Bitcoin Mining Process&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.youtube.com/watch?v=DW4_zDSufhQ"&gt;Blockchain Basics&lt;/a&gt;&lt;/p&gt;

</description>
      <category>solidity</category>
      <category>web3</category>
      <category>ethereum</category>
      <category>blockchain</category>
    </item>
  </channel>
</rss>
