<?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"><channel><title><![CDATA[Pratik Dhande | Data Engineering Lab]]></title><description><![CDATA[Here, I will post cool experiences with Data Engineering]]></description><link>https://pratikdhande.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/69e93b8bd5f8830e7da2feef/53a79b7a-86ee-41c6-b9dc-d25e5d30d0f2.jpg</url><title>Pratik Dhande | Data Engineering Lab</title><link>https://pratikdhande.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Wed, 09 Sep 2026 12:40:42 GMT</lastBuildDate><atom:link href="https://pratikdhande.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Zero Downtime Migration with AWS DMS - Architecting End to End IoT Data Pipeline]]></title><description><![CDATA[I am writing this blog to share my work for Merk Sharp and Dohme (MSD) client. This is not the actual client project. This is a personal protfolio project that reflects the challenges, and money mange]]></description><link>https://pratikdhande.hashnode.dev/zero-downtime-migration-with-aws-dms-architecting-end-to-end-iot-data-pipeline</link><guid isPermaLink="true">https://pratikdhande.hashnode.dev/zero-downtime-migration-with-aws-dms-architecting-end-to-end-iot-data-pipeline</guid><category><![CDATA[aws-cdk]]></category><category><![CDATA[AWS]]></category><category><![CDATA[aws dms]]></category><category><![CDATA[Cloud Migration]]></category><category><![CDATA[AWS Glue]]></category><category><![CDATA[aws athena]]></category><category><![CDATA[aws kinesis]]></category><category><![CDATA[aws iot core]]></category><dc:creator><![CDATA[pratikdhande]]></dc:creator><pubDate>Sun, 31 May 2026 23:52:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/69e93b8bd5f8830e7da2feef/bdd63a3a-96ad-44e9-8138-a32b03b7126d.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I am writing this blog to share my work for Merk Sharp and Dohme (MSD) client. This is not the actual client project. This is a personal protfolio project that reflects the challenges, and money mangement I did for MSD.</p>
<p>This reflection project is about real time data migration from an on premise databse to AWS cloud using AWS DMS and SCT. I use AWS IoT device simulator to replicate on premise data center infrastructure by ingesting real time IoT based data. I used Infrastructure as code (IaC) practice using AWS CDK to create, provision and manage resources.</p>
<p>My simulated customer here is The O2 Arena in London. It is a popular place for concerts. The O2 Arean has many shops inside. We call them tenants here. O2 Arena wants to monetize the crowd density and demographic information depending on event for improved marketing and also crowd management.</p>
<p>O2 Arena uses fixed sensors to measure real-time crowd flow, detect sudden bottleneck surges at access gates, and monitor zone occupancy levels safely and anonymously using Smart Venue Infrastructure Hardware. The hardware is mounted on the walls and walkways around the complex.</p>
<img src="https://cdn.hashnode.com/uploads/covers/69e93b8bd5f8830e7da2feef/e261d87b-a178-4c9a-b006-cb9826715561.png" alt="" style="display:block;margin:0 auto" />

<p><strong>The Edge and Intake Infrastructure Architecture:</strong></p>
<img src="https://cdn.hashnode.com/uploads/covers/69e93b8bd5f8830e7da2feef/c5695798-e46c-4d1b-98e8-fb7ea561c076.png" alt="" style="display:block;margin:0 auto" />

