<?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>Forem: Gilbert Chris</title>
    <description>The latest articles on Forem by Gilbert Chris (@gilbert_chris_81108416cc1).</description>
    <link>https://forem.com/gilbert_chris_81108416cc1</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%2F1871798%2F8a48213b-bfa1-47f5-b30d-a9a32b47b7f7.jpg</url>
      <title>Forem: Gilbert Chris</title>
      <link>https://forem.com/gilbert_chris_81108416cc1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/gilbert_chris_81108416cc1"/>
    <language>en</language>
    <item>
      <title>[Boost]</title>
      <dc:creator>Gilbert Chris</dc:creator>
      <pubDate>Mon, 22 Dec 2025 09:04:38 +0000</pubDate>
      <link>https://forem.com/gilbert_chris_81108416cc1/-2abp</link>
      <guid>https://forem.com/gilbert_chris_81108416cc1/-2abp</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/gilbert_chris_81108416cc1" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1871798%2F8a48213b-bfa1-47f5-b30d-a9a32b47b7f7.jpg" alt="gilbert_chris_81108416cc1"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/gilbert_chris_81108416cc1/serverless-africa-building-smarter-apps-with-google-cloud-functions-a-practical-demo-from-devfest-5a7a" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Serverless Africa: Building Smarter Apps with Google Cloud Functions A practical demo from DevFest Mt Kenya&lt;/h2&gt;
      &lt;h3&gt;Gilbert Chris ・ Dec 22&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#devfest&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#gcp&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#pubsub&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#serverless&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>devfest</category>
      <category>gcp</category>
      <category>pubsub</category>
      <category>serverless</category>
    </item>
    <item>
      <title>Serverless Africa: Building Smarter Apps with Google Cloud Functions A practical demo from DevFest Mt Kenya</title>
      <dc:creator>Gilbert Chris</dc:creator>
      <pubDate>Mon, 22 Dec 2025 09:04:15 +0000</pubDate>
      <link>https://forem.com/gilbert_chris_81108416cc1/serverless-africa-building-smarter-apps-with-google-cloud-functions-a-practical-demo-from-devfest-5a7a</link>
      <guid>https://forem.com/gilbert_chris_81108416cc1/serverless-africa-building-smarter-apps-with-google-cloud-functions-a-practical-demo-from-devfest-5a7a</guid>
      <description>&lt;p&gt;“What if you could ship scalable applications without constantly worrying about servers, infrastructure, and backend chaos?”&lt;/p&gt;

&lt;p&gt;That was the guiding question behind my talk at DevFest Mt Kenya 2025, where I explored how serverless architecture on Google Cloud Platform (GCP) can simplify backend development while enabling powerful, real-world solutions.&lt;/p&gt;

&lt;p&gt;To avoid abstract theory, I built and demonstrated a small but complete project called Anime-san—a serverless application that ties together frontend, Cloud Run, Pub/Sub, Cloud Functions, and an M-Pesa STK Push flow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Serverless Matters (Especially in Africa)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In many African developer ecosystems, teams are small, resources are limited, and products need to scale quickly once they gain traction. Traditional backend setups often introduce challenges like:&lt;/p&gt;

&lt;p&gt;Server provisioning and maintenance&lt;/p&gt;

&lt;p&gt;Downtime handling&lt;/p&gt;

&lt;p&gt;Scaling during traffic spikes&lt;/p&gt;

&lt;p&gt;Complex deployments&lt;/p&gt;

&lt;p&gt;Serverless platforms like Google Cloud Functions and Cloud Run shift this burden to the cloud provider. Developers can focus on business logic, not infrastructure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Demo Project: Anime-san&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Anime-san is a lightweight demo app with a simple idea:&lt;/p&gt;

&lt;p&gt;Display random anime quotes&lt;/p&gt;

&lt;p&gt;Allow users to “tip” the developer via an STK Push (demo flow)&lt;/p&gt;

&lt;p&gt;Process requests asynchronously using cloud-native services&lt;/p&gt;

