<?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 Ayomide Omotosho on Medium]]></title>
        <description><![CDATA[Stories by Ayomide Omotosho on Medium]]></description>
        <link>https://medium.com/@ayomi.omotosho?source=rss-9cf8a328540d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*eOxhtKiAMb9m_hPFG9Vd5g.jpeg</url>
            <title>Stories by Ayomide Omotosho on Medium</title>
            <link>https://medium.com/@ayomi.omotosho?source=rss-9cf8a328540d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 22:35:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ayomi.omotosho/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[Managing Schema Evolution and Drift in dbt Enterprise Pipelines]]></title>
            <link>https://medium.com/@ayomi.omotosho/managing-schema-evolution-and-drift-in-dbt-enterprise-pipelines-f980da3e9241?source=rss-9cf8a328540d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f980da3e9241</guid>
            <category><![CDATA[dbt]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Ayomide Omotosho]]></dc:creator>
            <pubDate>Tue, 01 Sep 2026 15:50:11 GMT</pubDate>
            <atom:updated>2026-09-01T15:50:11.663Z</atom:updated>
            <content:encoded><![CDATA[<p>There are a few architectural decisions you make early on when setting up an enterprise pipeline, and those decisions end up deciding how often you’re on a call with a stakeholder at 2 a.m. because a dashboard isn’t loading or the numbers on it seem a bit off.</p><p>As long as the servers are up, the issue almost always traces back to schema drift, a problem that’s basically guaranteed in any organisation without real governance over its data. Schema drift is what happens when the shape of your data changes upstream, say for example: a column gets renamed, a type flips from int to string, a field that used to be populated starts showing up null, a join stops matching, or a metric that’s been stable for months takes an unexplained dip. This is usually a case of schema evolution turning into schema drift, change that happens to you instead of change you planned for.</p><p>Before I continue, there are some prerequisites I would expect from the reader to perfectly understand what this article is all about: the reader must understand materialisation fundamentals, selection of optimal incremental strategy, model governance, modularity and the medallion architecture.</p><h3><strong>Mutation Category</strong></h3><p>We will be approaching this based on the kinds of mutation that could happen, from the source and/or the transformation layer,<strong>Risk Level,</strong> what dbt offers to handle each mutation and how to best handle these changes within the pipeline to prevent schema drift.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A8npbVEl8KvPZ2SOfe6ySA.png" /></figure><h3><strong>Add Column</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PyXw3sDnLjIOFTz_-3uMxw.png" /></figure><p>In this case, new fields are introduced to source systems or transformation logic without changing existing definitions and this could be as a result of new application feature deployments, additional tracking attributes(like a timestamp column to capture time ingested) , or modified API payloads from source systems.</p><p>Risk level here is low, on paper nothing actually breaks. The real problem is failing to understand how dbt handles this schema change, because the default behaviour is not what most people assume. Let us take this config for example;</p><pre>{{<br>    config(<br>        materialized=&#39;incremental&#39;,<br>        engine=&#39;MergeTree()&#39;,<br>        order_by=&#39;customer_id&#39;,<br>        on_schema_change=&#39;ignore&#39;<br>    )<br>}}</pre><p>In the configuration above, the new column is silently dropped from the write. It exists in the compiled query’s result set but never lands in the table. This is definitely not an ideal option, but it serves as a fallback default if you do not want your pipelines to fail due to a schema update. There are other configurations that can be used as well; for example:</p><ul><li><strong>append_new_columns and </strong><strong>sync_all_columns</strong>: In both cases, dbt issues an ALTER TABLE … ADD COLUMN statement, backfilling every historical row with NULL for the new field. This automatic schema synchronization can be problematic if downstream analytics require historical completeness for the newly introduced attribute. One way to solve this is to execute a full refresh using dbt run --full-refresh --select model_name. Alternatively, you can run a selective historical backfill for hyper-scale tables where full refreshes incur prohibitive compute costs.</li><li><strong>fail:</strong> halts execution the instant a new column is detected, even though nothing about it is actually dangerous.</li></ul><blockquote><strong>Note:</strong> your dbt project fails compilation if YAML spec is not updated for the new column added and it throws a <em>Contract Validation Error. Also </em>If the model is a view or table instead of incremental, none of this matters, because dbt drops and rebuilds the whole relation on every single run via ‘CREATE TABLE/VIEW AS SELECT’. There is no target schema to reconcile against and the new column just appears, automatically after every run.</blockquote><pre>version: 2<br><br>models:<br>  - name: dim_customers<br>    description: &quot;Customer dimension table with schema contract.&quot;<br>    config:<br>      contract:<br>        enforced: true  # &lt;--- Contract enforced here<br>    columns:<br>      - name: customer_id<br>        data_type: integer  # &lt;--- Required when contract is enforced<br>        data_tests:<br>          - unique<br>          - not_null<br><br>      - name: first_name<br>        data_type: varchar<br><br>      - name: total_orders<br>        data_type: integer # &lt;--- New column must be added if contract is enforced</pre><p>Lastly, regarding best practices for this mutation honestly depends on the data team but if i were to pick, <em>append_new_columns</em> is a reasonable default for Bronze/staging incremental models, you want new source attributes absorbed without babysitting every upstream feature release, takes stress of the team as well. But pair it with a hard rule: <strong>no ‘select *’ past the staging boundary.</strong> Staging models can use ‘select *’ from a raw source if you want the convenience, but the first model that feeds an intermediate or mart layer should use an explicit column list, full stop.</p><h3><strong>Delete or Rename Column</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TeQm2CBPCd5A789v1RZvgg.png" /></figure><p>I am putting these two together because they have similar behaviour, These rarely happen but we can traces some of the root cause to a general operational database refactoring(maybe a switch from amount to amount_kobo), field deprecations, or security compliance removals(most common case). The Delete mutations occurs when an existing field disappears, from the source system directly, or from a transformation query that used to select it and the Rename column mutation changes column name while its definition and data stay put, Every layer interprets it as a drop of the old name plus an add of a new one, executed together.</p><pre>{{<br>    config(<br>        materialized=&#39;incremental&#39;,<br>        engine=&#39;MergeTree()&#39;,<br>        order_by=&#39;customer_id&#39;,<br>        on_schema_change=&#39;ignore&#39;<br>    )<br>}}</pre><p>Using similar config as the additive mutation above, For this config where on_schema_change is set to ‘ignore’, the target table keeps the now-orphaned column. If any downstream query, or the model’s own write statement, still expects that column as non-nullable or present in the select list, you get a hard compile or runtime error. For Rename Column mutations, under ‘ignore’, you can get the worst of both simultaneously, the old column staying orphaned with stale data <em>while</em> the new column’s data gets silently dropped from the same write. This is what happens with other configurations:</p><ul><li><strong>append_new_columns : </strong>This explicitly ignores the drops from the sources. The column is preserved in the target schema forever, silently filling with `NULL` for every future row , no crash, but a permanently orphaned, misleading column, metrics like average will drop with time which can be a problem if downstream still reference the column.</li><li><strong>sync_all_columns : </strong>In this case,dbt runs `ALTER TABLE … DROP COLUMN` to match the incoming query exactly. This is super destructive and all your historical data will be gone for good and on cloud data warehouses, dropping columns can force full table rewrites or scans, introducing computational latency and storage costs while permanently erasing historical data for dropped attributes.</li><li><strong>fail : </strong>Just like the previous mutation, it halts immediately, before any partial write happens.</li></ul><p>In terms of best practices, on_schema_change: fail plus an enforced contract is the right default for Silver and Gold layers. Dropping a contracted column must be a deliberate decision: discuss it with the engineering team before you proceed to bump the model version, update the YAML, and ship a PR. For Bronze/staging, prefer failing loudly over quietly absorbing the drop. A dropped column at ingestion almost always means a source team removed something, and you want that surfaced immediately, sometimes teams get too busy and forget to communicate these changes.</p><p>Lastly, If a source team plans a rename, the right pattern on your side is additive-then-subtractive: add the new column, alias it to the old name in staging for a deprecation window (`new_col_name as old_col_name`), update downstream references at your own pace, then formally retire the old alias in a versioned release. This decouples your schema’s timeline from the source’s rename timeline, which is the entire reason the Silver layer exists in the first place.</p><blockquote>Note: Model contracts enforce strict operational guardrails on incremental models. Contracted incremental models require on_schema_change to be set to either append_new_columns or fail in dbt. Setting on_schema_change: ignore on a contracted model creates an invalid state between database DDL and contract definitions, causing runtime validation to fail. Furthermore, dbt forbids combining model contracts with on_schema_change: sync_all_columns.</blockquote><h3>Type Mutation</h3><p>This is also a rare type of mutation, usually, the column name stays the same but the underlying data type changes for example,INTEGER changes to BIGINT, VARCHAR changes to JSON, a precision or scale change, a timezone-naive timestamp becoming timezone-aware and the common cause of these changes are operational database optimization, shifting precision requirements, or a serializer format change on the application side after an overhaul.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mIjnXuwaeo0hZW0fNZGKSw.png" /></figure><p>Risk level here is critical, and it’s the one mutation on this list most likely to fail silently at the data level instead of the query level. Following the configuration above for on_schema_change, using ignore or fail, a type mismatch the warehouse’s implicit casting can’t resolve throws an explicit casting error, the good outcome. The dangerous case is when the warehouse can implicitly cast, a wider integer narrowing into a smaller one, or a float truncating into an integer. The write succeeds, nothing errors, and precision is gone with zero signal. sync_all_columns will attempt `ALTER TABLE … ALTER COLUMN` to force the target type to match, which on most cloud warehouses triggers a full column rewrite, and on BigQuery, isn’t always achievable as a metadata-only change on partitioned tables.</p><p>A few other ways this shows up that are worth knowing: precision or scale narrowing (say NUMERIC(10,2) to NUMERIC(8,2) or UINT64 to UINT32) can overflow loudly or truncate quietly depending on the engine, don’t assume either outcome without checking. A timestamp going from timezone-naive to timezone-aware, or a source database just changing its session timezone default from UTC to UTC +1, rarely fails a cast at all, it just shifts every time-bucketed metric by a fixed offset(1Hr) with nothing to flag it. And “compatible” doesn’t mean “means the same thing,” a boolean stored as 0/1 still aggregates fine with SUM(), but the moment it becomes a ‘true’/’false’ string, that same SUM() either errors or returns garbage depending on the warehouse, with no schema-level signal that anything happened.</p><p>For best practice, an enforced contract is genuinely the strongest tool you have here, because it validates the declared data type at compile time, catching a silent implicit cast before it ever touches real data. For staging models without a contract yet, casting defensively (try_cast where the warehouse supports it, or an explicit cast with a tested fallback) in the first CTE that touches a raw field is cheap insurance.</p><h3>Conclusion</h3><p>Go back to the 2 a.m. call from the start of this article. Almost every version of that call maps onto one of the four mutations above, and in every case the actual fix was available before the page went out, it just wasn’t configured. Set on_schema_change deliberately instead of leaving it on the default, put contracts on anything Silver and Gold, kill select * the moment a model stops being staging, and put a real observability layer like Elementary in front of all of it so drift shows up as a Slack message instead of a stakeholder complaint. None of this stops schema change from happening, it’s not supposed to, schema evolution is normal and healthy. What it does is make sure the change happens on your terms and on a schedule you chose, instead of at 2 a.m., from someone else’s migration script. Selah!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f980da3e9241" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CAP Theorem Implementation in Modern Data Engineering Workflows]]></title>
            <link>https://medium.com/@ayomi.omotosho/cap-theorem-implementation-in-modern-data-engineering-workflows-05009605e993?source=rss-9cf8a328540d------2</link>
            <guid isPermaLink="false">https://medium.com/p/05009605e993</guid>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Ayomide Omotosho]]></dc:creator>
            <pubDate>Thu, 02 Apr 2026 00:15:10 GMT</pubDate>
            <atom:updated>2026-04-02T00:15:10.210Z</atom:updated>
            <content:encoded><![CDATA[<p>It was a Tuesday evening at a new fintech company when the Slack message came in.</p><blockquote>“Hey, Shola(the able Data Engineer), how far? the payments team is seeing duplicate charges. A handful of customers got billed twice for the same order. Customer support is flooded with requests of multiple debits.”</blockquote><p>Shola, after multiple back-and-forths, traced the issue to a Kafka consumer that had restarted mid-process after a brief network hiccup. The consumer had been using at-least-once delivery semantics. When it came back up, it re-read and re-processed messages it had already handled, and some of those messages triggered payment transactions.</p><p>The fix was straightforward; Shola just had to update the settings, but management was asking questions that needed answers. Nobody had made a bad decision. The team had chosen a highly available message broker(A in CAP), configured it for resilience, and deployed a consumer that prioritized avoiding data loss. All reasonable choices. But somewhere in the design, nobody had asked the golden question: <em>what happens when this system has to choose between being available and being consistent?</em></p><p>This is what the CAP theorem is really about.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*L0oWJouje4BU2WzP3QzMuQ.png" /></figure><h4><strong>What is CAP Theorem?</strong></h4><p>In 2000, computer scientist Eric Brewer made a claim at a distributed systems conference that seemed almost too clean to be true: any distributed data system can provide at most two out of three guarantees: Consistency, Availability, and Partition Tolerance. Two years later, Seth Gilbert and Nancy Lynch of MIT formally proved it, and the CAP theorem went from a simple talk to a law in the data engineering field.</p><blockquote><em>Let me explain what each of these letters mean.</em></blockquote><p><strong>C - Consistency</strong> in CAP’s vocabulary is the guarantee that every read will see the most recent write, and that the system behaves like a single machine even though it’s spread across many. If you write balance = 500 naira and someone else reads that value a millisecond later, a consistent system guarantees they see <em>500 naira</em>, not some older balance.</p><p><strong>A - Availability</strong> means every non-failing node responds to every request. Not necessarily with the freshest data, just with <em>a</em> response. An available system never leaves a client hanging with an error or a timeout simply because nodes can’t agree.</p><p><strong>P - Partition Tolerance</strong> is where things get interesting. A network partition occurs when the communication link between nodes breaks. Imagine two data centers that can no longer talk to each other because of the current war. Partition tolerance means the system keeps running despite a break.</p><p>Here’s the thing most people skip: in any real distributed system running across a network, partitions are not optional. Cables can fail, Routers could run into an issue, and cloud availability zones could go dark. You <em>cannot</em> design a distributed system that simply never partitions. It will happen. That makes partition tolerance non-negotiable.</p><blockquote>So the real CAP trade-off is this: <strong>when a partition occurs, do you prioritize consistency or availability? -We will answer this question later in this article.</strong></blockquote><h3><strong>PACELC: The Upgrade CAP Needed</strong></h3><p>CAP is a good starting framework, but it has a gap: it only describes behavior during failures. Daniel Abadi filled that gap in 2010 with the PACELC theorem.</p><blockquote>PACELC says: if there’s a <strong>P</strong>artition, choose between <strong>A</strong>vailability and <strong>C</strong>onsistency. <strong>E</strong>lse ,during normal operations ,choose between <strong>L</strong>atency and <strong>C</strong>onsistency.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Zp6klEpG8r6XsCPbfxIzw.png" /></figure><p>That “else” clause is where most systems actually spend their time. And it matters more than people realize. I highlighted it in a box in the diagram above.</p><p>Imagine your application writes a user profile update and wants confirmation. A consistency-first system (EC) waits for multiple replicas to acknowledge the write before responding. That’s safer, but it adds latency. A latency-first system (EL) confirms the write immediately and replicates in the background. Faster, but a node that reads before replication completes might see stale data.</p><p>This is why two databases can both claim to be “eventually consistent” while feeling very different in practice. One might converge in milliseconds; another in seconds. PACELC makes that distinction legible.</p><p>Here’s how some widely used systems fall on the spectrum:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*MvekY9kt-pxiUPrWHFPUdg.png" /></figure><p>The takeaway: there’s no universally “better” profile. There’s only the profile that matches your use case.</p><h3><strong>Choosing Your Database Through a CAP Lens</strong></h3><p><strong>When You Can’t Afford to Be Wrong: CP Systems</strong></p><p>CP systems prioritize data integrity. When a partition happens, and a CP system can’t guarantee that all nodes are in agreement, it refuses to answer, or it becomes unavailable for writes until consensus is restored.</p><p>That sounds painful. But consider what the alternative looks like in a fintech context: two isolated database nodes both accept a transfer of the same 1 million naira balance to different recipients. You now have a phantom 1 million naira in your system. That’s an audit finding. That’s a regulatory problem. That’s trust destroyed.</p><p>MongoDB is a common CP system in the wild. It uses a single-primary replica set: one node accepts writes, others replicate. If a network partition separates the primary from a majority of replicas, the primary steps down. The system becomes unavailable for writes until a new primary is elected from the reachable majority. It’s deliberately strict about this. And for a payment ledger or a medical record, you want that strictness.</p><p><strong>When You Can’t Afford to Be Slow: AP Systems</strong></p><p>AP systems keep every node available and responsive even during a partition. They accept that nodes on opposite sides of a partition will temporarily diverge, and they handle convergence once the partition heals.</p><p>Apache Cassandra is the textbook AP system. Its leaderless, peer-to-peer architecture means any node can serve any request. There’s no primary to elect, no quorum to wait for. If a node goes down, other nodes absorb the traffic without a hiccup. Cassandra handles the resulting inconsistencies through mechanisms like <em>hinted handoffs</em> (a healthy node temporarily stores a write for a downed peer), <em>read repairs</em> (reconciling versions on the fly during a read), and background <em>anti-entropy repairs</em>.</p><p>This makes Cassandra a natural fit for social media timelines, recommendation engines, web analytics, and IoT telemetry. If a user sees their post from an hour ago instead of 30 seconds ago for a brief moment — that’s fine. If they get a 503 error because the database is waiting to agree on a state, then Shola will be in trouble again.</p><h3><strong>Kafka and how it implements CAP trade-offs</strong></h3><p>Back to our Tuesday evening incident caused by Shola.</p><p>Kafka divides topics into <em>partitions</em>, each with a <em>leader</em> and multiple <em>followers</em>. The leader handles all reads and writes. Followers replicate the data asynchronously. Kafka maintains a list of <em>In-Sync Replicas</em> (ISRs), followers that are current with the leader. A message is only considered <em>committed</em> once all ISR members have acknowledged it.</p><blockquote>If the leader fails, Kafka elects a new one from the ISR. Because all ISR members have the same committed data, consistency is maintained across the failover. This is Kafka’s CP moment.</blockquote><p>The <em>acks</em> setting on a Kafka producer controls how many acknowledgments are required before a write is considered successful. It’s a direct dial on the consistency-availability spectrum as shown in the table below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*INOzVbvlNxMsWnHWLZCFXw.png" /></figure><p>For the payment pipeline Shola built, acks=1 might have been the silent accomplice. A fast response, but an implicit gamble on the leader staying alive long enough to replicate.</p><h4><strong>The Delivery Semantics That Define Your Pipeline’s Character</strong></h4><p>The bigger source of our Tuesday incident, caused by Shola, was delivery semantics, specifically the choice of at-least-once. There are three models:</p><p><strong>At-most-once</strong>: The consumer commits its offset <em>before</em> processing. If it crashes mid-processing, the message is gone. You prioritize availability and performance over completeness. Acceptable for metrics you can afford to approximate.</p><p><strong>At-least-once</strong>: The consumer commits its offset <em>after</em> successful processing. If it crashes and restarts, it re-reads and re-processes from the last committed offset. No messages are lost — but duplicates are possible. This is the default behavior for most Kafka consumers, and it’s what caused double charges in our story.</p><p><strong>Exactly-once</strong>: The holy grail of streaming. This requires atomic coordination between the source, the processing engine, and the sink. Kafka’s Transactional API achieves this by bundling the output write and the offset commit into a single atomic transaction. If it commits, both happened. If it rolls back, neither did.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i7vqDp-Dcp1XulIBdNH_TQ.png" /></figure><p><strong>Exactly-once is not free!</strong> But for transactional pipelines, it’s the right choice. For log analytics, at-least-once is usually fine.</p><h4><strong>Calibrating by Domain: A Practical Reference</strong></h4><p>There is no universally correct position on the CAP spectrum. The right choice depends on what your data does and what goes wrong when it’s wrong.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*cUO_smVRyXNV_erxNzMdBQ.png" /></figure><p>The interesting cases are the ones that span multiple domains. An e-commerce platform might need CP for inventory (you don’t want to oversell) and AP for product views and recommendations (availability matters more than freshness). That’s not a contradiction — it’s intentional calibration.</p><h3><strong>Conclusion</strong></h3><p>The CAP theorem has a reputation as a depressing constraint. Engineers learn about it and conclude that they can never have everything they want from a distributed system, so they might as well pick their poison and move on.</p><p>That’s the wrong takeaway.</p><blockquote>The right takeaway is that CAP gives you a framework for making <em>intentional</em> trade-offs. Every database you deploy, every Kafka configuration you push, every pipeline you design is already making a CAP decision , whether you’re aware of it or not. The engineer who knows the theorem gets to make that decision deliberately. Everyone else discovers it during a post-mortem, as Shola did.</blockquote><p>Use PACELC to think beyond failure states. Even during normal operations, you’re choosing between latency and consistency, and that choice shows up in every query your users run. Build idempotency into your pipelines from day one, not as an afterthought. Assume that messages will be redelivered. Assume that jobs will be retried. Design your writes so that “run twice” and “run once” produce the same outcome.</p><p>Thanks for reading, I hope you find this article insightful…. I am sure Shola did.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05009605e993" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CDC Pipeline: The Classification of CDC Methodologies.]]></title>
            <link>https://medium.com/@ayomi.omotosho/cdc-pipeline-the-classification-of-cdc-methodologies-c04285b79a8f?source=rss-9cf8a328540d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c04285b79a8f</guid>
            <category><![CDATA[debezium]]></category>
            <category><![CDATA[data-migration]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[clickhouse]]></category>
            <category><![CDATA[cdc-pipeline]]></category>
            <dc:creator><![CDATA[Ayomide Omotosho]]></dc:creator>
            <pubDate>Sat, 14 Mar 2026 09:13:10 GMT</pubDate>
            <atom:updated>2026-03-14T09:13:10.132Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Let’s take an example of a logistics company that makes deliveries across the country, just like FedEx or DHL. This company processes thousands of shipments daily across multiple cities, and one of the most important tables for such a company would be the </em><strong><em>shipments </em></strong><em>table. This table stores information related to the entire lifecycle of a shipment, from the time it’s created by a customer to the time it’s finally delivered to the customer.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6wq4hn05uc-V90ZEfOAHTA.png" /></figure><p><em>Every time a customer clicks “Place Order,” a new record is created in a company’s </em><em>shipments table, and at this initial stage, the record holds the shipment number, sender location, destination, package weight, the chosen shipping service, the expected SLA, etc. Its status? Simply </em><em>&quot;created&quot; or </em><em>&quot;pending_pickup.&quot; But as the physical items are transported through the network, that single database record is updated multiple times to reflect its current status.</em></p><ul><li>When the courier collects the items, the state shifts to &quot;picked_up.&quot;</li><li>When it hits the sorting facility, it becomes &quot;in_transit.&quot;</li><li>As it moves through regional hubs and distribution centers, the record continuously mutates until, finally, the courier drops the package at the customer’s door, and the state locks into &quot;delivered.&quot;</li></ul><p>Since all of these shipments go through these operational phases, it can be said that the <strong><em>shipments</em> </strong>table is essentially the central nervous system of the company’s entire delivery system. It is the undisputed single source of truth, and departments depend on its accuracy:</p><ul><li><strong>Customer Support</strong> uses it to instantly answer the timeless question: <em>“Where is my package?”</em></li><li><strong>Operations Managers</strong> rely on it to monitor delivery performance, spot bottlenecks, and ensure shipments are flowing smoothly through distribution centers.</li><li><strong>Strategy Teams</strong> analyze the aggregated volumes to understand regional demand patterns and plan future capacity.</li></ul><h3>The “Freshness Problem” in High-Stakes Logistics</h3><p>Here is where things get complicated. In global logistics, time is quite literally money. But on the analytics side, traditional data pipelines often rely on batch processing.</p><p>Batch processing traps operations managers in a frustrating “waiting game.” It means they are looking in the rearview mirror, forced to make decisions based on historical data rather than real-time reality. If a bottleneck occurs at a sorting facility at 10:00 AM, but the data warehouse isn’t updated until the midnight batch run, the opportunity to intervene is already lost.</p><h3>The Real-Time Bridge: Change Data Capture (CDC)</h3><p>To solve the freshness problem, <strong>Change Data Capture (CDC)</strong> has emerged as the foundational architecture for modern logistics and other companies use cases.</p><p>Instead of waiting hours to move data in bulk, CDC acts as a continuous listener. It captures the multiple, ever-changing status updates of a single shipment the moment they happen in the source system (like MySQL) and streams them instantly to analytical systems (like ClickHouse).</p><p>However, in modern data engineering, selecting your CDC methodology isn’t just a minor technical detail; it is arguably the most consequential decision in your pipeline design. It ultimately dictates the delicate balance between data fidelity, system impact on your operational databases, and the overall complexity of your engineering architecture. When a single table holds the truth of your entire operation, how you move that truth matters more than anything else. We will be looking at a couple of way this can be implemented.</p><h3>Log-Based Change Data Capture</h3><p>Log-based CDC is widely regarded as the most efficient and comprehensive approach for production environments. This method leverages the internal transaction logs of the database, such as the Write-Ahead Log (WAL) in PostgreSQL, the binary log (binlog) in MySQL, as in our use case, or the redo logs in Oracle and SQL Server. These logs serve as an immutable, ordered record of every <strong><em>committed change</em></strong>, primarily maintained for crash recovery and replication.</p><p>By reading directly from these logs, CDC tools like Debezium can capture changes asynchronously, meaning the capture process occurs outside the critical path of the application transaction. This architecture minimizes the “observer effect,” where the monitoring of the system degrades its performance. Furthermore, log-based CDC is the only method capable of reliably capturing “hard deletes” natively, as the removal of a record is explicitly written to the log even if it is gone from the table.</p><h3>Trigger-Based Change Data Capture</h3><p>Trigger-based CDC utilizes database-native functions to execute custom logic whenever an INSERT, UPDATE, or DELETE occurs. These triggers typically write the changed data into an “audit” or “shadow” table, which is then polled by the downstream pipeline. While this method is highly customizable and can incorporate complex business logic during the capture phase, it imposes a significant performance penalty. Every transaction at the source must now include the overhead of the trigger execution and the additional write to the audit table, effectively doubling the I/O requirement for every change. Consequently, trigger-based CDC is often reserved for lower-volume environments or scenarios where log access is restricted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lvQSncJZEYimlwkGl_1UoQ.png" /></figure><h3>Query-Based and Polling Architectures</h3><p>Query-based CDC, also known as polling, involves repeatedly querying the shipment table to identify rows that have changed since the last check, typically relying on metadata columns such as <strong><em>updated_at </em></strong>timestamps or incrementing version IDs. This is the simplest method to implement but suffers from several critical flaws. First, it cannot detect “hard deletes” because once a row is physically removed from the source, it disappears from the result set of any subsequent query. Second, if multiple changes occur between polling intervals, the system only captures the final state, losing the historical sequence of modifications. Finally, frequent polling of large tables can cause a notable performance drop due to repeated read operations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F_iVCvMl7VMvJWjl5yWQjQ.png" /></figure><h3>How do we configure the CDC mechanism for this Logistics use case??</h3><p>Implementing a resilient logistics pipeline requires specific configurations for the MySQL-to-ClickHouse stack.</p><h4>Step 1: MySQL Configuration</h4><p>For the shipments table to be captured effectively, the MySQL binlog_format must be set to ROW. This ensures the log contains actual row values for each lifecycle stage rather than just the executed SQL statement. Setting binlog_row_image=FULL is essential, as it captures both the “before” and “after” images of a row, allowing downstream analytics to see exactly what changed during a status transition. Additionally, Global Transaction Identifiers (GTIDs) should be enabled to simplify replication recovery during system failovers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RIy7DC8Pm6CUHuxhYWuyJg.png" /></figure><h4>Step 2: ClickHouse Configuration</h4><p>ClickHouse is a columnar OLAP database optimized for append-heavy workloads rather than row-level updates. To handle the evolving status of a single shipment, the ReplacingMergeTree engine is the standard choice.</p><ul><li><strong>Deduplication:</strong> When a shipment record is updated from created to delivered, ClickHouse receives these as new rows. During background merges, it deduplicates records sharing the same primary key (e.g., shipment_id), keeping only the version with the highest _version or timestamp.</li><li><strong>Version Management:</strong> The CDC pipeline must populate a _version column with a monotonically increasing value, such as a millisecond-precision timestamp or log sequence number (LSN), to ensure ClickHouse keeps the latest status correctly.</li></ul><pre>CREATE TABLE IF NOT EXISTS shipments (<br>    shipment_id UInt64,<br>    order_id String,<br>    carrier_id String,<br>    warehouse_id String,<br>    sender_name String,<br>    receiver_name String,<br>    destination_city LowCardinality(String),<br>    destination_country LowCardinality(String),<br>    weight_kg Float32,<br>    dimensions_cm Array(Float32),<br>    status LowCardinality(String), <br>    created_at DateTime DEFAULT now(),<br>    updated_at DateTime64(3),<br>    _is_deleted Bool DEFAULT false,<br>    _deleted_at DateTime64(3)<br>)<br>ENGINE = ReplacingMergeTree(updated_at)<br>PARTITION BY toYYYYMM(created_at)<br>ORDER BY (shipment_id);</pre><h4>Step 3: Managing Historical Data — Snapshots and Backfilling</h4><p>When initializing a new pipeline run, a <strong><em>snapshot </em></strong>of existing shipments is required. Traditional <strong><em>blocking</em></strong> snapshots can lock the shipments table for hours, causing timeouts for courier apps. <strong><em>Incremental snapshots </em></strong>solve this by dividing the table into primary-key-based chunks and interleaving chunk-reads with the real-time binlog stream, ensuring zero downtime for the production logistics database.</p><h4>Step 4: Handling the CDC connector</h4><p>It is important to minimize the resource impact on source databases, as it is paramount for operational stability. To do that, here are some things we can do:</p><ul><li><strong>Isolate Workloads:</strong> Run CDC connectors against a read-replica rather than the primary master node to avoid competing for CPU and I/O cycles during snapshotting or log parsing.</li><li><strong>Batching and Buffering:</strong> Tune the max.batch.size and poll.interval.ms of the connector. Larger batches improve throughput and reduce the number of commits to the destination but may increase the point-to-point latency.</li><li><strong>Parallelism:</strong> Use partitioning (e.g., Kafka partitions or Flink parallel operators) to process changes for different tables or shards of a table in parallel. This prevents a large transaction on one table from blocking the entire pipeline. This definitely comes with its cost; do proper research before implementing.</li></ul><h3>Step 6: Handling “Hard” and “Soft” Deletes in Sinks</h3><p>When a row is physically removed from the source (a hard delete), the CDC connector emits a delete event (e.g., an op: ‘d’ message with the before image of the row). Destinations generally handle this in one of two ways:</p><ol><li><strong>Hard Delete in Sink:</strong> The row is physically removed from the target table using a DELETE command during the merge process. This keeps the destination in perfect parity with the source.</li><li><strong>Soft Delete in Sink:</strong> The row is retained in the destination but marked with metadata columns like <strong><em>_is_deleted (boolean)</em></strong> and <strong><em>_deleted_at</em></strong> (timestamp). This is the preferred pattern for analytics, as it preserves history for audit trails and time-travel queries.</li></ol><h3>Conclusions</h3><p>Change Data Capture represents the “read-only” side of the Command Query Responsibility Segregation (CQRS) pattern at the infrastructure level.It allows organizations to decouple their operational “Source of Truth” from their analytical “Source of Insight”.</p><p>To achieve success with CDC, data architects must:</p><ul><li><strong>Prioritize Log-Based Capture:</strong> It is the only way to achieve sub-second latency with minimal production impact.</li><li><strong>Automate Schema Management:</strong> Manual schema updates cannot scale with modern development velocity; investing in a Schema Registry and automated drift propagation is mandatory.</li><li><strong>Design for Resilience:</strong> Expect failures, retries, and duplicates. Implement idempotency at the sink and establish robust DLQ patterns for manual remediation.</li><li><strong>Measure What Matters:</strong> Focus on end-to-end replication lag as the primary metric of pipeline success, and use granular database metrics to tune for performance.</li></ul><p>Ultimately, the shift to CDC is a shift toward a more responsive, event-driven enterprise. While the operational burden is higher than traditional batch ETL, the strategic advantage of operating on “reality” rather than “history” provides a critical edge in the modern digital economy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c04285b79a8f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data migration: How to Migrate data from Google Sheets to a PostgreSQL using Python.]]></title>
            <link>https://medium.com/data-epic/data-migration-how-to-migrate-data-from-google-sheets-to-a-postgresql-using-python-561ada38efb4?source=rss-9cf8a328540d------2</link>
            <guid isPermaLink="false">https://medium.com/p/561ada38efb4</guid>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[data-migration]]></category>
            <category><![CDATA[google-sheets-api]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Ayomide Omotosho]]></dc:creator>
            <pubDate>Thu, 07 Dec 2023 17:46:37 GMT</pubDate>
            <atom:updated>2023-12-07T17:46:37.715Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*LSKnf27qQrxt1gEtnWYreQ.png" /></figure><p>Data migration is the process of transferring data from one data storage system to another and also between data formats and applications. It also involves data transfers between different data formats and applications. The data migration process also includes data preparation, extraction, and transformation. It is usually conducted when introducing new systems and processes in an organization. The efficiency of data migration has far-reaching implications for an organization.</p><blockquote>Efficient data migration is crucial for organizations as it minimizes downtime, reduces data loss risk, ensures business continuity, and maintains data integrity for informed decision-making, while inefficient migration can lead to significant costs and data quality issues.</blockquote><h3>Introduction to Google Sheets and PostgreSQL</h3><p>Google Sheets is a widely used online spreadsheet application, part of the Google Drive suite. It allows users to create, edit, and collaborate on spreadsheets in real-time. Its accessibility, user-friendly interface, and integration with other Google services make it a popular choice for data storage and preliminary analysis.</p><p><em>PostgreSQL, on the other hand, is an advanced, open-source relational database management system, known for its robustness, scalability, and compliance with SQL standards. It is capable of handling large volumes of data and complex queries, making it a preferred database for applications requiring reliable data storage and sophisticated data manipulation capabilities.</em></p><h4>Why Migrate from Google Sheets to PostgreSQL?</h4><p>Sheets are used to store tabular data in day-to-day work life. This data storage system can be used as a database for relatively smaller-scale projects, to collect and fetch data from users. But for various reasons like data consistency, organized and extensible data structure, and operational convenience, a simple database is not manageable for even slightly complicated data structures — a relational database is required in these cases. Other reasons include:</p><ul><li><strong>Performance Speed:</strong> The performance of GS as a database in fetching and rendering APIs is well at low volumes but the performance is affected when the dataset grows large.</li><li><strong>Storage Limit: </strong>Google Sheets also has a storage limit of 5 million cells, which would seriously hamper the amount of data that can be ⁷ in a company’s database with ever-increasing data.</li><li><strong>Limited functionality:</strong> Spreadsheet applications are not designed to be used like databases, so the functionality of Google Sheets is limited compared to more advanced database management systems. For example, you can’t save videos or images, or add rich field types and there’s no built-in interface to query, filter or update data.</li><li><strong>Not scalable: </strong>Due to limited storage, Google Sheets is not scalable. Also, if many team members are working on the spreadsheet at the same time, the software will slow down, and you may encounter more errors.</li><li><strong>Cannot see beyond a table:</strong> No other views like Kanban or Calendar are supported in Google Sheets.</li></ul><p>These are few out of the many reasons why large-scale companies migrate their data from google sheet data storage system to other RDBMS like PostgreSQL.</p><h4>Why Use Python for this Data Migration?</h4><p>The use of Python for data migration, especially from Google Sheets to PostgreSQL, offers several compelling advantages:</p><ul><li><strong>Ease of Use and Readability:</strong> Python’s syntax is clear and concise, making it easy to write, read, and maintain code. This readability is particularly beneficial for complex data migration tasks, as it simplifies debugging and collaborative development.</li><li><strong>Robust Libraries and Frameworks: </strong>Python provides a rich ecosystem of libraries and frameworks suited for data manipulation and database interaction. Libraries like gspread for Google Sheets, pandas for data processing, and psycopg2 for PostgreSQL interaction, streamline the migration process.</li><li><strong>Flexibility and Scalability:</strong> Python’s flexibility allows it to handle various data types and structures encountered in Google Sheets and PostgreSQL. It can easily scale to accommodate large datasets, a critical factor in data migration projects.</li><li><strong>Automation and Scripting: </strong>Python is excellent for writing scripts that automate repetitive tasks. In the context of data migration, it can automate data extraction, transformation, and loading processes, reducing manual effort and the potential for errors.</li></ul><h4>Establishing Connections Using Python.</h4><p>Before data migration, you need to establish a connection with the google sheet API and PostgreSQL, and to do that you have to first setup an access for your google sheet and also create a database on Postgres, the two can be done following these steps;</p><ol><li><strong>Accessing the Google sheet using Google Sheets API</strong></li></ol><p>To establish a connection with google sheet you need to have a GCP account which you can use to create a project, and, on the interface, you can navigate to google APIs and Services and enable the Google Sheets API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uBMwrbi785Oj6arUg_hDPg.png" /></figure><p>After enabling the API, you can then create a service account in your Google Cloud project and download the JSON key file. This file contains credentials to authenticate your Python script with Google’s API, it looks something like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ohRom0DLuyKB8zFyfuCG3g.png" /></figure><p>The next thing to do is to share the Google Sheets with the email associated with your service account and give editor right (not necessary). This step is necessary for the service account to access the sheets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*XcBJ0IzV4wdjjgNGr_wfIA.jpeg" /></figure><h4>2. Creating a PostgreSQL Database and Table</h4><p>If not already installed, download and install PostgreSQL from the link below:</p><p><a href="https://www.postgresql.org/download/">PostgreSQL: Downloads</a></p><p>Follow the installation instructions for your operating system.</p><p>After completing the installation on your OS, navigate to PgAdmin on your PC and with the use of PgAdmin, you can create a new database by running a SQL script on the SQL editor or just create it manually on PgAdmin interface. For example, in SQL, you can create a database with:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*4V_DapzQqpCKpabGwXYBYw.png" /></figure><p>When you are done setting up your database, based on the data structure in your Google Sheets, design a corresponding table schema in PostgreSQL. Determine the columns and their data types and if the data types are different, you can perform some sort of transformation to get the right data type before ingestion.</p><p>You can create a table in the query editor or on PgAdmin interface, to create the table using the editor you can simply execute the SQLstatement below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*L_1Oj4kCAUeFvVjy4z__4w.png" /></figure><p>You can replace your_table_name, column1, datatype1, etc., with your specific table and column names and data types.</p><p>After setting up the access to the google sheet and creating a table in the database we can now write our python script in the following steps.</p><h3>What does the python script look like??</h3><h4>1. Creating a Connection with the PostgreSQL Database in the Python Script</h4><p>Before you start writing your script, ensure you have the necessary credentials to connect to your PostgreSQL database, including the host, database name, username, and password. If you haven’t already, install the pycorpg2library, which is a PostgreSQL adapter for Python, you can use pip to install this on your bash:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*M8PgtYzdjFtr60Pv1YLqFQ.png" /></figure><p>Write a Python Script to connect in your Python environment, write a script to establish a connection to the PostgreSQL database. For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WlthQbHvgCoc0543_loTMw.png" /></figure><p>Replace the parameters with your actual database credentials.</p><p>Execute a simple query to test the connection, such as retrieving data or the table schema.</p><h4>2. Getting data from the worksheet using Gspread library</h4><p>With your credentials, you can use the gspread Python library to connect to your Google Sheets document.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*FkPcuaWfWfvEsvwtobm8Lw.png" /></figure><p>Install it using pip and authenticate using the obtained credentials from your google service account, Once authenticated, use gspread to open the desired spreadsheet by its name and fetch the required worksheet. You can then read the data into a Python list or a Pandas dataframe for easier manipulation. This can be done using the script below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bSvuFa6ZSOSMEELV2_o3hw.png" /></figure><p>Replace name_of_spreadsheetwith the actual name of your Google Sheets file and replace worksheet_titlewith the title of the worksheet you want to extract data from. The get_all_recordsmethod is a function of the gspread library that retrieves all the data from the worksheet and returns it as a list of dictionaries, where each dictionary represents a row in the sheet. In a more professional setting, it is advisable to have things like service_account_file as an environment variable.</p><p>For more info on gspread library you can access the documentation through this link:</p><p><a href="https://docs.gspread.org/en/v5.10.0/user-guide.html#getting-all-values-from-a-worksheet-as-a-list-of-lists">Examples of gspread Usage — gspread 5.10.0 documentation</a></p><h4>3. Ingesting the data into Postgres Database</h4><p>After performing every necessary transformation, you want to do on the data, you can simply ingest by running this python script into the table in your PostgreSQL database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_SLdk9WL9BLw_t5-qM8pXA.png" /></figure><p>Once executed, the script will efficiently insert the transformed data into your PostgreSQL database, making it available for further analysis, reporting, and utilization within your data ecosystem. This streamlined process ensures that your valuable data is seamlessly integrated into your database, enabling you to derive insights and make informed decisions based on the transformed and enriched dataset.</p><h3>Conclusion</h3><p>In conclusion, Efficient data migration from Google Sheets to PostgreSQL is a critical aspect of modern data management, particularly when dealing with larger datasets or when advanced data manipulation capabilities are required.</p><p>By following the established steps for establishing connections, authenticating with Google Sheets, and PostgreSQL, and employing Python scripts for data migration, organizations can ensure a seamless transition of data, maintain data integrity, and enable data-driven decision-making.</p><h3>References</h3><p><a href="https://corporatefinanceinstitute.com/resources/data-science/data-migration/">Data Migration — Types, Definition, Process, Practices (corporatefinanceinstitute.com)</a></p><p><a href="https://stackby.com/blog/google-sheets-database/">Google Sheets as a Database: Pros &amp; Cons (stackby.com)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=561ada38efb4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-epic/data-migration-how-to-migrate-data-from-google-sheets-to-a-postgresql-using-python-561ada38efb4">Data migration: How to Migrate data from Google Sheets to a PostgreSQL using Python.</a> was originally published in <a href="https://medium.com/data-epic">Data Epic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[InfluxDB, The Leading Time Series Database]]></title>
            <link>https://medium.com/@ayomi.omotosho/influxdb-the-leading-time-series-database-b7b63f3c5a90?source=rss-9cf8a328540d------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7b63f3c5a90</guid>
            <dc:creator><![CDATA[Ayomide Omotosho]]></dc:creator>
            <pubDate>Tue, 10 Oct 2023 12:11:18 GMT</pubDate>
            <atom:updated>2023-10-10T12:11:18.434Z</atom:updated>
            <content:encoded><![CDATA[<p>Time series databases have gained popularity in recent years due to the surge in IoT devices, financial systems, and monitoring tools — all of which generate time-stamped data continuously. Among these databases, InfluxDB stands out as a top choice for many developers and organizations. In this article, we’ll explore what InfluxDB is, why it’s a preferred choice, and its primary use cases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZAlSsc3vtJ1fXw-J" /><figcaption>Photo by <a href="https://unsplash.com/@crew?utm_source=medium&amp;utm_medium=referral">Crew</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>What is InfluxDB?</h3><p>InfluxDB is an open-source time series database designed to handle high write and query loads. It’s particularly optimized for time-stamped or time-series data — data points that are indexed in time order. Examples include sensor data, stock market data, log data, and more.</p><h3>Why Choose a Time Series Database?</h3><p>Before delving into InfluxDB’s specifics, it’s crucial to understand the need for time series databases. Traditional relational databases can handle time-stamped data but aren’t optimized for the volume and frequency of time series data. This is where specialized databases like InfluxDB come in, offering:</p><ol><li><strong>Performance:</strong> Faster writes and queries due to time-based indexing.</li><li><strong>Scalability: </strong>Ability to handle massive influxes of data.</li><li><strong>Retention Policies:</strong> Automatic data aging or pruning based on retention configurations.</li></ol><h3>Why is InfluxDB Preferred?</h3><p>InfluxDB has several attributes that make it an attractive option:</p><ol><li><strong>High Performance:</strong> InfluxDB is engineered for speed. It can handle high write and query loads, making it suitable for large-scale applications.</li><li><strong>Flexibility:</strong> In addition to time series data, InfluxDB supports events, metrics, and real-time analytics.</li><li><strong>Integrated Query Language:</strong> InfluxDB introduces InfluxQL, a SQL-like query language, making it intuitive for developers familiar with SQL.</li><li><strong>Horizontal Scalability:</strong> As your data grows, InfluxDB scales out by distributing data across clusters.</li><li><strong>Data Compression: </strong>Time series data can become large very quickly. InfluxDB uses advanced compression algorithms to store data efficiently.</li><li><strong>Ecosystem:</strong> InfluxDB is part of the TICK stack (Telegraf, InfluxDB, Chronograf, Kapacitor), a set of tools for collecting, storing, visualizing, and processing time series data.</li></ol><h3>Use Cases of InfluxDB</h3><p>Given its features, InfluxDB finds its application in a range of scenarios:</p><ol><li><strong>Monitoring &amp; Real-time Analytics:</strong> Companies use InfluxDB to monitor their applications, infrastructure, and services in real-time. It helps in identifying performance bottlenecks, ensuring uptime, and detecting anomalies.</li><li><strong>IoT &amp; Sensor Data:</strong> With billions of IoT devices worldwide, there’s a continuous stream of sensor data. InfluxDB can store this data efficiently and provide real-time insights.</li><li><strong>Financial Market Data:</strong> Stock prices, trade volumes, and other market activities are time-stamped. InfluxDB can store and analyze this data for trends, allowing financial analysts to make informed decisions.</li><li><strong>User Behavior Analytics:</strong> Analyzing how users interact with applications over time can provide insights into feature adoption, user preferences, and more. InfluxDB can store such event-driven data for further analysis</li><li><strong>Machine Learning:</strong> Time series forecasting, a type of machine learning, requires a database that can quickly provide large datasets for training models. InfluxDB serves as an excellent backend for such applications.</li></ol><h3>How Does it Compare to RDBMS?</h3><blockquote>InfluxDB is specifically designed for time-stamped or time-series data. While it doesn’t strictly enforce a schema, it uses measurements, tags, and fields for data organization. The query language it employs is InfluxQL, which resembles SQL but is fine-tuned for time series operations. Performance-wise, InfluxDB exhibits high write and query speeds, especially with vast volumes of time-stamped data. Scalability, data compression, and retention policies are its strong suits, given the challenges posed by time series data.On the other hand, RDBMS, like MySQL or PostgreSQL, is structured and schema-bound. They employ SQL as their primary query language. Designed for a broad range of applications, RDBMSs can handle time-stamped data but might falter performance-wise when managing large-scale time series data. Their strength lies in data integrity, complex query capabilities, and support for ACID properties (Atomicity, Consistency, Isolation, Durability).</blockquote><h3>How Does it Compare to other Time Series DB?</h3><blockquote>Comparing InfluxDB with another time series DB, say TimescaleDB, we see some similarities and differences. TimescaleDB, unlike InfluxDB, is an extension of PostgreSQL. This means it combines the benefits of a relational database with the advantages of a time series database. Its query language is SQL, and given its RDBMS backbone, it can seamlessly integrate with many tools and platforms that support PostgreSQL. Performance is enhanced using chunking, where time series data is divided into smaller manageable chunks. While InfluxDB stands out for its sheer speed and ease of use for time series operations, TimescaleDB shines when there’s a need for relational data modeling combined with time series functionalities.</blockquote><h3>Conclusion</h3><p>Time series data is omnipresent, from the temperature readings of a weather station to the heartbeat logs of a server. As the volume of this data grows, so does the need for specialized databases to store and analyze it efficiently. InfluxDB, with its robust architecture, high performance, and rich ecosystem, has positioned itself as the leading choice for time series data management.</p><blockquote>Whether you’re venturing into IoT, setting up sophisticated monitoring for your applications, or delving into real-time analytics, InfluxDB offers a reliable, scalable, and efficient solution for all your time series data needs.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7b63f3c5a90" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Window Functions in SQL for Beginners]]></title>
            <link>https://medium.com/@ayomi.omotosho/window-functions-in-sql-for-beginners-553fe6b3ff3f?source=rss-9cf8a328540d------2</link>
            <guid isPermaLink="false">https://medium.com/p/553fe6b3ff3f</guid>
            <dc:creator><![CDATA[Ayomide Omotosho]]></dc:creator>
            <pubDate>Mon, 18 Sep 2023 15:50:18 GMT</pubDate>
            <atom:updated>2023-09-18T15:50:18.747Z</atom:updated>
            <content:encoded><![CDATA[<p>The world of SQL is vast and intriguing. If you’ve been navigating this realm for a while, you might think you’ve seen all there is to see. But tucked away, like a hidden treasure, lies an advanced feature: Window Functions. Today, let’s embark on an expedition to truly understand and master this powerful tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-4a-mdKV3cx-IJoO" /><figcaption>Photo by <a href="https://unsplash.com/@casparrubin?utm_source=medium&amp;utm_medium=referral">Caspar Camille Rubin</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>What are Window Functions?</h3><p>Imagine watching a film where the camera focuses on specific scenes, sometimes zooming in on a character, other times giving a broader view. The camera’s perspective is akin to how window functions operate in SQL, allowing us to focus on a specific “snapshot” or subset of data, while still being aware of the broader dataset.</p><p><em>Technically speaking, </em><strong><em>window functions apply aggregate and ranking functions over a particular window (set of rows)</em></strong><em>. They employ the `OVER` clause to define this window.</em></p><p>The Anatomy of the `OVER` Clause;</p><p>The magic of window functions revolves around the `OVER` clause:</p><ol><li><strong>Partitioning</strong>: Imagine dividing a film into different chapters or segments. Similarly, data can be segmented or partitioned. The `PARTITION BY` clause does this, breaking data into specific subsets.</li><li><strong>Ordering</strong>: Just as scenes in a movie have a sequence, data within each partition can be sequenced. The `ORDER BY` clause orders rows within these partitions.</li></ol><p>Example of Window Functions;</p><ol><li><strong>ROW_NUMBER():</strong></li></ol><p>This assigns a unique number to each row.</p><blockquote>SELECT name, <br> ROW_NUMBER() OVER (ORDER BY name) as row_num<br>FROM Authors;</blockquote><p>2. <strong>RANK() and DENSE_RANK():</strong></p><p>While both are ranking functions, `RANK()` leaves a gap in rank in case of ties, whereas `DENSE_RANK()` doesn’t.</p><blockquote>SELECT name, publication_count,<br> RANK() OVER (ORDER BY publication_count DESC) as rank,<br> DENSE_RANK() OVER (ORDER BY publication_count DESC) as dense_rank<br>FROM Authors;</blockquote><p>3. <strong>LAG() and LEAD():</strong></p><p>These functions grant the power to peek at rows before or after the current one.</p><blockquote>SELECT date, sales,<br> LAG(sales) OVER (ORDER BY date) as yesterday_sales,<br> LEAD(sales) OVER (ORDER BY date) as tomorrow_sales<br>FROM DailySales;</blockquote><p>4. <strong>NTILE():</strong></p><p>This function divides the result set into a specified number of equal parts.</p><blockquote>SELECT name, score,<br> NTILE(4) OVER (ORDER BY score) as quartile<br>FROM Exams;</blockquote><h3>Practical Use Cases</h3><p>1. <strong>Finding Top Performers:</strong></p><p>If you want to identify the top 10% of students in a class based on their scores:</p><blockquote>SELECT name, score,<br> NTILE(10) OVER (ORDER BY score DESC) as decile<br>FROM Students<br>WHERE NTILE(10) OVER (ORDER BY score DESC) = 1;</blockquote><p><strong>2. Calculating Running Totals:</strong></p><p>For businesses, understanding cumulative sales can provide valuable insights.</p><blockquote>SELECT date, daily_sales,<br> SUM(daily_sales) OVER (ORDER BY date ASC) as cumulative_sales<br>FROM Sales;</blockquote><p><strong>3. Identifying Sequence Breaks:</strong></p><p>If you have a sequence of numbers and want to identify where gaps exist:</p><blockquote>SELECT id, <br> LEAD(id,1) OVER (ORDER BY id) — id as gap<br>FROM SequenceNumbers<br>WHERE LEAD(id,1) OVER (ORDER BY id) — id &gt; 1;</blockquote><h3>Benefits and Considerations</h3><p><strong>1. Performance:</strong> Window functions can optimize performance, especially when compared to solutions involving multiple joins or subqueries.<br> <br><strong>2. Readability:</strong> While there’s a learning curve, once mastered, window functions can make your SQL queries more concise and transparent.<br> <br><strong>3. Pitfalls:</strong> It’s essential to understand the nuances of each function to avoid potential pitfalls. For instance, not realizing that `RANK()` skips numbers can lead to incorrect results in specific scenarios.</p><h3>Thoughts to challenge yourself with</h3><p>The true power of window functions unfolds with practice. Challenge yourself with:</p><ol><li>Mixed Scenarios: Try combining multiple window functions in a single query.</li><li>Nested Queries: Incorporate window functions in subqueries or CTEs.</li><li>Different Databases: While the core concepts remain consistent, nuances might differ across databases. Exploring various SQL flavors can deepen understanding.</li></ol><h3>Conclusion</h3><p>Window functions are akin to mastering advanced camera techniques in film-making. It takes time and practice, but once honed, it transforms the quality of your work. In SQL, mastering window functions equips you with tools to answer complex questions efficiently.</p><p>For those hungry for knowledge, continue practicing, challenging yourself, and diving into more complex datasets. It’s through exploration and consistent effort that we truly master the intricacies of any domain.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=553fe6b3ff3f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Azure Integration, Azure SSIS, and Self-Hosted Integration: A Deep Dive for Data Engineers]]></title>
            <link>https://medium.com/@ayomi.omotosho/azure-integration-azure-ssis-and-self-hosted-integration-a-deep-dive-for-data-engineers-da00611576b9?source=rss-9cf8a328540d------2</link>
            <guid isPermaLink="false">https://medium.com/p/da00611576b9</guid>
            <dc:creator><![CDATA[Ayomide Omotosho]]></dc:creator>
            <pubDate>Mon, 11 Sep 2023 15:29:33 GMT</pubDate>
            <atom:updated>2023-09-11T15:29:33.191Z</atom:updated>
            <content:encoded><![CDATA[<p><em>a short story…</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J4FZMlOuoPdEkfgG" /><figcaption>Photo by <a href="https://unsplash.com/@jstrippa?utm_source=medium&amp;utm_medium=referral">James Harrison</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In the realm of data processing and systems integration, Microsoft Azure provides a suite of tools tailored to meet various integration needs. For data engineers navigating this ecosystem, it’s essential to understand the specifics of each offering. This article delves into Azure Integration Services, Azure SQL Server Integration Services (SSIS), and Self-Hosted Integration.</p><h3>Azure Integration Services: Beyond Traditional Data Pipeline</h3><p>Azure Integration Services isn’t just a single tool but an amalgamation of several Azure services like Logic Apps, Service Bus, API Management, and Event Grid.</p><blockquote>Nuances: Azure Integration Services embraces a serverless architecture, enabling scalable and cost-effective solutions without the overhead of infrastructure management. Its strength lies in stitching together cloud platforms, third-party applications, and even databases, making it a holistic choice for complex integration tasks.</blockquote><p>For data engineers dealing with diverse sources and looking to set up event-driven workflows, Azure Integration Services can be instrumental. Whether it’s triggering data processing tasks upon the arrival of new data or orchestrating multi-step workflows that involve various services, it’s designed for flexibility and adaptability.</p><p><strong>Azure SSIS: ETL Perfected Over Time</strong></p><p>Azure SSIS, the cloud variant of the traditional SQL Server Integration Services, is no stranger to those who have been in the data space for a while. It’s the old reliable of data integration, now fortified with cloud capabilities.</p><blockquote>Nuances: Its primary role revolves around ETL processes. As data engineers, you would appreciate its vast library of connectors, transformation capabilities, and the familiarity of its interface, especially if you’ve worked with its on-premises counterpart.</blockquote><p>For data integration tasks centered around data warehousing, big data processing, or migrating data within the Azure framework, Azure SSIS can be a powerful ally. Its integration with Azure Data Lake, Azure Data Factory, and other Azure storage solutions means a more streamlined and optimized data processing pipeline.</p><p><strong>Self-Hosted Integration: Maximum Customizability</strong></p><p>Sometimes, the off-the-shelf cloud solutions might not cut it. There might be specific requirements, optimizations, or configurations needed, and that’s where Self-Hosted Integration comes into play.</p><blockquote>Nuances: This approach offers unparalleled control, allowing data engineers to fine-tune every aspect of their integration tasks. Whether you’re hosting it on-premises or on a cloud VM, the granular control is in your hands.</blockquote><p>But with great power comes great responsibility. The onus of maintenance, software updates, troubleshooting, and scalability rests squarely on your shoulders. Self-hosted solutions can be the right choice when dealing with sensitive data governed by strict regulations or when you need a level of customization that cloud offerings can’t provide.</p><p><strong>Making the Informed Choice</strong></p><p>Data engineers, more than anyone, understand that the choice of integration tools can greatly influence efficiency, scalability, and maintainability.</p><p>Azure Integration Services can offer agility and adaptability in cloud-first environments with diverse data sources. Azure SSIS, with its robust ETL features, can be the workhorse for traditional data integration tasks, especially if your architecture revolves around the Azure ecosystem. For those moments when you need total control and customization, the self-hosted route might be the answer.</p><p>Remember, each project has unique requirements, and the best tool often depends on the specific challenges at hand. Equip yourself with knowledge, assess your integration challenges, and select the tool that fits just right. The right integration solution can not only streamline data processes but can also be a game-changer in achieving business objectives.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da00611576b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Azure Synapse Analytics vs. Azure Data Factory: Navigating the Azure Data Landscape]]></title>
            <link>https://medium.com/@ayomi.omotosho/azure-synapse-analytics-vs-azure-data-factory-navigating-the-azure-data-landscape-85b1a06b0bdb?source=rss-9cf8a328540d------2</link>
            <guid isPermaLink="false">https://medium.com/p/85b1a06b0bdb</guid>
            <dc:creator><![CDATA[Ayomide Omotosho]]></dc:creator>
            <pubDate>Sat, 09 Sep 2023 04:53:53 GMT</pubDate>
            <atom:updated>2023-09-09T04:53:53.963Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s rapidly evolving digital landscape, the need for efficient data processing and analytics tools has never been more paramount. Companies are increasingly turning to cloud-based solutions to harness the power of their data. Microsoft Azure, as a leading cloud service provider, has responded to this need with a suite of powerful data tools, two of which stand out: Azure Synapse Analytics and Azure Data Factory. These tools, though sometimes mentioned in the same breath, serve distinct yet complementary roles in the data ecosystem.</p><h3>Diving into Azure Synapse Analytics</h3><p>Azure Synapse Analytics, which many might remember as Azure SQL Data Warehouse, represents Microsoft’s ambitious effort to bridge the gap between big data and data warehousing. What this service promises is an environment where vast amounts of data can be ingested, stored, and analyzed seamlessly.</p><p>In a world that is increasingly data-driven, Azure Synapse Analytics shines as an integrated analytics service. It provides businesses the ability to dive deep into their data without the traditional hassles associated with setting up extensive data infrastructure. Think of it as a multi-faceted glass prism: you throw in data, and out comes actionable insights illuminated from various angles.</p><p>The real charm of Azure Synapse Analytics is its versatility. Companies can leverage it for real-time analytics, tapping into streams of data as they are generated and immediately deriving value. This is a game-changer for sectors that rely on timely data, such as financial services or e-commerce platforms, where understanding customer behavior in real-time can be the difference between a sale and a missed opportunity.</p><p>But Synapse doesn’t stop there. Its serverless data exploration feature means businesses can analyze their data on the fly, making it easier to adapt to changing business environments. This agility, combined with its robust security features, makes Synapse a compelling choice for enterprises looking to stay ahead of the curve.</p><h3>Exploring Azure Data Factory</h3><p>If Azure Synapse Analytics is the prism, then Azure Data Factory is the craftsman shaping the light before it hits. At its core, Azure Data Factory is about movement and transformation. It’s the logistics expert ensuring that data is in the right place, in the right format, at the right time.</p><p>The modern business landscape is complex, with data often residing in silos spread across different platforms and even geographical locations. Integrating this data is no small feat. This cloud-based integration service is all about orchestrating and automating data workflows. It ensures that data from various sources can be seamlessly aggregated, making it ready for analysis.</p><p>One of the significant challenges businesses face today is integrating legacy on-premises data with newer, cloud-based data. Azure Data Factory addresses this with its hybrid data integration capability, allowing businesses to bring together the old and the new in a cohesive manner.</p><p>Moreover, Azure Data Factory emphasizes visual design, allowing even those without a deep technical background to create data-driven workflows. This democratization of data processes means faster implementation and fewer bottlenecks, as businesses don’t need to rely solely on their IT departments to get things moving.</p><h3>Which is the best choice?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*wHwsHO6q8vbmMNHYTPV0dQ.png" /></figure><p>For businesses navigating the Azure data landscape, the choice isn’t so much about Azure Synapse Analytics vs. Azure Data Factory. Rather, it’s about understanding the unique capabilities of each tool and then leveraging them in tandem.</p><p>Companies need to first assess where they are in their data journey. Those just starting might prioritize Azure Data Factory to integrate their disparate data sources. On the other hand, businesses with a mature data infrastructure, looking to glean deeper insights from their data, might lean more towards Azure Synapse Analytics.</p><h3>Harmonizing the Two</h3><p>While both tools are powerful in their own right, it’s their combined use that truly allows businesses to unlock the potential of their data. Azure Synapse Analytics and Azure Data Factory are like two sides of the same coin, each complementing the other.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*egyBhBNg9OqIDhuH" /><figcaption>Photo by <a href="https://unsplash.com/@campaign_creators?utm_source=medium&amp;utm_medium=referral">Campaign Creators</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Consider a scenario where a company wants to analyze its sales data. Azure Data Factory can pull this data from various sources, be it from an on-premises SQL server, a cloud-based CRM system, or even social media analytics tools. It then transforms and aggregates this data, ensuring consistency. Once the data is ready, Azure Synapse Analytics takes over, diving deep into the data to provide insights. These might be trends over time, predictive analytics forecasting future sales, or even real-time dashboards reflecting current sales metrics.</p><h3>Conclusion</h3><p>In an era where data is the new oil, tools like Azure Synapse Analytics and Azure Data Factory are the refineries, turning raw data into actionable insights. As businesses continue to navigate the challenges and opportunities of the digital age, having the right tools, and more importantly, understanding how to use them in concert, will be crucial.</p><p>If you’re embarking on your data journey in the Azure ecosystem, remember: it’s not about one tool versus the other. It’s about harnessing the combined power of both to drive your business forward.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85b1a06b0bdb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>