<p>To mimic the physical hardware footprint of Smart Venue Infrastructure Hardware, I engineered programmatic edge simulator using Python's threading module. IoT policy - Devices are strictly limited to iot:connect and iot publish actions on an explicit MQTT topic channel. Services used here are - AWS IoT core, Kinesis Firehose, AWS Lambda, MariaDB, AWS S3, AWS Secrets Manager.</p>
<p>This pipeline kicks off with a multi-threaded Python simulation script acting as an AWS IoT Device Simulator, broadcasting high-frequency, real-time crowd motion telemetry over an encrypted MQTT connection. AWS IoT Core catches the incoming sensor data streams and automatically routes them to Amazon Kinesis Firehose. There the incoming stream data is batched, compressed, and dumped as immutable raw logs into an Amazon S3 Backup bucket for Disaster Recovery Planning (DRP). Kinesis also triggers a serverless AWS Lambda function (MySQL writer) that unpacks and process the streaming payload records. The Lambda function fetches the required database credentials programmatically from AWS Secrets Manager and writes the processed data directly into a MySQL/MariaDB database isolated inside a secure Private Subnet. For administrators needing to query the isolated database locally, an encrypted tunnel is established using AWS Systems Manager Session Manager through a secured EC2 Bastion Host. This allows safe connection to external SQL Client without opening any public internet ports.</p>
<p><strong>The Migration Workflow:</strong></p>
<p>Below I show how second half of the architecture connects to the first half. I perform migration in the second half</p>
<img src="https://cdn.hashnode.com/uploads/covers/69e93b8bd5f8830e7da2feef/23c3085d-e495-41d4-9b99-fd57b1e04a64.png" alt="" style="display:block;margin:0 auto" />

<p>Services used here are AWS Glue, AWS SCT, AWS DMS, AWS Timestream, AWS S3, AWS Secrets Manager, AWS RDS, AWS Athena, Aurora Postgres, QuickSight, AWS SSM, Apache Spark. AWS DMS (Database Migration Service) can handle both homogeneous migration (MySQL to MySQL RDS) and heterogeneous migration (MySQL to Aurora Postgres) using the AWS SCT (Schema Conversion Tool). It securely reads the row-based transaction logs from the on-premise simulation and streams real-time database updates over to a managed cloud target (AWS RDS MySQL) while concurrently logging raw data straight into an Amazon S3 Raw bucket. A serverless AWS Glue Apache Spark compute engine reads those raw data dumps out of the S3 landing zone and runs distributed, in-memory ETL transformation jobs to clean, structure, and partition the files. The Glue pipeline bifurcates the transformed outputs by writing optimized columnar files into an Amazon S3 Enriched bucket for historical analytics and pushing active metric rows into AWS Timestream for time-series event monitoring. AWS Athena sits right on top of the flat storage lake as a serverless query engine, dynamically spinning up on-demand processing nodes to calculate standard SQL requests directly across the files sitting inside the S3 Enriched bucket. An interactive Amazon QuickSight BI Reports dashboard sits at the end of the line, connecting natively to AWS Athena to pull the calculated datasets and render visual analytical insights for business users.</p>
<p><strong>Challenges</strong></p>
<p>Database Strain During Traffic Spikes:</p>
<p>When simulation traffic spiked, my Lambda function tried to write data into the MySQL database row-by-row. This quickly flooded the database connection pool and slowed down performance. I document this in the code and map the production fix.</p>
<p>Synchronizing AWS DMS Configuration:</p>
<p>Getting the live cloud migration tool (AWS DMS) to read changes from my active database without locking tables or interrupting traffic was a major configuration puzzle. Through trial and error, I found the exact database logging parameters needed.<br />Find the finalized setup in 14_DMS_Data_migration_and_CDC_commands.txt file, for row-based binary logging (binlog_format=ROW) that keeps the data streaming smoothly without any downtime.</p>
<p>Cloud Expense</p>
<p>Traditional EC2 instances and database servers running 24/7 during our initial environment testing drained cloud credits incredibly fast. To fix this, I shifted the data analytics layer to serverless tools (AWS Athena and Kinesis Firehose). This dropped our idle infrastructure costs to zero because project only paid for the exact data it processed.</p>
<p>Strategic Trade off</p>
<p>I trade off sub-millisecond query speeds over AWS Athena to scan flat files directly inside Amazon S3. Because of this architectural choice, my ad-hoc SQL queries take a second or two longer to run. This trade-off reduced cloud infrastructure cost by 70%</p>
<p>To discuss more reach out me on LinkedIn here: <a href="https://www.linkedin.com/in/pratik-dhande/"><strong>https://www.linkedin.com/in/pratik-dhande/</strong></a></p>
<p>My Github: <a href="https://github.com/pratik585/iot-data-migration-lakehouse-aws.git"><strong>https://github.com/pratik585/iot-data-migration-lakehouse-aws.git</strong></a></p>
]]></content:encoded></item><item><title><![CDATA[Water Quality Data Pipeline with Azure Medallion Architecture]]></title><description><![CDATA[Government organizations monitor water bodies. They check concentration levels of various substances by sensors. Their is to check if the water is safe.
Here, I create a unified system for all authori]]></description><link>https://pratikdhande.hashnode.dev/water-quality-data-pipeline-with-azure-medallion-architecture</link><guid isPermaLink="true">https://pratikdhande.hashnode.dev/water-quality-data-pipeline-with-azure-medallion-architecture</guid><dc:creator><![CDATA[pratikdhande]]></dc:creator><pubDate>Thu, 23 Apr 2026 02:44:24 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/69e93b8bd5f8830e7da2feef/dc87ba60-d6ca-4816-b3e2-5cbeb5c1f29d.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Government organizations monitor water bodies. They check concentration levels of various substances by sensors. Their is to check if the water is safe.</p>
<p>Here, I create a unified system for all authorities to address water issues effectively. This make collaboration easier and decision making faster and smoother.</p>
<p>Here I created a synthetic water sensor dataset using AWS IoT core. The sensors are supposed to be spread across European countries. Sensors are programmed to behave like recording water quality data in real time. This makes strong and stable framework very necessary. The data comes from many different time zones and countries. It covers various type of water bodies and plants. Such data becomes vital when climates and habitats change.</p>
<p>I used #Microsoft-Azure services. Azure Synapse Analytics is very effective for solving BI problems. It works smooth with Power BI and helps get real-time insights from data. Real-time dashboards are now a standard in the data world.</p>
<p>Raw data starts in MS Excel sheet. The data is moved to an Azure Managed SQL Database using SQL Server Management Studio. The data is moved again to Azure Blob Storage using Azure Logic Apps. I performed batch processing. But we can wire the Logic apps to wait for new changes and only move the new changes forward. Data is stored as JSON objects in the blob storage. Blob storage acts as an intermediate staging area before data is moved down to Azure Data lake Gen2 from final processing. Blob also works as a backup of the raw data in its original extracted state and it can connect to various kind of products to feed the backup data in case of systems failures.</p>
<p>We use Azure Data Factory for moving this huge amount of data from Blob storage to ADLG2. I used a 'copy pipeline' for this task. Once the data reached in Azure Data Lake Gen2, it is ready for use with Azure Databricks.</p>
<p>Further, the data is transformed using Azure Databricks following a Medallion Architecture. This architecture has standard three layers - Bronze, Silver and Gold or data processing. This architecture is very friend for auditing tasks.</p>
<p>Bronze Layer: Raw data is pulled into a Spark data frame<br />Silver layer: The data is cleaned and refined for quality<br />Gold Layer: Final processing happens, and data is stored in a table</p>
<p>Data from Gold Layer goes to Power BI and is used to create dashboards. It allows detailed analysis of water quality data</p>
<img src="https://cdn.hashnode.com/uploads/covers/69e93b8bd5f8830e7da2feef/631cbc55-dd5f-4b08-96a3-36a22e1dd9f6.jpg" alt="Architecture Diagram" style="display:block;margin:0 auto" />