&lt;p&gt;Despite its simplicity, it demonstrates a real production-style architecture.&lt;/p&gt;

&lt;p&gt;High-Level Architecture&lt;/p&gt;

&lt;p&gt;The project is split into three main parts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Frontend (React)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Fetches random quotes from a public Anime API&lt;/p&gt;

&lt;p&gt;Displays quotes in a clean UI&lt;/p&gt;

&lt;p&gt;Sends tip requests to the backend&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Backend API (Cloud Run)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Built with Node.js and Express&lt;/p&gt;

&lt;p&gt;Exposes a /tip endpoint&lt;/p&gt;

&lt;p&gt;Publishes tip requests to a Pub/Sub topic&lt;/p&gt;

&lt;p&gt;Runs fully serverless on Cloud Run&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Cloud Function Subscriber&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Listens to the Pub/Sub topic&lt;/p&gt;

&lt;p&gt;Processes incoming tip events&lt;/p&gt;

&lt;p&gt;Triggers an STK Push flow (demo/sandbox)&lt;/p&gt;

&lt;p&gt;This decoupled approach ensures the system is scalable, resilient, and event-driven.&lt;/p&gt;

&lt;p&gt;Why Pub/Sub?&lt;/p&gt;

&lt;p&gt;Instead of handling everything synchronously, the backend publishes messages to Google Cloud Pub/Sub.&lt;/p&gt;

&lt;p&gt;Benefits:&lt;/p&gt;

&lt;p&gt;Loose coupling between services&lt;/p&gt;

&lt;p&gt;Better error handling and retries&lt;/p&gt;

&lt;p&gt;Easier scaling&lt;/p&gt;

&lt;p&gt;Cleaner separation of concerns&lt;/p&gt;

&lt;p&gt;This pattern is especially useful for payment flows, notifications, and background processing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;M-Pesa Integration (Demo Context)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While the demo uses sandbox credentials, it reflects real-world patterns used in production M-Pesa integrations:&lt;/p&gt;

&lt;p&gt;Backend validates and publishes payment intent&lt;/p&gt;

&lt;p&gt;Subscriber handles payment logic asynchronously&lt;/p&gt;

&lt;p&gt;Frontend gets immediate feedback without blocking&lt;/p&gt;

&lt;p&gt;This architecture works well for:&lt;/p&gt;

&lt;p&gt;Fintech applications&lt;/p&gt;

&lt;p&gt;E-commerce platforms&lt;/p&gt;

&lt;p&gt;Donation and tipping systems&lt;/p&gt;

&lt;p&gt;Utility and service-payment apps&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lessons from the Demo&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Serverless reduces cognitive load&lt;br&gt;
Less time spent managing servers means more time building features.&lt;/p&gt;

&lt;p&gt;Event-driven systems scale naturally&lt;br&gt;
Pub/Sub and Cloud Functions make it easy to handle growth.&lt;/p&gt;

&lt;p&gt;Local problems deserve global tools&lt;br&gt;
Combining M-Pesa with modern cloud tools unlocks powerful local solutions.&lt;/p&gt;

&lt;p&gt;Demos matter&lt;br&gt;
Seeing a system work end-to-end is far more effective than slides alone.&lt;/p&gt;

&lt;p&gt;Why This Matters for GDG Communities&lt;/p&gt;

&lt;p&gt;The goal of this demo wasn’t just to show GCP features—it was to inspire developers to:&lt;/p&gt;

&lt;p&gt;Build confidently with cloud-native tools&lt;/p&gt;

&lt;p&gt;Think in events, not monoliths&lt;/p&gt;

&lt;p&gt;Design systems that scale from day one&lt;/p&gt;

&lt;p&gt;Apply global technology to local challenges&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Serverless is not magic—but when used correctly, it’s a force multiplier.&lt;/p&gt;

&lt;p&gt;Anime-san may be a small demo, but it represents a bigger idea:&lt;br&gt;
African developers can build scalable, production-ready systems using modern cloud platforms—today.&lt;/p&gt;

