<?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 Ngeno Gilbert on Medium]]></title>
        <description><![CDATA[Stories by Ngeno Gilbert on Medium]]></description>
        <link>https://medium.com/@ngenogilbert?source=rss-590b8c54c0bb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*izoqAUf8JwEBq_RyBoj_5A.png</url>
            <title>Stories by Ngeno Gilbert on Medium</title>
            <link>https://medium.com/@ngenogilbert?source=rss-590b8c54c0bb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 13:16:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ngenogilbert/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[How to Deploy Typesense + Airbyte on Kubernetes (with MySQL CDC)]]></title>
            <link>https://medium.com/@ngenogilbert/how-to-deploy-typesense-airbyte-on-kubernetes-with-mysql-cdc-a34616ff0d59?source=rss-590b8c54c0bb------2</link>
            <guid isPermaLink="false">https://medium.com/p/a34616ff0d59</guid>
            <category><![CDATA[typesense]]></category>
            <category><![CDATA[cdc]]></category>
            <category><![CDATA[airbyte]]></category>
            <dc:creator><![CDATA[Ngeno Gilbert]]></dc:creator>
            <pubDate>Wed, 22 Apr 2026 18:16:04 GMT</pubDate>
            <atom:updated>2026-04-22T18:36:57.783Z</atom:updated>
            <content:encoded><![CDATA[<p>If you want near-real-time search indexing from MySQL into Typesense, Airbyte can bridge CDC events into your search cluster with minimal custom code.</p><p>This guide shows a practical Kubernetes setup:</p><ul><li>Typesense runs in-cluster</li><li>Airbyte is installed via Helm (version pinned)</li><li>MySQL CDC feeds a Typesense destination</li><li>Optional Istio/Ingress exposure for UI and APIs</li></ul><h3>Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5-t8HxN84uBTL0chQA0fsA.png" /></figure><h4>Prerequisites</h4><ul><li>A running Kubernetes cluster</li><li>kubectl configured to your target cluster</li><li>Helm installed</li><li>A MySQL instance reachable from the cluster</li><li>A namespace for this stack (examples below use index)</li><li>Storage class / PV setup for Typesense persistence</li><li>Optional: Istio or NGINX Ingress for external access</li></ul><p>You should keep your manifests/scripts in a repo structure similar to:</p><pre>index/<br>  ns.yaml<br>  pv.yaml<br>  typesense/<br>    install.sh<br>    deployment.yaml<br>    service.yaml<br>    pvc.yaml<br>    secret.yaml<br>    ingress.yaml<br>  airbyte/<br>    helm-install.sh<br>    values.airbyte.yaml<br>    source.mysql.cdc.json<br>    destination.typesense.json<br>    connection.mysql-to-typesense.cdc.json</pre><h3>1) Deploy Typesense</h3><p>Create namespace + shared PV first, then install Typesense:</p><pre>kubectl apply -f index/ns.yaml<br>kubectl apply -f index/pv.yaml<br>bash index/typesense/install.sh<br>kubectl -n index rollout status deploy/typesense - timeout=180s</pre><p>Verify resources:</p><pre>kubectl -n index get pod,svc,pvc -l app.kubernetes.io/name=typesense</pre><p>Health check (in-cluster):</p><pre>KEY=$(kubectl -n index get secret typesense-secret -o jsonpath=&#39;{.data.TYPESENSE_API_KEY}&#39; | base64 -d)<br><br>kubectl -n index run tscheck - rm -i - restart=Never \<br> - image=curlimages/curl:8.10.1 - command - \<br>sh -c &quot;curl -sS -H &#39;X-TYPESENSE-API-KEY: $KEY&#39; http://typesense.index.svc.cluster.local:8108/health&quot;</pre><p>Expected: healthy JSON response (commonly {&quot;ok&quot;:true}).</p><h4>2) Install Airbyte (Pinned Version)</h4><p>Install with a pinned chart/version for reproducibility:</p><pre>bash index/airbyte/helm-install.sh<br>kubectl -n index get pods</pre><p>Pinning helps avoid upgrade drift and unexpected connector/runtime behavior changes.</p><h4>3) Access the Airbyte UI</h4><h4>Option A: Port-forward (fastest)</h4><pre>kubectl -n index port-forward svc/airbyte-airbyte-webapp-svc 8000:80</pre><p>Open <a href="http://127.0.0.1:8000.">http://127.0.0.1:8000.</a></p><h4>Option B: Istio/Ingress route</h4><p>Apply your Airbyte VirtualService/Ingress manifest and browse using your DNS host.</p><h4>4) Prepare MySQL for CDC</h4><p>Validate required MySQL settings:</p><pre>kubectl -n mysql exec mysql-0 - mysql -uroot -e \<br>&quot;SHOW VARIABLES WHERE Variable_name IN (&#39;log_bin&#39;,&#39;binlog_format&#39;,&#39;binlog_row_image&#39;,&#39;server_id&#39;);&quot;</pre><p>Required:</p><ul><li>log_bin=ON</li><li>binlog_format=ROW</li><li>binlog_row_image=FULL</li><li>non-zero server_id</li></ul><p>Bootstrap replication user/permissions:</p><pre>kubectl -n mysql exec mysql-0 - mysql -uroot &lt; index/airbyte/mysql-cdc-bootstrap.sql</pre><h4>5) Configure Airbyte: Source, Destination, Connection</h4><p>Use templates:</p><ul><li>index/airbyte/source.mysql.cdc.json</li><li>index/airbyte/destination.typesense.json</li><li>index/airbyte/connection.mysql-to-typesense.cdc.json</li></ul><h4>Source (MySQL CDC)</h4><ul><li>replication method: CDC</li><li>host resolves in-cluster (example: mysql.index.svc.cluster.local)</li></ul><h4>Destination (Typesense)</h4><ul><li>host: typesense.index.svc.cluster.local</li><li>port: 8108</li><li>API key from typesense-secret</li></ul><h4>Connection stream settings</h4><ul><li>syncMode: incremental</li><li>destinationSyncMode: append_dedup</li><li>cursorField: _ab_cdc_cursor</li><li>primaryKey: id</li></ul><h4>6) Run Sync and Verify End-to-End</h4><p>Run first sync (manual or scheduled), then validate.</p><h4>Check source count</h4><pre>kubectl -n mysql exec mysql-0 - mysql -uroot -D stock -Nse &quot;SELECT COUNT(*) FROM stock;&quot;</pre><h4>Check Typesense collection</h4><pre>curl -s -H &quot;X-TYPESENSE-API-KEY: $KEY&quot; \<br>&quot;http://typesense.index.svc.cluster.local:8108/collections/stock&quot;</pre><h4>CDC mutation smoke test</h4><pre>INSERT INTO stock.stock (id, name, updated_at) VALUES (900001, &#39;first&#39;, NOW());<br>UPDATE stock.stock SET name=&#39;second&#39;, updated_at=NOW() WHERE id=900001;</pre><p><strong>Confirm document in Typesense:</strong></p><pre>curl -sS \<br>&quot;http://typesense.index.svc.cluster.local:8108/collections/stock/documents/900001&quot; \<br>-H &quot;X-TYPESENSE-API-KEY: $KEY&quot;</pre><p>Expected: sameid, updated fields reflected.</p><h4>7) Known Gotchas and Hardening Tips</h4><h4>Airbyte scheduling model</h4><p>Airbyte runs job-per-trigger. Even with cron every minute, it creates new sync jobs over time (serialized per connection), not one permanent sync process.</p><h4>CDC delete caveat</h4><p>CDC delete events may be captured at source, but physical delete behavior in destination depends on connector implementation. For Typesense, verify whether deletes are actually issued vs upsert-only behavior.</p><h4>Resource pressure</h4><p>If you hit exceeded quota, OOM, or unstable syncs:</p><ul><li>right-size requests/limits for Airbyte components and Typesense</li><li>reduce concurrency</li><li>validate namespace quota settings</li></ul><h4>Version pinning</h4><p>Keep chart/image versions pinned in Git so deployments are repeatable across clusters.</p><h4>Networking consistency</h4><p>Use consistent in-cluster DNS names and avoid mixing aliases unless intentionally documented.</p><h4>8) Production Notes</h4><ul><li>Use real DNS + TLS (not temporary hostnames)</li><li>Store secrets in Kubernetes Secret or external secret manager</li><li>Keep manifests/templates in Git</li><li>Add monitoring/alerts for failed sync jobs and lag</li><li>Validate backup/restore for Typesense persistent volume</li></ul><h4>Troubleshooting Quick Hits</h4><p>0 records repeatedly after enabling CDC</p><ul><li>Rediscover schema</li><li>Re-check _ab_cdc_cursor mapping</li><li>Reset connection state</li><li>Trigger fresh sync</li></ul><p>UI loads, but actions fail</p><ul><li>Confirm webapp route and API route wiring</li><li>Verify service destinations in VirtualService/Ingress</li></ul><p>Typesense unreachable from Airbyte</p><ul><li>Validate DNS from namespace</li><li>Validate service/port and NetworkPolicies</li></ul><h4>Final Checklist</h4><ul><li>Typesense pod ready and health endpoint works</li><li>Airbyte pods healthy</li><li>MySQL CDC prerequisites enabled</li><li>Source + destination + connection configured</li><li>Stream set to incremental + append_dedup with correct PK/cursor</li><li>First sync successful</li><li>Insert/update CDC verified in Typesense</li><li>Scheduling and alerts configured</li><li>Secrets, DNS, TLS, and GitOps baseline in place</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a34616ff0d59" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Use Google Maps in Flutter for Both Mobile and Web]]></title>
            <link>https://medium.com/@ngenogilbert/how-to-use-google-maps-in-flutter-for-both-mobile-and-web-8d7a33b4e1c0?source=rss-590b8c54c0bb------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d7a33b4e1c0</guid>
            <category><![CDATA[flutter-google-map]]></category>
            <category><![CDATA[flutter-web]]></category>
            <dc:creator><![CDATA[Ngeno Gilbert]]></dc:creator>
            <pubDate>Wed, 25 Feb 2026 11:35:43 GMT</pubDate>
            <atom:updated>2026-02-25T11:35:43.593Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*Z9LjeyXCuDWGaJJic_SYog.png" /></figure><p>Maps are one of the most common features in modern apps — from delivery trackers and social check-ins to location search and navigation. Flutter supports Google Maps on Android and iOS through official plugins, but supporting web alongside mobile requires a bit more setup. In this article, you’ll learn how to integrate Google Maps into a Flutter app that runs seamlessly on <strong>mobile and web</strong>.</p><h3>Why This Is Tricky</h3><p>Flutter’s mapping ecosystem is split between:</p><ul><li><strong>google_maps_flutter</strong> — official plugin for <strong>Android &amp; iOS</strong></li><li><strong>google_maps_flutter_web</strong> — official plugin that enables map support on <strong>Flutter web</strong></li></ul><p>While the two are designed to work together, there isn’t a single widget that magically renders the right map for every platform without a little configuration. The solution is to <em>conditionally import</em> and use different Google Maps implementations depending on the platform.</p><h3>What You’ll Build</h3><p>By the end of this article, you’ll be able to:</p><p>✔ Show a Google Map on Android &amp; iOS<br> ✔ Show a Google Map on Flutter web<br> ✔ Use the <strong>same widget</strong> in your UI for all platforms<br> ✔ Handle conditional imports cleanly and safely<br> ✔ Support markers and camera positioning</p><h3>Architecture Overview</h3><p>Here’s how the implementation works:</p><pre>lib/<br>├─ widgets/<br>│   ├─ map_widget.dart<br>│   ├─ web_map_widget.dart<br>│   ├─ mobile_map_widget.dart<br>│   └─ map_widget_stub.dart</pre><p>We use <strong>conditional imports</strong> so that Flutter knows at compile time which version to use.</p><h3>Step 1 — Add Dependencies</h3><p>First, add the required packages in your pubspec.yaml:</p><pre>dependencies:<br>  flutter:<br>    sdk: flutter<br>  google_maps_flutter: ^latest<br>  google_maps_flutter_web: ^latest</pre><p>The google_maps_flutter package works on Android and iOS, and google_maps_flutter_web enables web support.</p><h3>Step 2 — Create the Main Map Widget</h3><p>Create a file named map_widget.dart in your widgets/ folder:</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;map_widget_stub.dart&#39;<br>  if (dart.library.html) &#39;web_map_widget.dart&#39;<br>  if (dart.library.io) &#39;mobile_map_widget.dart&#39;;<br>abstract class MapWidget extends StatefulWidget {<br>  factory MapWidget() =&gt; getMapWidget();<br>}</pre><p>This file uses Dart <strong>conditional imports</strong> so we provide platform-specific implementations:</p><ul><li>web_map_widget.dart for web</li><li>mobile_map_widget.dart for mobile</li><li>map_widget_stub.dart as a fallback</li></ul><p>Flutter chooses which one to compile depending on where your code runs.</p><h3>Step 3 — Create the Web Map Widget</h3><p>Create web_map_widget.dart:</p><pre>import &#39;dart:html&#39;;<br>import &#39;dart:ui&#39; as ui;<br>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:google_maps/google_maps.dart&#39;;<br>import &#39;map_widget.dart&#39;;<br><br>MapWidget getMapWidget() =&gt; WebMap();<br>class WebMap extends StatefulWidget implements MapWidget {<br>  @override<br>  State&lt;WebMap&gt; createState() =&gt; WebMapState();<br>}<br>class WebMapState extends State&lt;WebMap&gt; {<br>  @override<br>  Widget build(BuildContext context) {<br>    final String htmlId = &quot;map&quot;;<br>    // Register a DOM element<br>    ui.platformViewRegistry.registerViewFactory(htmlId, (int viewId) {<br>      final mapOptions = MapOptions()<br>        ..zoom = 12<br>        ..center = LatLng(37.7749, -122.4194);<br>      final elem = DivElement()..id = htmlId;<br>      final map = GMap(elem, mapOptions);<br>      Marker(MarkerOptions()<br>        ..position = map.center<br>        ..map = map);<br>      return elem;<br>    });<br>    return HtmlElementView(viewType: htmlId);<br>  }<br>}</pre><h3>Key Notes</h3><ul><li>On web, Google Maps is rendered using the <strong>JavaScript Maps SDK</strong>, not a native widget.</li><li>You register an HTML element and embed it into Flutter using HtmlElementView.</li></ul><h3>Step 4 — Create the Mobile Map Widget</h3><p>Create mobile_map_widget.dart:</p><pre>import &#39;dart:async&#39;;<br>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:google_maps_flutter/google_maps_flutter.dart&#39;;<br>import &#39;map_widget.dart&#39;;<br><br>MapWidget getMapWidget() =&gt; MobileMap();<br>class MobileMap extends StatefulWidget implements MapWidget {<br>  @override<br>  State&lt;MobileMap&gt; createState() =&gt; MobileMapState();<br>}<br>class MobileMapState extends State&lt;MobileMap&gt; {<br>  final Completer&lt;GoogleMapController&gt; _controller = Completer();<br>  static const CameraPosition _initialPosition = CameraPosition(<br>    target: LatLng(37.7749, -122.4194),<br>    zoom: 12,<br>  );<br>  @override<br>  Widget build(BuildContext context) {<br>    return GoogleMap(<br>      initialCameraPosition: _initialPosition,<br>      onMapCreated: (controller) {<br>        _controller.complete(controller);<br>      },<br>      markers: {<br>        Marker(<br>          markerId: const MarkerId(&quot;center&quot;),<br>          position: _initialPosition.target,<br>        )<br>      },<br>    );<br>  }<br>}</pre><h3>Notes</h3><ul><li>google_maps_flutter gives you the full mobile API — camera control, markers, gestures, and more.</li><li>Use GoogleMapController for programmatic control.</li></ul><h3>Step 5 — Add a Fallback Stub</h3><p>Create a stub (map_widget_stub.dart) for platforms where Google Maps isn’t supported:</p><pre>import &#39;map_widget.dart&#39;;<br>MapWidget getMapWidget() =&gt; throw UnsupportedError(&quot;Platform not supported&quot;);</pre><h3>Step 6 — Use the Unified Widget</h3><p>Once everything is set up, you can use the map anywhere:</p><pre>Scaffold(<br>  appBar: AppBar(title: Text(&quot;Universal Google Map&quot;)),<br>  body: Center(<br>    child: SizedBox(<br>      width: double.infinity,<br>      height: 400,<br>      child: MapWidget(),<br>    ),<br>  ),<br>)</pre><p>No platform checks in the UI — just one unified MapWidget().</p><h3>Don’t Forget: Web API Key</h3><p>For web, you need to add your Google Maps JavaScript API key to web/index.html:</p><pre>&lt;script src=&quot;https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&quot;&gt;&lt;/script&gt;</pre><p>Without this, the map won’t load on web, even if the app compiles correctly.</p><h3>Tips &amp; Best Practices</h3><h3>Android &amp; iOS</h3><ul><li>Add your Android and iOS API keys in the platform config files (AndroidManifest.xml, AppDelegate.swift, etc.)</li><li>Set the correct permissions for location usage.</li></ul><h3>Web</h3><ul><li>Make sure your Maps JavaScript API is enabled in the Google Cloud Console.</li><li>Enable billing — Maps usage requires an active billing account.</li></ul><h3>Markers &amp; Features</h3><p>You can extend both implementations to support:</p><ul><li>Custom markers</li><li>Polylines</li><li>User location tracking</li><li>Camera animation</li></ul><p>Just remember: <strong>the API shapes are different on web vs mobile</strong>, so handle shared data carefully.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d7a33b4e1c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Indexes Actually Speed Up Queries]]></title>
            <link>https://medium.com/javarevisited/how-indexes-actually-speed-up-queries-d4dbdb2467a3?source=rss-590b8c54c0bb------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4dbdb2467a3</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Ngeno Gilbert]]></dc:creator>
            <pubDate>Mon, 02 Feb 2026 15:43:05 GMT</pubDate>
            <atom:updated>2026-02-02T16:04:25.783Z</atom:updated>
            <content:encoded><![CDATA[<p><em>What your database is really doing while you wait</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*U4C21PA6fIhKLgwm6kZ7gw.png" /></figure><p>The query looks innocent.</p><pre>SELECT *<br>FROM users<br>WHERE email = &#39;a@b.com&#39;;</pre><p>You hit Enter.<br>The database pauses.<br>Your app feels… sluggish.</p><p>You add an index, rerun the query, and suddenly it’s instant.</p><p>Most engineers stop there.</p><p>But why did that happen?<br>What changed inside the database engine?</p><p>Let’s pop the hood.</p><p>The Naive Mental Model (and Why It’s Wrong)</p><p>A common explanation goes like this:</p><blockquote>“An index helps the database jump directly to the row.”</blockquote><p>That sounds reasonable — but it’s not what actually happens.</p><p>Databases don’t “jump” inside tables. Rows are scattered across disk pages. Without extra structures, the engine has no idea where a specific value lives.</p><p>So let’s start with what really happens.</p><h4>Life Without an Index: The Full Table Scan</h4><p>With no index on email, the database has exactly one option: <strong>read everything</strong>.</p><pre>SELECT *<br>FROM users<br>WHERE email = &#39;a@b.com&#39;;</pre><h4>Execution plan (PostgreSQL)</h4><pre>Seq Scan on users<br>  Filter: (email = &#39;a@b.com&#39;)</pre><h4>What this actually means</h4><ul><li>Read page 1 → check every row</li><li>Read page 2 → check every row</li><li>Repeat until the table ends</li></ul><p>This is a <strong>sequential scan</strong>.</p><h4>Why it’s slow</h4><ul><li>Disk I/O dominates</li><li>CPU evaluates the condition for every row</li><li>Work grows linearly with table size</li></ul><p><strong>Time complexity:</strong></p><p>O(n)</p><p>For large tables, this is unavoidable — and painful.</p><h4>What an Index Really Is</h4><p>An index is <strong>not</strong> a shortcut inside your table.</p><p>It is a <strong>separate physical data structure</strong>, stored independently on disk.</p><p>In most relational databases, that structure is a <strong>B-Tree</strong>.</p><h4>Conceptually, each index entry looks like:</h4><pre>email_value → (page_id, row_offset)</pre><p>Key points:</p><ul><li>The index is <strong>sorted</strong></li><li>The table remains unchanged</li><li>The index provides an <strong>alternative access path</strong></li></ul><p>Think of it as a highly optimized lookup table pointing <em>to</em> your data, not containing it.</p><h4>The Same Query With an Index</h4><p>Now let’s add an index:</p><pre>CREATE INDEX idx_users_email ON users(email);</pre><h4>Execution plan</h4><pre>Index Scan using idx_users_email on users<br>  Index Cond: (email = &#39;a@b.com&#39;)</pre><p>This single line tells an entirely different story.</p><h4>What the Database Actually Does With an Index</h4><h4>Step 1: Traverse the B-Tree</h4><ul><li>Start at the root node</li><li>Move through internal nodes</li><li>Reach the leaf node containing &#39;a@b.com&#39;</li></ul><p>Each step is <strong>one page read</strong>.</p><h4><strong>Step 2: Fetch the row</strong></h4><ul><li>Index returns a row pointer (CTID / RowID)</li><li>Database reads the table page</li><li>Row is returned</li></ul><h4>Why this is fast</h4><ul><li>B-Trees are shallow (usually 3–4 levels)</li><li>Each node stores many keys per page</li><li>Disk seeks are minimized</li></ul><p><strong>Time complexity:</strong></p><p>O(log n)</p><p>Even with <strong>millions of rows</strong>, this often means <strong>single-digit page reads</strong>.</p><h4>Comparing the Plans Side by Side</h4><h4>Without index</h4><pre>Seq Scan on users<br>  Filter: (email = &#39;a@b.com&#39;)</pre><ul><li>Reads the entire table</li><li>CPU-heavy</li><li>Disk-bound</li></ul><h4>With index</h4><pre>Index Scan using idx_users_email on users<br>  Index Cond: (email = &#39;a@b.com&#39;)</pre><ul><li>Reads a handful of index pages</li><li>One table lookup</li><li>Predictable performance</li></ul><p>This is the real speedup, not magic, just less work.</p><h4>Index-Only Scans: When the Table Isn’t Touched</h4><p>Sometimes the database doesn’t even need the table.</p><h4>Query</h4><pre>SELECT email<br>FROM users<br>WHERE email = &#39;a@b.com&#39;;</pre><h4>Execution plan</h4><pre>Index Only Scan using idx_users_email on users<br>  Index Cond: (email = &#39;a@b.com&#39;)</pre><p>Because the index already contains email, the engine can answer the query <strong>without touching the table at all</strong>.</p><p>This is about as fast as it gets.</p><h4>Why Indexes Make ORDER BY and JOIN Faster</h4><h4>ORDER BY</h4><p>Indexes are already sorted.</p><pre>SELECT *<br>FROM users<br>ORDER BY email;</pre><p>If email is indexed:</p><ul><li>No sorting step</li><li>Rows are returned in order</li></ul><p>The execution plan simply walks the index.</p><h4>JOIN</h4><p>Indexes shine in joins.</p><pre>SELECT *<br>FROM orders o<br>JOIN users u ON o.user_id = u.id;</pre><p>With an index on users(id):</p><ul><li>The database finds matching rows quickly</li><li>Avoids nested full scans</li><li>Enables efficient join strategies</li></ul><p>Indexes don’t just speed up queries — they <strong>change the shape of execution plans</strong>.</p><h4>The Hidden Cost: Why Writes Get Slower</h4><p>Every index comes with a price.</p><p>On INSERT, UPDATE, or DELETE, the database must:</p><ul><li>Modify the table</li><li>Update each index</li><li>Potentially rebalance B-Trees</li></ul><h4>Result</h4><ul><li>Reads → faster</li><li>Writes → slower</li><li>Too many indexes → write amplification</li></ul><p>This is why high-write systems are selective about indexing.</p><h4>When Indexes Don’t Help (and Are Ignored)</h4><p>Databases are smart enough not to use indexes when they’re pointless.</p><h4>Common cases:</h4><ul><li><strong>Low selectivity</strong><br> (e.g., a status column where 90% of rows match)</li><li><strong>Functions on indexed columns</strong></li></ul><pre>WHERE LOWER(email) = &#39;a@b.com&#39;</pre><ul><li><strong>Wrong column order in composite indexes</strong></li><li><strong>Planner estimates a sequential scan is cheaper</strong></li></ul><p>An index is only useful if it meaningfully reduces work.</p><h4>The Mental Model to Keep</h4><p>Indexes don’t make queries fast by coincidence.</p><p>They:</p><ul><li>Replace linear scans with logarithmic lookups</li><li>Minimize disk I/O</li><li>Enable better execution strategies</li></ul><p>Next time you add an index, ask yourself:</p><blockquote>Which work am I removing — and what new work am I adding?</blockquote><p>That’s the difference between <em>using</em> indexes and <em>understanding</em> them.</p><p>If you want to go deeper into this , especially for interviews, <strong><em>Grokking the SQL Interview</em></strong> by <a href="https://medium.com/u/bb36d8439904">javinpaul</a> is one of the best resources I’ve found. It trains you to reason about queries, indexes, and performance the way real database engines do, not just pass syntax checks.</p><p>link: <a href="https://gumroad.com/a/1036063859/fhmehw">https://gumroad.com/a/1036063859/fhmehw</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4dbdb2467a3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/javarevisited/how-indexes-actually-speed-up-queries-d4dbdb2467a3">How Indexes Actually Speed Up Queries</a> was originally published in <a href="https://medium.com/javarevisited">Javarevisited</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying Spring Boot Applications with Docker and Kubernetes]]></title>
            <link>https://medium.com/@ngenogilbert/deploying-spring-boot-applications-with-docker-and-kubernetes-32e2e34034ce?source=rss-590b8c54c0bb------2</link>
            <guid isPermaLink="false">https://medium.com/p/32e2e34034ce</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Ngeno Gilbert]]></dc:creator>
            <pubDate>Tue, 21 Oct 2025 20:53:06 GMT</pubDate>
            <atom:updated>2025-10-21T20:53:06.609Z</atom:updated>
            <content:encoded><![CDATA[<p><em>What Containerizing My App Taught Me About Control, Chaos, and Letting Go</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_zidNZRQvyfP4cpayHczBQ.jpeg" /></figure><p>The first time I ran docker build, I felt a strange sense of calm.</p><p>For months, my Spring Boot app had been perfectly happy on my laptop — humming quietly under localhost:8080. It was a neat little world I controlled entirely: one JVM, one database, one developer.</p><p>Then the question came:</p><blockquote><em>“Can we deploy it to production?”</em></blockquote><p>That single line changed everything. Suddenly, my perfect little ecosystem had to survive in the wild — unpredictable servers, scaling demands, other developers’ machines, and (worst of all) production bugs.</p><p>That’s when I met <strong>Docker</strong> and <strong>Kubernetes</strong>.</p><p>Together, they taught me two lessons that extend far beyond DevOps:</p><ol><li>You can’t control everything — but you can isolate what matters.</li><li>Systems, like people, work best when they know their boundaries.</li></ol><p>Let me show you how I learned both — while deploying my first Spring Boot app.</p><h3>Step 1: Containerizing the App — “The Jar in a Box”</h3><p>Think of Docker as a <em>box that remembers how to build itself</em>.<br> If you can run your app locally, you can teach Docker to do the same.</p><p>Let’s start with a <strong>simple Spring Boot app</strong> — nothing fancy:</p><pre>@RestController<br>public class HelloController {<br>    @GetMapping(&quot;/&quot;)<br>    public String home() {<br>        return &quot;Hello from Spring Boot on Docker!&quot;;<br>    }<br>}</pre><p>Build your application JAR first:</p><pre>./mvnw clean package -DskipTests</pre><p>This creates target/demo-0.0.1-SNAPSHOT.jar.</p><p>Now create a <strong>Dockerfile</strong> in your project root:</p><pre>FROM openjdk:17-jdk-slim<br>WORKDIR /app<br>COPY target/demo-0.0.1-SNAPSHOT.jar app.jar<br>ENTRYPOINT [&quot;java&quot;,&quot;-jar&quot;,&quot;app.jar&quot;]</pre><p>Then build and run the image:</p><pre>docker build -t springboot-demo .<br>docker run -p 8080:8080 springboot-demo</pre><p>Visit <a href="http://localhost:8080/"><strong>http://localhost:8080</strong></a>, and voilà — your app runs inside a container.</p><p>That was the first time I realized something powerful:</p><blockquote><em>Docker doesn’t care where it runs — laptop, server, or cloud.<br> The app is </em>sealed<em>, consistent, and self-contained.</em></blockquote><p>It felt like the difference between chaos and control.</p><h3>Step 2: Writing the Docker Compose — “A Neighborhood, Not Just a House”</h3><p>An app rarely lives alone. It needs a database, cache, message queue — the rest of the ecosystem.</p><p>With <strong>Docker Compose</strong>, you define the neighborhood.</p><p>Example docker-compose.yml:</p><pre>version: &#39;3.8&#39;<br>services:<br>  app:<br>    image: springboot-demo<br>    build: .<br>    ports:<br>      - &quot;8080:8080&quot;<br>    environment:<br>      SPRING_DATASOURCE_URL: jdbc:postgresql://db:5432/demo<br>      SPRING_DATASOURCE_USERNAME: postgres<br>      SPRING_DATASOURCE_PASSWORD: postgres<br>    depends_on:<br>      - db<br><br>  db:<br>    image: postgres:15<br>    environment:<br>      POSTGRES_DB: demo<br>      POSTGRES_USER: postgres<br>      POSTGRES_PASSWORD: postgres<br>    ports:<br>      - &quot;5432:5432&quot;</pre><p>Then run:</p><pre>docker-compose up</pre><p>Now you have an <strong>application stack</strong>: the app + database, working together in isolated containers.</p><p>At this point, I thought I had mastered deployment.<br> Then Kubernetes arrived — and reminded me that control isn’t the goal; <em>orchestration</em> is.</p><h3>Moving to Kubernetes — “The Orchestra Conductor”</h3><p>Docker is like a musician tuning their instrument.<br> Kubernetes is the <strong>conductor</strong> — it ensures every instrument plays in harmony, scales, and recovers if one goes silent.</p><p>Let’s deploy the same Spring Boot app to Kubernetes.<br> We’ll start with three key YAML files.</p><h3>1️. Deployment — defines what to run</h3><p>deployment.yaml</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: springboot-deployment<br>spec:<br>  replicas: 2<br>  selector:<br>    matchLabels:<br>      app: springboot-demo<br>  template:<br>    metadata:<br>      labels:<br>        app: springboot-demo<br>    spec:<br>      containers:<br>        - name: springboot-container<br>          image: springboot-demo:latest<br>          ports:<br>            - containerPort: 8080</pre><p>This tells Kubernetes:</p><blockquote><em>“Run 2 pods of this app, each listening on port 8080.”</em></blockquote><h3>Service — defines how to talk to it</h3><p>service.yaml</p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: springboot-service<br>spec:<br>  type: NodePort<br>  selector:<br>    app: springboot-demo<br>  ports:<br>    - port: 8080<br>      targetPort: 8080<br>      nodePort: 30001</pre><p>This makes the app accessible from your host via <strong>port 30001</strong>.</p><h3>3️. (Optional) Ingress — defines where it lives on the web</h3><p>If you’re running an ingress controller (like NGINX), you can add:</p><p>ingress.yaml</p><pre>apiVersion: networking.k8s.io/v1<br>kind: Ingress<br>metadata:<br>  name: springboot-ingress<br>spec:<br>  rules:<br>    - host: demo.local<br>      http:<br>        paths:<br>          - path: /<br>            pathType: Prefix<br>            backend:<br>              service:<br>                name: springboot-service<br>                port:<br>                  number: 8080</pre><p>Apply everything:</p><pre>kubectl apply -f deployment.yaml<br>kubectl apply -f service.yaml<br>kubectl get pods</pre><p>And there it is — your Spring Boot app now lives in a <strong>self-healing, auto-scaling ecosystem</strong>.</p><p>You can kill a pod, and Kubernetes will just create another.<br> You can add replicas, and traffic will balance automatically.</p><p>It’s both terrifying and beautiful.</p><h3>What Docker and Kubernetes Taught Me</h3><p>Deploying to production used to feel like a risky jump.<br> Now it feels like engineering <em>with safety nets</em>.<br> But the deeper lesson wasn’t technical — it was philosophical.</p><p><strong>Lessons I Learned</strong></p><p><strong>Isolation breeds reliability</strong><br> By isolating the app in containers, I stopped blaming “the environment.”</p><p><strong>Declarative beats manual</strong><br> Writing YAMLs feels tedious until you realize they’re <em>contracts</em>, not commands.</p><p><strong>Automation is empathy</strong><br> The best systems don’t depend on your memory — they protect your team from burnout.</p><p><strong>Letting go is part of scaling</strong><br> Kubernetes made me realize: once you trust the system, you stop clinging to every process.</p><h3>Final Thoughts</h3><p>When I deployed my first Spring Boot app with Docker and Kubernetes, I thought I was learning DevOps.</p><p>In reality, I was learning <strong>discipline</strong> — the kind that keeps things running when you’re asleep.<br> The kind that lets you build without fear of “but it worked on my machine.”</p><blockquote><em>Docker taught me control.<br> Kubernetes taught me to let go.</em></blockquote><p>Together, they turned my Spring Boot app from a project… into a living system.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=32e2e34034ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Spring Boot Taught Me About Clean Architecture]]></title>
            <link>https://medium.com/javarevisited/what-spring-boot-taught-me-about-clean-architecture-3bc168229dfd?source=rss-590b8c54c0bb------2</link>
            <guid isPermaLink="false">https://medium.com/p/3bc168229dfd</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[solid-principles]]></category>
            <dc:creator><![CDATA[Ngeno Gilbert]]></dc:creator>
            <pubDate>Wed, 15 Oct 2025 14:05:42 GMT</pubDate>
            <atom:updated>2025-10-15T14:05:42.721Z</atom:updated>
            <content:encoded><![CDATA[<p>Reflections on separation of concerns, SOLID principles, and building maintainable Java apps</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*SEKxANe9HixNE8-msLCdoQ.png" /></figure><p>When I first started working with <strong>Spring Boot</strong>, I fell in love with how quickly I could build an API.<br> A few annotations, a couple of endpoints, and — boom — a running service.</p><p>But as the project grew, the “magic” that once made things fast began to make debugging harder.<br> Business logic crept into controllers.<br> Repositories began to return DTOs.<br> Testing became a nightmare.</p><p>That’s when I learned the most valuable lesson Spring Boot has to teach:<br> ~ <strong>Speed is great, but structure is greater.</strong></p><p>Let’s talk about what Spring Boot taught me about <strong>Clean Architecture</strong>, how it aligns with <strong>SOLID principles</strong>, and how it completely changed the way I build software.</p><h3>The Problem: When Everything Talks to Everything</h3><p>My early code looked like this:</p><pre>@RestController<br>@RequestMapping(&quot;/users&quot;)<br>public class UserController {<br><br>    @Autowired<br>    private UserRepository userRepository;<br><br>    @PostMapping<br>    public ResponseEntity&lt;User&gt; createUser(@RequestBody User user) {<br>        // Validation, business logic, persistence — all here 😬<br>        if (user.getEmail() == null || user.getEmail().isEmpty()) {<br>            throw new IllegalArgumentException(&quot;Email is required&quot;);<br>        }<br>        user.setCreatedAt(LocalDateTime.now());<br>        return ResponseEntity.ok(userRepository.save(user));<br>    }<br>}</pre><p>Everything was in one place:</p><ul><li>The <strong>Controller</strong> validated data</li><li>Applied <strong>business logic</strong></li><li>Talked directly to the <strong>database</strong></li></ul><p>It worked — until it didn’t.<br> When requirements changed, every file needed editing. Testing was slow and brittle.</p><p><strong>The Shift: Understanding Clean Architecture</strong></p><p>Then I discovered <strong>Clean Architecture</strong> — the idea popularized by Uncle Bob (Robert C. Martin).</p><p>It’s built on one powerful principle:</p><blockquote>Depend on abstractions, not concretions.</blockquote><p>Your application should have layers, each with a clear purpose and direction of dependency.</p><p>In Spring Boot, a clean architecture often looks like this:</p><pre>com.example.app<br> ├── controller        // Handles HTTP &amp; input/output<br> ├── service           // Business logic lives here<br> ├── repository        // Database persistence<br> ├── model             // Domain models<br> └── dto               // Data transfer objects</pre><p><strong>Applying It in Spring Boot</strong></p><p>Let’s refactor the messy controller above into a cleaner structure.</p><p><strong>Domain Model</strong></p><pre>@Entity<br>public class User {<br>    @Id<br>    @GeneratedValue(strategy = GenerationType.IDENTITY)<br>    private Long id;<br>    private String email;<br>    private String name;<br>    private LocalDateTime createdAt;<br><br>    // getters and setters<br>}</pre><p><strong>Repository Layer</strong></p><pre>@Repository<br>public interface UserRepository extends JpaRepository&lt;User, Long&gt; {<br>    Optional&lt;User&gt; findByEmail(String email);<br>}</pre><h3>Service Layer (Business Logic)</h3><pre>@Service<br>public class UserService {<br><br>    private final UserRepository repository;<br><br>    public UserService(UserRepository repository) {<br>        this.repository = repository;<br>    }<br><br>    public User createUser(User user) {<br>        if (user.getEmail() == null || user.getEmail().isEmpty()) {<br>            throw new IllegalArgumentException(&quot;Email is required&quot;);<br>        }<br>        if (repository.findByEmail(user.getEmail()).isPresent()) {<br>            throw new IllegalStateException(&quot;User already exists&quot;);<br>        }<br>        user.setCreatedAt(LocalDateTime.now());<br>        return repository.save(user);<br>    }<br>}</pre><h3>Controller Layer (I/O Only)</h3><pre>@RestController<br>@RequestMapping(&quot;/users&quot;)<br>public class UserController {<br><br>    private final UserService service;<br><br>    public UserController(UserService service) {<br>        this.service = service;<br>    }<br><br>    @PostMapping<br>    public ResponseEntity&lt;User&gt; createUser(@RequestBody User user) {<br>        return ResponseEntity.ok(service.createUser(user));<br>    }<br>}</pre><p>Now:</p><ul><li>The controller <strong>doesn’t care</strong> how users are stored.</li><li>The service <strong>doesn’t care</strong> how HTTP works.</li><li>The repository <strong>only</strong> manages persistence.</li></ul><p><strong>The SOLID Connection</strong></p><p>Clean Architecture isn’t just about folders — it’s about principles.<br>Here’s how Spring Boot helped me internalize the SOLID design philosophy:</p><pre>| Principle | Meaning                        | Spring Boot Lesson                             |<br>|------------|--------------------------------|------------------------------------------------|<br>| S          | Single Responsibility          | Controller for HTTP, Service for business logic |<br>| O          | Open/Closed                    | Use interfaces and `@Service` beans            |<br>| L          | Liskov Substitution            | Interfaces + dependency injection              |<br>| I          | Interface Segregation          | Define narrow service interfaces               |<br>| D          | Dependency Inversion           | Autowire interfaces instead of concretes       |</pre><p>Spring Boot makes these principles natural — but only if you design consciously.</p><p><strong>Testing Becomes a Joy (Not a Burden)</strong></p><p>With this structure, testing became simple.</p><p>Instead of starting the whole Spring context, I could test each layer in isolation:</p><pre>@ExtendWith(MockitoExtension.class)<br>class UserServiceTest {<br><br>    @Mock<br>    private UserRepository repository;<br><br>    @InjectMocks<br>    private UserService service;<br><br>    @Test<br>    void shouldCreateUserSuccessfully() {<br>        User user = new User();<br>        user.setEmail(&quot;test@example.com&quot;);<br><br>        when(repository.findByEmail(&quot;test@example.com&quot;)).thenReturn(Optional.empty());<br>        when(repository.save(any(User.class))).thenAnswer(i -&gt; i.getArgument(0));<br><br>        User saved = service.createUser(user);<br><br>        assertNotNull(saved.getCreatedAt());<br>        verify(repository).save(user);<br>    }<br>}</pre><p>No web server, no database — just the logic.<br>That’s <strong>clean architecture in action</strong>.</p><p><strong>The Takeaways</strong></p><p>After building multiple production systems with Spring Boot, here’s what I’ve learned:</p><ol><li><strong>Annotations don’t replace architecture.</strong><br>Spring Boot makes things easier, not automatic. Design still matters.</li></ol><p>2. <strong>Separate logic early.</strong><br>Don’t wait until the controller has 500 lines of code before refactoring.</p><p>3. <strong>Test by contract, not by side effects.</strong><br>Unit tests should assert behaviors, not database writes.</p><p>4. <strong>Let Spring manage dependencies — but own your design</strong>.</p><p>5. <strong>Clean code scales — messy code burns out teams</strong>.</p><p><strong>Final Thoughts</strong></p><p>Spring Boot gave me speed — but Clean Architecture gave me sanity.<br>If I had to summarize my journey in one sentence:</p><blockquote>“Spring Boot taught me that architecture isn’t a restriction; it’s the freedom to change without fear.”</blockquote><p>So the next time you start a new Spring Boot project, ask yourself — <br>Are you just building fast, or are you building clean?</p><p><strong>Recommended Next Steps</strong></p><ul><li>Refactor one of your old controllers into proper layers.</li><li>Add one unit test per service.</li><li>Re-read your code and ask: “<em>Who should really be doing this job?</em>”</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3bc168229dfd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/javarevisited/what-spring-boot-taught-me-about-clean-architecture-3bc168229dfd">What Spring Boot Taught Me About Clean Architecture</a> was originally published in <a href="https://medium.com/javarevisited">Javarevisited</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Discover why Javin Paul’s Spring resources remain essential in 2025 for mastering Spring Boot]]></title>
            <link>https://medium.com/javarevisited/discover-why-javin-pauls-spring-resources-remain-essential-in-2025-for-mastering-spring-boot-9c9c094edcc5?source=rss-590b8c54c0bb------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c9c094edcc5</guid>
            <category><![CDATA[spring-boot-interview]]></category>
            <dc:creator><![CDATA[Ngeno Gilbert]]></dc:creator>
            <pubDate>Mon, 06 Oct 2025 13:53:31 GMT</pubDate>
            <atom:updated>2025-10-06T13:53:31.057Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why Javin Paul’s Spring Books Still Matter in 2025</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6S4DKbx0XsJ2oo7VgxZN3g.png" /></figure><p>Spring remains one of the most powerful and widely used frameworks in the Java ecosystem — and in 2025, it’s more relevant than ever.<br> Whether you’re developing microservices, building APIs, or prepping for interviews, mastering Spring is still a key differentiator for Java developers.</p><p>That’s why two books by <strong>Javin Paul</strong> continue to stand out this year:</p><p>📘 <a href="https://gumroad.com/a/1036063859/sygyq"><strong>250+ Spring Professional Certification Practice Questions</strong></a><br> 💡 <a href="https://gumroad.com/a/1036063859/hrUXKY"><strong>Grokking the Spring Boot Interview</strong></a></p><p>Here’s why they’re still worth recommending.</p><h3>1. Spring Certification Is Still a Smart Career Move</h3><p>As Spring Boot 3.x, Spring Cloud, and microservices dominate modern backend systems, the <strong>Spring Professional Certification</strong> continues to add credibility to your profile.</p><p>Javin Paul’s <strong>250+ Practice Questions</strong> book remains one of the best prep tools because it:<br> ✅ Covers real exam-style questions<br> ✅ Explains each answer clearly — no guesswork<br> ✅ Aligns with the latest Spring modules and patterns</p><p>It’s a solid investment for anyone looking to validate their Spring expertise in 2025.</p><p>👉 <a href="https://gumroad.com/a/1036063859/sygyq">Check it out here</a></p><h3>2. Interviews Are More Practical Than Ever</h3><p>Technical interviews today aren’t about theory — they’re about building, debugging, and explaining <em>why</em> things work.</p><p>That’s where <strong>Grokking the Spring Boot Interview</strong> comes in. It’s designed to help developers answer questions confidently by understanding real-world use cases:<br> ⚙️ REST API design and error handling<br> 🔒 Security and OAuth2<br> 🧠 Database integration with Spring Data JPA<br> 🚀 Deployment and performance tuning</p><p>If you’re targeting Spring Boot roles, this guide helps you think like an experienced backend engineer — not just memorize answers.</p><p>👉 <a href="https://gumroad.com/a/1036063859/hrUXKY">Get it here</a></p><h3>3. Practical Learning That Stays Relevant</h3><p>Javin Paul’s writing style is simple, structured, and focused on <strong>practical learning</strong> — something that never goes out of style.<br> His books are perfect for:</p><ul><li>Developers preparing for interviews</li><li>Professionals pursuing certification</li><li>Anyone refreshing their Spring knowledge for modern architectures</li></ul><p>As companies continue shifting to <strong>cloud-native</strong>, <strong>Kubernetes-based</strong> environments, these books bridge the gap between foundational Spring concepts and production-ready skills.</p><h3>Final Thoughts</h3><p>In 2025, mastering Spring Boot is still one of the most rewarding paths for Java developers.</p><p>If your goals include <strong>certification</strong>, <strong>career growth</strong>, or <strong>stronger backend expertise</strong>, these two books by Javin Paul deserve a place on your reading list:</p><p>📘 <a href="https://gumroad.com/a/1036063859/sygyq">250+ Spring Professional Certification Practice Questions</a><br> 💡 <a href="https://gumroad.com/a/1036063859/hrUXKY">Grokking the Spring Boot Interview</a></p><p>They’re concise, practical, and built to help you grow — not just pass exams.</p><p><strong>#SpringBoot #Java #Certification #CareerGrowth #SoftwareEngineering #SpringFramework #JavinPaul</strong></p><p>✍️ <strong>About the Author</strong><br> <em>Gilbert Ng’eno is an Implementation Engineer and tech enthusiast who writes about backend systems, cloud infrastructure, and developer growth. He enjoys exploring modern Java, Spring Boot, and DevOps technologies.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c9c094edcc5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/javarevisited/discover-why-javin-pauls-spring-resources-remain-essential-in-2025-for-mastering-spring-boot-9c9c094edcc5">Discover why Javin Paul’s Spring resources remain essential in 2025 for mastering Spring Boot</a> was originally published in <a href="https://medium.com/javarevisited">Javarevisited</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Namespace Stuck in Terminating? Here’s How to Fix It]]></title>
            <link>https://medium.com/@ngenogilbert/kubernetes-namespace-stuck-in-terminating-heres-how-to-fix-it-4380ef85cd45?source=rss-590b8c54c0bb------2</link>
            <guid isPermaLink="false">https://medium.com/p/4380ef85cd45</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[pvc]]></category>
            <dc:creator><![CDATA[Ngeno Gilbert]]></dc:creator>
            <pubDate>Mon, 15 Sep 2025 07:47:03 GMT</pubDate>
            <atom:updated>2025-09-15T07:47:03.351Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve worked with Kubernetes for a few years — especially in a CI/CD-heavy environment — you’ve probably run into this issue:</p><blockquote><em>You try to clean up an ephemeral test environment, run </em><em>helm uninstall and then </em><em>kubectl delete namespace test-env, but the namespace just hangs in </em><strong><em>Terminating</em></strong><em>.</em></blockquote><p>This is a classic Kubernetes troubleshooting interview question, but it’s also a very real pain point in day-to-day ops. Let’s walk through it in a <strong>Q&amp;A format</strong> — the way you might encounter it in a technical interview.</p><h4>Why does a namespace get stuck in Terminating?</h4><p>Namespaces don’t just delete themselves. Kubernetes checks whether all resources inside that namespace are properly cleaned up first. If any <strong>finalizers</strong> are still present on objects (like pods, CRDs, or custom controllers), the deletion won’t complete.</p><p>Common culprits:</p><ul><li><strong>Finalizers</strong> not removed from custom resources.</li><li><strong>Stuck API resources</strong> (e.g., CRDs, webhooks) that depend on an unavailable controller.</li><li><strong>Network policies or PVs</strong> that block deletion.</li></ul><p>How do you check what’s blocking deletion?</p><pre>kubectl get namespace test-env -o json | jq &#39;.spec&#39;<br>kubectl get namespace test-env -o json | jq &#39;.metadata.finalizers&#39;</pre><p>Or more directly:</p><pre>kubectl get all -n test-env</pre><p>If you see resources that remain, or finalizers still attached, that’s your root cause.</p><p><strong>What’s the fastest way to unblock it?</strong></p><ol><li>Edit the namespace and remove finalizers:</li></ol><pre>kubectl get namespace test-env -o json &gt; tmp.json</pre><p>In tmp.json, remove the finalizers block under metadata. Then:</p><pre>kubectl replace - raw &quot;/api/v1/namespaces/test-env/finalize&quot; -f ./tmp.json</pre><p>This forces Kubernetes to ignore the finalizers and delete the namespace.</p><p>2. <strong>Delete problematic resources manually </strong>(for example, CRDs stuck with finalizers):</p><pre>kubectl patch crd &lt;crd-name&gt; -p &#39;{&quot;metadata&quot;:{&quot;finalizers&quot;:[]}}&#39; - type=merge</pre><p><strong>Is this safe in production?</strong></p><p>For <strong>ephemeral environments</strong> (like in CI/CD), it’s perfectly fine — speed is more important than chasing down every stuck finalizer.</p><p>For <strong>production</strong>, you should <strong>investigate why the finalizer exists</strong>. Finalizers usually protect important cleanup steps (like detaching storage). Removing them blindly could cause dangling cloud resources.</p><p><strong>How can you prevent this problem?</strong></p><p><strong>Use Helm hooks for cleanup</strong> → Ensure CRDs and resources are uninstalled properly.</p><p><strong>Automate forced cleanup in CI/CD</strong> → e.g., a script that patches finalizers if deletion hangs.</p><p><strong>Keep CRDs/controllers healthy</strong> → If the controller managing finalizers isn’t running, namespaces can get stuck.</p><p><strong>Run namespace sweeper jobs</strong> → A scheduled job can periodically check for and clear stuck namespaces.</p><p><strong>Final Thoughts</strong></p><p>A namespace stuck in Terminating is one of those issues that seems small but can derail entire CI/CD pipelines if not addressed quickly.</p><p>In an <strong>interview setting</strong>, the key is to explain the <strong>role of finalizers</strong>, <strong>how to inspect what’s blocking deletion</strong>, and how to force-delete safely.</p><p>In a real-world setting, balance speed (in test environments) with caution (in production).</p><p>If you keep these principles in mind, you’ll handle this question with confidence in both interviews and on the job.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4380ef85cd45" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes PersistentVolume & PVC Troubleshooting — Fixing Terminating PVCs and…]]></title>
            <link>https://medium.com/@ngenogilbert/kubernetes-persistentvolume-pvc-troubleshooting-fixing-terminating-pvcs-and-0224b7772777?source=rss-590b8c54c0bb------2</link>
            <guid isPermaLink="false">https://medium.com/p/0224b7772777</guid>
            <category><![CDATA[persistent-volume]]></category>
            <category><![CDATA[persistent-volume-claim]]></category>
            <dc:creator><![CDATA[Ngeno Gilbert]]></dc:creator>
            <pubDate>Tue, 12 Aug 2025 18:20:19 GMT</pubDate>
            <atom:updated>2026-04-24T06:32:59.735Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kubernetes PersistentVolume &amp; PVC Troubleshooting — Fixing Terminating PVCs and ContainerConfigErrors</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kEJu5krgdmwefjKxrkiOsg.png" /></figure><p>When running stateful workloads like MySQL or Keycloak in Kubernetes, you might run into a frustrating situation:</p><ul><li>Pods stuck in Pending or CreateContainerConfigError</li><li>PersistentVolumeClaims (PVCs) stuck in Terminating</li><li>Volumes refusing to unbind even after deleting the pod</li></ul><p>This guide walks through <strong>a real troubleshooting session</strong> and shows exactly how to fix it.</p><h3>The Scenario</h3><p>While deploying MySQL for a Keycloak instance, the StatefulSet pod failed with:</p><pre>Error: stat /home/wms/wms/27Mar2025_configs/data-keycloak: no such file or directr: stat /home/wms/wms/27Mar2025_configs/data-keycloak: no such file or directory</pre><p>At the same time, the PVC was stuck in:</p><pre>STATUS: Terminating</pre><p>And other pods were stuck in Pending.</p><h3>Why This Happens</h3><p>There are usually two main culprits:</p><ol><li><strong>Invalid Host Path</strong><br> If your PV uses a hostPath volume and the path doesn’t exist on the node, the container will fail to start.</li></ol><p><strong>2. PVC Finalizers Preventing Deletion</strong><br> Kubernetes attaches a kubernetes.io/pvc-protection finalizer to prevent accidental data loss.<br> Sometimes, this leaves PVCs stuck in Terminating if a PV or StatefulSet is still bound to it.</p><h3>Step 1 — Check Pod Events</h3><p>Always start by describing the pod:</p><pre>kubectl describe pod mysql-keycloak-0 -n keycloak</pre><p>In my case, the Events section showed:</p><pre>Error: stat /home/wms/wms/27Mar2025_configs/data-keycloak: no such file or directoy</pre><p>That told me the host path in my PV didn’t exist on the node.</p><h3>Step 2 — Fix the Host Path</h3><p>If you’re using hostPath, you need to make sure the directory exists <strong>on the node running the pod</strong>:</p><pre>sudo mkdir -p /home/wms/wms/27Mar2025_configs/data-keycloak<br>sudo chown 999:999 /home/wms/wms/27Mar2025_configs/data-keycloak</pre><p>(999:999 is the default UID/GID for MySQL in Docker.)</p><h3>Step 3 — Handle Stuck PVCs</h3><p>Even after fixing the path, my PVC was stuck:</p><pre>kubectl get pvc -n mysql<br>NAME           STATUS        VOLUME     CAPACITY   ACCESS MODES   STORAGECLASS   AGE<br>data-mysql-0   Terminating   mysql-pv   60Gi       RWO            sc-ssd         175m</pre><p>Here’s the fix:</p><h3>1. Scale down the StatefulSet:</h3><pre>kubectl scale statefulset mysql -n mysql --replicas=0</pre><h3>2. Remove the finalizer:</h3><pre>kubectl patch pvc data-mysql-0 -n mysql -p &#39;{&quot;metadata&quot;:{&quot;finalizers&quot;:null}}&#39; --type=merge</pre><h3>3. Force delete the PVC &amp; PV:</h3><pre>kubectl delete pvc data-mysql-0 -n mysql --force --grace-period=0<br>kubectl delete pv mysql-pv</pre><h3>Step 4 — Recreate PV and PVC</h3><p>If you’re using hostPath, define your PV like this:</p><pre>apiVersion: v1<br>kind: PersistentVolume<br>metadata:<br>  name: mysql-pv<br>spec:<br>  capacity:<br>    storage: 60Gi<br>  accessModes:<br>    - ReadWriteOnce<br>  persistentVolumeReclaimPolicy: Retain<br>  storageClassName: sc-ssd<br>  hostPath:<br>    path: /home/wms/wms/27Mar2025_configs/data-mysql</pre><p>Then reapply:</p><pre>kubectl apply -f pv-mysql.yaml</pre><h3>Step 5 — Scale Back Up</h3><pre>kubectl scale statefulset mysql -n mysql --replicas=1</pre><p>Verify:</p><pre>kubectl get pvc -n mysql<br>kubectl get pods -n mysql</pre><h3>Key Lessons Learned</h3><ol><li><strong>Check Events First</strong> — The kubectl describe pod Command is your best friend.</li></ol><p><strong>2. HostPath Needs Host Setup</strong> — Directories must exist on the node <strong>before</strong> the pod mounts them.</p><p><strong>3. PVC Finalizers Can Block Deletion</strong> — Removing them can free up stuck resources.</p><p><strong>4. Rebinding Requires Deletion</strong> — PV/PVC bindings don’t auto-update when paths change; you must delete and recreate them.</p><p><strong>5. Scale StatefulSets Before Deleting PVCs</strong> — Avoid race conditions by scaling down first.</p><p>With these steps, you can quickly diagnose and fix PVC binding issues, unblock pending pods, and resolve container configuration errors in Kubernetes StatefulSets.</p><p>💡 <em>If you found this guide useful, consider sharing it with your team or bookmarking it for the next time Kubernetes decides to hold onto a PVC like it’s a precious family heirloom.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0224b7772777" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Interview-Ready: A Review of ‘Grokking the Java Interview’]]></title>
            <link>https://medium.com/javarevisited/interview-ready-a-review-of-grokking-the-java-interview-749bdeff044c?source=rss-590b8c54c0bb------2</link>
            <guid isPermaLink="false">https://medium.com/p/749bdeff044c</guid>
            <category><![CDATA[for-java-ebook]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[java-interview]]></category>
            <category><![CDATA[java-certification]]></category>
            <category><![CDATA[java-interview-questions]]></category>
            <dc:creator><![CDATA[Ngeno Gilbert]]></dc:creator>
            <pubDate>Sun, 07 May 2023 07:26:36 GMT</pubDate>
            <atom:updated>2023-05-08T15:43:07.065Z</atom:updated>
            <content:encoded><![CDATA[<p>As a Java developer, I have always been passionate about mastering the intricacies of the Java programming language. But when it comes to job interviews, I had always felt like something was missing. I was good at general topics like Data Structures and Algorithms, System Design, and SQL, but I found that I would often stumble when it came to the more specific Java questions. It wasn’t until I came across <a href="https://medium.com/@javinpaul">Javin Paul</a>’s book, “<a href="https://gumroad.com/a/1036063859/devdz"><strong>Grokking the Java Interview</strong></a>” that I finally felt like I had the tools I needed to tackle any Java interview.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/1*QpovbxjFp_2WbDQlzl97XA.png" /><figcaption><a href="https://gumroad.com/a/1036063859/QqjGH">Grokking The Java Interview Level 1</a>.</figcaption></figure><p>One of the biggest challenges that Java programmers face during interviews is their lack of knowledge of Core Java concepts and essential APIs and packages like Java Collection Framework, Multithreading, JVM Internals, JDBC, Design Patterns, and Object-Oriented Programming. Many programmers, including myself, would focus on the broader topics and neglect the specific Java concepts that are so important for interviews.</p><p>Javin Paul’s book addresses this gap by introducing readers to classical Java interview questions from these topics. By going through these questions and topics, I was able to not only expand my knowledge but also get ready for my next Java interview. The book contains frequently asked questions and their answer/explanations on essential Java topics. You can use this book to quickly revise all essential Java concepts before your interview, both telephonic and face-to-face, and you can also use this book to learn Core Java in depth.</p><p>This book is also useful for Java developers preparing for the Spring Professional Certification Exam because Javin has tried to answer most of the questions from the Official Spring Certification Exam guide. This means you can use this as a review study guide for your spring certification preparation as well.</p><p>As I delved into the book, I found that Javin had addressed all of the common pitfalls that Java developers face during interviews. The book’s questions are a compilation of Javin’s best Java interview articles, which have been read by millions of Java developers, and it is also his 10 years of experience writing Java articles, tutorials, and interview questions. I particularly appreciated the depth of the explanations provided in the book, which helped me truly understand the concepts rather than just memorize them.</p><p>One quote that stuck with me from the book is, “Your answers drive interviews, and these questions will show you how to drive an Interviewer to your strong areas.” This quote encapsulates the essence of the book and the importance of truly understanding Java concepts before heading into an interview. With Javin’s book as my guide, I feel confident in my abilities to answer any Java interview question that comes my way.</p><p>In conclusion, I highly recommend “Grokking the Java Interview, Volume 1 and 2,” to any Java developer looking to expand their knowledge of Core Java concepts and essential APIs and packages. Whether you are preparing for a job interview or the Spring Professional Certification Exam, this book has everything you need to succeed. Don’t fall into the common pitfalls of Java interviews — pick up this book and drive the interview in your favor.</p><p>Grab your copy here:</p><p>Use code <strong>FRIENDS20</strong> for <strong>20%</strong> off.</p><p><strong>Grokking the Java Interview, volume 1</strong>: <a href="https://gumroad.com/a/1036063859/QqjGH">link</a></p><p><strong>Grokking the Java Interview, volume 2</strong>: <a href="https://gumroad.com/a/1036063859/devdz">link</a></p><p><strong>Grokking the Spring Boot Interview</strong>: <a href="https://gumroad.com/a/1036063859/hrUXKY">link</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=749bdeff044c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/javarevisited/interview-ready-a-review-of-grokking-the-java-interview-749bdeff044c">Interview-Ready: A Review of ‘Grokking the Java Interview’</a> was originally published in <a href="https://medium.com/javarevisited">Javarevisited</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why ‘Grokking the Java Interview, Volume 2’ is a Must-Read for Java Developers]]></title>
            <link>https://medium.com/@ngenogilbert/why-grokking-the-java-interview-volume-2-is-a-must-read-for-java-developers-42716872a9d3?source=rss-590b8c54c0bb------2</link>
            <guid isPermaLink="false">https://medium.com/p/42716872a9d3</guid>
            <category><![CDATA[java-interview]]></category>
            <category><![CDATA[programming-interviews]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[java-interview-questions]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Ngeno Gilbert]]></dc:creator>
            <pubDate>Fri, 21 Apr 2023 12:39:01 GMT</pubDate>
            <atom:updated>2023-04-27T13:16:07.396Z</atom:updated>
            <content:encoded><![CDATA[<p>Are you a Java developer preparing for an interview? Or are you looking to deepen your understanding of essential Java concepts? If so, <a href="https://medium.com/@javinpaul">Javin Paul’s</a> latest ebook, “<a href="https://gumroad.com/a/1036063859/devdz"><strong>Grokking the Java Interview, Volume 2</strong></a>,” is a must-read for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*4uVi7dBZ_12g8jcy6hyCVg.jpeg" /><figcaption>Grokking the Java Interview — Volume 2</figcaption></figure><p>This ebook is a continuation of the <a href="https://gumroad.com/a/1036063859/QqjGH"><strong>first volume</strong></a>, which received an overwhelming response from readers. You can get a free sample copy <a href="https://gumroad.com/a/1036063859/HMOAv"><strong>here</strong></a>.</p><p>Based on feedback and suggestions from readers, Paul has brought us this new edition, covering more advanced topics. The book contains frequently asked questions and their answer/explanations on essential Java topics. You can use this book to quickly revise all essential Java concepts before your interview, both telephonic and face-to-face, and you can also use this book to learn Core Java in depth.</p><p>The book covers a range of topics, including Strings, Abstract class, and Interface, Inheritance, ClassLoaders, Enum, ArrayList, HashMap, ConcurrentHashMap, Date, Time, and Calendar, Equals and HashCode, NIO and Socket Programming, Web Services, Error, Exception, and Troubleshooting, Tricky Questions, and Technical Core Java Questions. These questions are a compilation of Paul’s best Java interview articles which have been read by millions of Java developers, and it is also his 10 years of experience writing Java articles, tutorials, and interview questions.</p><p>If you’re preparing for Java interviews, we highly recommend going through these questions before your telephonic or face-to-face interviews; you will gain confidence and knowledge to answer the question and learn how to drive Java interviews in your favor.</p><blockquote>According to Paul, “Always remember your answers drive interviews; these questions will show you how to drive an Interviewer to your strong areas.”</blockquote><p>One of the significant advantages of this book is that it is written in concise and straightforward language that is easy to understand. The book is highly practical, and it provides practical solutions to real-world Java programming problems. The book is an excellent resource for both beginners and experienced Java developers.</p><p>In conclusion, “Grokking the Java Interview, Volume 2” is a highly recommended book for Java developers. With its comprehensive coverage of essential Java topics, it is an excellent resource for those preparing for Java interviews or looking to deepen their understanding of Java concepts. Get your copy today and take your Java skills to the next level.</p><p>Grab a copy of the <strong>Grokking the Java Interview</strong> — Volume 2 <a href="https://gumroad.com/a/1036063859/devdz"><strong>here</strong></a>.</p><p>Use (<strong>CODE — FRIENDS20</strong>) and get a <strong>20% OFF</strong> discount.</p><p>You can find <a href="https://medium.com/u/bb36d8439904">javinpaul</a> ‘s blogs, <a href="https://www.java67.com/">Java67</a> and<a href="https://t.co/DoVkv5tkf0"> Javarevisited</a>, for more <a href="https://t.co/q2oASU8JuZ">resources </a>and <a href="https://t.co/vs4WjwrHS6">tutorials </a>on Java programming.</p><p><a href="https://gumroad.com/a/1036063859/sygyq"><strong>Spring Framework Practice Questions</strong></a> for Spring developer and Spring Professional interviews. (<strong>sample copy</strong> <a href="https://gumroad.com/a/1036063859/qelhye">here</a>)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42716872a9d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>