<p>The following columns represent the level of detail or drill-down of parameters at which water readings were taken by the sensors:</p>
<p><strong>View Full Dataset Schema (31 Columns)</strong></p>
<table>
<thead>
<tr>
<th>Category</th>
<th>Column Names</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Identifiers</strong></td>
<td><code>countryCode</code> , <code>monitoringSiteIdentifier</code> , <code>monitoringSiteIdentifierScheme</code> , <code>UID</code></td>
</tr>
<tr>
<td><strong>Environmental</strong></td>
<td><code>parameterWaterBodyCategory</code> , <code>observedPropertyDeterminandCode</code> , <code>observedPropertyDeterminandLabel</code> , <code>procedureAnalysedMatrix</code> , <code>parameterSampleDepth</code></td>
</tr>
<tr>
<td><strong>Metrics</strong></td>
<td><code>resultMeanValue</code> , <code>resultMinimumValue</code> , <code>resultMaximumValue</code> , <code>resultMedianValue</code> , <code>resultStandardDeviationValue</code> , <code>resultUom</code></td>
</tr>
<tr>
<td><strong>Metadata</strong></td>
<td><code>metadata_versionId</code>, <code>metadata_statusCode</code></td>
</tr>
<tr>
<td><strong>Time and Periods</strong></td>
<td><code>phenomenonTimeReferenceYear</code> , <code>parameterSamplingPeriod</code> , <code>metadata_beginLifeSpanVersion</code></td>
</tr>
<tr>
<td><strong>Quality &amp; Thresholds</strong></td>
<td><code>procedureLOQValue</code> , <code>resultNumberOfSamples</code> , <code>resultQualityNumberOfSamplesBelowLOQ</code> , <code>resultQualityMinimumBelowLOQ</code> , <code>resultQualityMeanBelowLOQ</code> , <code>resultQualityMaximumBelowLOQ</code> , <code>resultQualityMedianBelowLOQ</code></td>
</tr>
<tr>
<td><strong>Methodology &amp; Status</strong></td>
<td><code>procedureAnalyticalMethod</code> , <code>resultObservationStatus</code> , <code>remarks</code> , <code>metadata_status_Code</code> , <code>metadata_observationStatus</code> , <code>metadata_versionId</code></td>
</tr>
</tbody></table>
<h2>Final Analytics</h2>
<p>The Ultimate goal of this Medallion Architecture is to transform millions of raw sensor records into a high-performance dashboard. By connecting the <strong>Azure Databricks Gold Layer</strong> to <strong>Power BI</strong> , I developed a comprehensive visualization suite to monitor water safety across 39 countries.</p>
<p>Following image shows dashboard that displays Key Environmental Health and Safety Metrics:</p>
<img src="https://cdn.hashnode.com/uploads/covers/69e93b8bd5f8830e7da2feef/beaf392b-d567-4ea4-b92c-90caa5cb8588.png" alt="" style="display:block;margin:0 auto" />