&lt;p&gt;Huge thanks to GDG Mt Kenya and everyone who attended the session.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here is the repo:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://github.com/GilbertKamau/Anime-san-Cloud-Functions" rel="noopener noreferrer"&gt;https://github.com/GilbertKamau/Anime-san-Cloud-Functions&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devfest</category>
      <category>gcp</category>
      <category>pubsub</category>
      <category>serverless</category>
    </item>
    <item>
      <title>Building a Scalable Backend with DynamoDB Streams — My Journey Before the AWS User Group Pwani Talk</title>
      <dc:creator>Gilbert Chris</dc:creator>
      <pubDate>Sat, 06 Dec 2025 23:10:32 +0000</pubDate>
      <link>https://forem.com/gilbert_chris_81108416cc1/building-a-scalable-backend-with-dynamodb-streams-my-journey-before-the-aws-user-group-pwani-talk-5bnl</link>
      <guid>https://forem.com/gilbert_chris_81108416cc1/building-a-scalable-backend-with-dynamodb-streams-my-journey-before-the-aws-user-group-pwani-talk-5bnl</guid>
      <description>&lt;p&gt;When I agreed to give an online presentation to the AWS User Group Pwani, I knew I didn’t want to show slides full of theory. I wanted something real. Something I could build, demo, and explain — a project that actually does something.&lt;/p&gt;

&lt;p&gt;So I decided to create a small but scalable backend system using:&lt;/p&gt;

&lt;p&gt;API Gateway&lt;/p&gt;

&lt;p&gt;AWS Lambda&lt;/p&gt;

&lt;p&gt;DynamoDB&lt;/p&gt;

&lt;p&gt;DynamoDB Streams&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuwm5gjyz0svj77ddht6p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuwm5gjyz0svj77ddht6p.png" alt="Image describing a scalable backend architecture" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Everything worked perfectly during the live session (thank God 😅),&lt;br&gt;
but the journey of building it before the talk…&lt;br&gt;
that’s where the real learning happened.&lt;/p&gt;

&lt;p&gt;This blog is about that journey — what I built, what surprised me, and the gems I picked up along the way.&lt;/p&gt;

&lt;p&gt;Let’s dive in.&lt;/p&gt;

&lt;p&gt;🌱 Why This Project?&lt;/p&gt;

&lt;p&gt;Before the presentation, I wanted to answer one question:&lt;/p&gt;

&lt;p&gt;“How can you build a backend that can scale to millions of users without managing servers?”&lt;/p&gt;

&lt;p&gt;AWS has many ways to answer that question, but DynamoDB Streams stood out because:&lt;/p&gt;

&lt;p&gt;they’re simple but powerful&lt;/p&gt;

&lt;p&gt;they’re event-driven&lt;/p&gt;

&lt;p&gt;they allow your backend to react to data in real-time&lt;/p&gt;

&lt;p&gt;If you’ve ever wanted to track changes in your database — who registered, who updated their profile, who deleted their account — Streams are the perfect tool.&lt;/p&gt;

&lt;p&gt;🧠 DynamoDB Streams — Explained Like You're 10&lt;/p&gt;

&lt;p&gt;Think of your DynamoDB table as a notebook.&lt;/p&gt;

&lt;p&gt;Every time someone writes in it:&lt;/p&gt;

&lt;p&gt;adds a new line&lt;/p&gt;

&lt;p&gt;edits a line&lt;/p&gt;

&lt;p&gt;erases a line&lt;/p&gt;

&lt;p&gt;DynamoDB Streams captures that event like a security camera.&lt;/p&gt;

&lt;p&gt;Then it whispers to your Lambda function:&lt;/p&gt;

&lt;p&gt;“Hey, someone added a new user!”&lt;/p&gt;

&lt;p&gt;“Hey, someone updated their email!”&lt;/p&gt;

&lt;p&gt;“Hey, someone deleted an item!”&lt;/p&gt;

&lt;p&gt;Your Lambda can react instantly.&lt;/p&gt;

&lt;p&gt;That’s the magic of event-driven architecture.&lt;/p&gt;

&lt;p&gt;🛠️ Step 1: Building the Backend API&lt;/p&gt;

&lt;p&gt;I started with the essentials:&lt;/p&gt;

&lt;p&gt;✔ API Gateway endpoint → /register&lt;br&gt;
✔ Lambda function → validates &amp;amp; stores user data&lt;br&gt;
✔ DynamoDB table → Users&lt;br&gt;
✔ Duplicate checks → no repeated emails/usernames&lt;/p&gt;

&lt;p&gt;When a user registers, the API saves:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`{
  "name": "Alice",
  "email": "alice@gmail.com",
  "username": "al"
}
`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and returns:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`{"message": "User registered successfully"}`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Simple. Clean. Serverless.&lt;/p&gt;

&lt;p&gt;🔄 Step 2: Turning on DynamoDB Streams&lt;/p&gt;

&lt;p&gt;Next, I enabled Streams on the Users table with:&lt;/p&gt;

&lt;p&gt;Stream type: NEW_AND_OLD_IMAGES&lt;/p&gt;

&lt;p&gt;This means:&lt;/p&gt;

&lt;p&gt;for INSERT → record the new item&lt;/p&gt;

&lt;p&gt;for MODIFY → record both old + new&lt;/p&gt;

&lt;p&gt;for DELETE → record the old one&lt;/p&gt;

&lt;p&gt;Then I connected the Stream to a new Lambda:&lt;/p&gt;

&lt;p&gt;📌 LogUserChangesFunction&lt;/p&gt;

&lt;p&gt;This Lambda would “listen” to any change on the table.&lt;/p&gt;

&lt;p&gt;⚙️ Step 3: Building the Stream Processor Lambda&lt;/p&gt;