<p>This view focuses on the "Safety Levels" and deterministic trends of water quality.</p>
<p><strong>Water Quality Index (WQI):</strong> Using custom DAX logic, I calculated a normalized safety level (WQI) by country, providing a clear benchmark against safety thresholds<br /><strong>Temporal Analysis:</strong> The "Determinant level across years" chart tracks historical trends, allowing authorities to identify long-term improvements or degradations in water quality<br /><strong>Concentration Treemaps:</strong> A visual breakdown of concentration levels by determinant (e.g., Dissolved Oxygen, BOD5, Nitrates) helps quickly pinpoint which chemical factors are most prevalent in a specific region</p>
<p>Following image shows a filter page that serves as a deep-dive tool for the users</p>
<img src="https://cdn.hashnode.com/uploads/covers/69e93b8bd5f8830e7da2feef/c642bcb8-82e1-42a2-9fd5-e947cbe63c6a.png" alt="" style="display:block;margin:0 auto" />

<p><strong>Multi-Dimensional Filtering:</strong> The dashboard allows for granular filtering by <strong>Country</strong>, <strong>Determinand</strong>, and <strong>Water Body Category</strong> (e.g., Lake Water vs. Ground Water)<br /><strong>Determinand Distribution:</strong> Tabular reports show the exact distribution of parameters across different water bodies. This ensures safety measures can be tailored to the specific vegetation and habitat conditions of the region<br /><strong>Scale of Operations:</strong> The high-level KPIs highlight the scale of the dataset—managing nearly 600 unique determinands across thousands of monitoring sites</p>
<p>We load only the high quality essential data from the curated Gold Layer into Power BI. The dashboard maintains high performance even when interacting with large historical dataset. This ensures real time insights are available</p>
<p>You can find the complete implementation, Terraform scripts, and Databricks notebooks in my <a href="https://github.com/pratik585/azure-medallion-data-pipeline">Github</a></p>
<p>If you enjoyed this deep dive into Azure data engineering, feel free to connect with me on <a href="https://www.linkedin.com/in/pratik-dhande/"><strong>LinkedIn</strong></a> and we can discuss more!</p>
]]></content:encoded></item></channel></rss>