&lt;p&gt;Here’s the Lambda handler:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export const handler = async (event) =&amp;gt; {
  console.log("=== DynamoDB Stream Event Received ===");
  for (const record of event.Records) {
    const type = record.eventName;
    try {
      if (type === "INSERT") {
        console.log("USER ADDED:", JSON.stringify(record.dynamodb.NewImage));
      } else if (type === "MODIFY") {
        console.log("USER UPDATED - OLD:", JSON.stringify(record.dynamodb.OldImage));
        console.log("USER UPDATED - NEW:", JSON.stringify(record.dynamodb.NewImage));
      } else if (type === "REMOVE") {
        console.log("USER DELETED:", JSON.stringify(record.dynamodb.OldImage));
      } else {
        console.log("UNKNOWN EVENT:", type, record);
      }
    } catch (err) {
      console.error("Error processing record:", err, record);
      throw err;
    }
  }
  return { statusCode: 200 };
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tiny function became my “activity logger” for the entire database.&lt;/p&gt;

&lt;p&gt;🧪 Step 4: Testing — Where the Learning Really Happened&lt;/p&gt;

&lt;p&gt;This is where the real story lives.&lt;/p&gt;

&lt;p&gt;📌 Mistake 1: Expecting Streams to Show Old Data&lt;/p&gt;

&lt;p&gt;I added a new user named Alice before I turned on Streams.&lt;/p&gt;

&lt;p&gt;Later, when I checked logs…&lt;br&gt;
no event.&lt;/p&gt;

&lt;p&gt;Because:&lt;/p&gt;

&lt;p&gt;☑️ Streams only capture events that happen after you enable them.&lt;br&gt;
❌ They do NOT show past historical changes.&lt;/p&gt;

&lt;p&gt;📌 Mistake 2: Updating an Item Is Not an Insert&lt;/p&gt;

&lt;p&gt;When I updated Eve’s username from toto → kichwa, I got:&lt;/p&gt;

&lt;p&gt;USER UPDATED - OLD: ...&lt;br&gt;
USER UPDATED - NEW: ...&lt;/p&gt;

&lt;p&gt;Perfect.&lt;/p&gt;

&lt;p&gt;📌 Mistake 3: IAM Is the Silent Gatekeeper&lt;/p&gt;

&lt;p&gt;At first, I got errors like:&lt;/p&gt;

&lt;p&gt;“Cannot access stream. Ensure GetRecords, ListStreams permissions…”&lt;/p&gt;

&lt;p&gt;Streams won’t even fire unless IAM is correct.&lt;/p&gt;

&lt;p&gt;Give Lambda:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`dynamodb:GetRecords

dynamodb:GetShardIterator

dynamodb:DescribeStream

dynamodb:ListStreams`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After fixing that, everything worked flawlessly.&lt;/p&gt;

&lt;p&gt;📈 Why This Architecture Is Actually Scalable&lt;/p&gt;

&lt;p&gt;This simple system becomes extremely powerful because each part scales automatically:&lt;/p&gt;

&lt;p&gt;1️⃣ API Gateway&lt;/p&gt;

&lt;p&gt;Handles thousands of requests per second.&lt;/p&gt;

&lt;p&gt;2️⃣ Lambda&lt;/p&gt;

&lt;p&gt;Scales by spawning new instances based on traffic.&lt;/p&gt;

&lt;p&gt;3️⃣ DynamoDB&lt;/p&gt;

&lt;p&gt;Scales horizontally and supports millions of reads/writes per second.&lt;/p&gt;

&lt;p&gt;4️⃣ Streams&lt;/p&gt;

&lt;p&gt;Process events asynchronously without slowing down the main API.&lt;/p&gt;

&lt;p&gt;Together, they form a backend that can grow from 10 users to 10 million without refactoring.&lt;/p&gt;

&lt;p&gt;No servers.&lt;br&gt;
No patching.&lt;br&gt;
No worrying about capacity.&lt;/p&gt;

&lt;p&gt;Just pure scalability.&lt;/p&gt;

&lt;p&gt;🧩 What I Learned (The Real Takeaways)&lt;br&gt;
✔ Serverless is not about writing less code&lt;/p&gt;

&lt;p&gt;It’s about letting the platform handle scaling.&lt;/p&gt;

&lt;p&gt;✔ Real scalability comes from loose coupling&lt;/p&gt;

&lt;p&gt;Streams turn your system into Lego blocks that talk to each other.&lt;/p&gt;

&lt;p&gt;✔ IAM is everything&lt;/p&gt;

&lt;p&gt;You can write perfect code and still get blocked by one missing permission.&lt;/p&gt;

&lt;p&gt;✔ Logs are your best debugging tool&lt;/p&gt;

&lt;p&gt;Every DynamoDB event tells a story.&lt;/p&gt;

&lt;p&gt;✔ Event-driven architecture is addictive&lt;/p&gt;

&lt;p&gt;Once you start using Streams… you start seeing events everywhere.&lt;/p&gt;

&lt;p&gt;🎤 Final Thoughts&lt;/p&gt;

&lt;p&gt;When I finally gave the presentation to AWS User Group Pwani, everything worked smoothly — no errors, no surprises, just a clean demo.&lt;/p&gt;

&lt;p&gt;But the real win was everything I learned before that moment.&lt;/p&gt;

&lt;p&gt;I didn’t just build an API.&lt;br&gt;
I built a scalable, event-driven backend using real AWS production tools.&lt;/p&gt;

&lt;p&gt;More importantly:&lt;/p&gt;

&lt;p&gt;I gained a deeper understanding of how modern backends should behave — reactive, decoupled, scalable, and effortless to maintain.&lt;/p&gt;

&lt;p&gt;If you're curious about serverless, DynamoDB Streams is one of the best ways to start.&lt;br&gt;
Simple idea → big power.&lt;/p&gt;

&lt;p&gt;And who knows — your next small experiment might become your next talk or your next startup.&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>aws</category>
      <category>dynamodb</category>
      <category>lambda</category>
    </item>
  </channel>
</rss>
