<?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 Syed Mehdi on Medium]]></title>
        <description><![CDATA[Stories by Syed Mehdi on Medium]]></description>
        <link>https://medium.com/@mohammadmehdi.cis?source=rss-e991a3b8c4da------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6FWOjl534dH3R07_4pRHww.png</url>
            <title>Stories by Syed Mehdi on Medium</title>
            <link>https://medium.com/@mohammadmehdi.cis?source=rss-e991a3b8c4da------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 20:19:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mohammadmehdi.cis/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[Understanding Parquet format and its optimizations]]></title>
            <link>https://medium.com/@mohammadmehdi.cis/understanding-parquet-format-and-its-optimizations-1c6143b9a65a?source=rss-e991a3b8c4da------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c6143b9a65a</guid>
            <dc:creator><![CDATA[Syed Mehdi]]></dc:creator>
            <pubDate>Sun, 11 May 2025 22:34:12 GMT</pubDate>
            <atom:updated>2025-05-11T22:50:17.219Z</atom:updated>
            <content:encoded><![CDATA[<p>As data-intensive applications continue to scale, efficient storage and fast retrieval become critical in analytics pipelines. Apache Parquet is one of the storage formats designed for systems that process large-scale datasets and is open source. Unlike traditional row-based formats, Parquet enables highly efficient compression and encoding, minimizing I/O and boosting query performance. This article dives into the internals of the Parquet format, explores its encoding and compression strategies and discusses best practices for leveraging its optimizations in real-world data workflows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W_6jFC-tf-CikhcxRmgQcg.png" /></figure><h3>How is Parquet different from traditional Row based formats?</h3><p>Parquet differs from traditional row-based formats like CSV or JSON by storing data column-wise rather than row-wise. This design enables Parquet to read only the necessary columns for a query, significantly reducing disk I/O and improving performance for analytical workloads. It also allows for more efficient compression and encoding, since each column contains uniform data types.</p><p>Here is the pictorial representation of column-wise vs row-wise formats,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eT3K2tFTbBO8yozqXNkL-Q.png" /></figure><p>It is worth noting that column-wise storage is most efficient when a user wants to access a small subset of columns from a large table because the data is read from relevant storage blocks resulting in less I/O calls. However, when the number of columns that needs to be fetched increases, the column-wise storage becomes less efficient because now the data is read from many storage blocks scattered in different locations resulting in increased I/O calls.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gnf3D-rEQh25CFr2hlXcDQ.png" /></figure><p>To counter this, Parquet came up with the hybrid approach containing the strengths of both row-wise and column-wise formats. Let&#39;s dive into it.</p><h3>Parquet’s hybrid approach</h3><p>Parquet is a columnar format by design, but internally, it uses a hybrid approach to optimize performance by grouping data into row groups, column chunks and pages. This layout allows efficient reading of specific columns (columnar benefits), while also keeping data for rows grouped together in manageable chunks (row-wise locality within groups).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ko2Qnv9DICiV_y-F1DYr1Q.png" /></figure><h4><strong>Row group</strong></h4><ul><li>A row group is a horizontal partitioning of the data</li><li>Each row group contains all the columns for a subset of the rows</li><li>Row groups are stored contiguously on disk to allow reading a subset of rows without scanning the entire file</li></ul><h4><strong>Column chunk:</strong></h4><ul><li>A column chunk contains the data for a single column within a row group</li><li>All column chunks of a row group are stored one after another</li><li>Column chunks also store metadata like number of values, compression, and encoding</li></ul><h4><strong>Pages:</strong></h4><ul><li>Column chunk is further divided into pages which contains encoded data values with page specific metadata</li></ul><h4><strong>Parquet file footer:</strong></h4><ul><li>Parquet footer contains all the metadata necessary to understand and read the data without scanning the entire file. It’s located at the end of the file.</li><li>It contains file metadata like schema definition, row group metadata like number of rows, their min/max and column chunk metadata containing total number of values, Statistics (min, max, null count, distinct count) etc.</li></ul><h3><strong>Benefits of hybrid format</strong></h3><ul><li>Less I/O calls even if user wants to fetch multiple columns from a table because of grouping of entire rows into row groups</li><li>Since each row group is independent, multiple row groups can be read or processed at the same time ensuring Parallelism &amp; Scalability</li><li>Row group-level statistics (min, max, null count) are stored in the footer that allows skipping entire row groups during query execution if the data doesn’t match filters</li></ul><h3>Optimizations</h3><p>Optimizing Parquet files can lead to substantial improvements in query performance, storage efficiency and overall cost reduction, particularly in large-scale data processing systems. These enhancements can be achieved by taking into account several key factors, the most critical of which are outlined below.</p><h4>Encoding</h4><p>There are multiple encoding techniques used in Parquet format at page level to reduce data size which results in less storage used and decreased cost. One technique which we can influence easily is:</p><p><strong>Run Length Encoding</strong></p><p>This encoding compresses sequences of repeated values and stores the value and how many times it repeats</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aEVi7NiAmfx0iknoQ-DAsQ.png" /></figure><p>We can leverage the efficiency of this encoding technique by,</p><ul><li>Sorting data from small cardinality columns to bigger cardinality columns which helps in bring identical values together, making them compressible</li></ul><p>This encoding is beneficial when we have a lot of repeated values in columns.</p><h4>File size &amp; partitioning</h4><p>To achieve optimized read performance, it is essential to consider the following key factors:</p><ul><li>Partition by frequently queried columns with low cardinality</li><li>Avoid many small files as for each file we will have to set up internal data structures, instantiate reader objects, fetch file and parse Parquet metadata which increases a lot of overhead. This test was performed by Databricks team having 1024 files vs 16 files for 10GB data</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*TpO2AMdj1k9db9PEyDSJKA.png" /></figure><ul><li>Avoid one big file as the parquet footer also becomes huge having large number of row groups and column chunks meta data which takes more time in processing as footer processing is not optimized for speed. This test was also performed by Databricks team in which they stored a 250GB dataset in 250 partitions (1GB per file) and on the other hand stored everything in a single file</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*_M-A39rDO5VcVGNqZ4KY6w.png" /></figure><ul><li>Sweet spot is to create few large files per partition. Here, the key is efficient partitioning</li></ul><h4>More optimization techniques</h4><ul><li>Use INT, FLOAT, BOOLEAN instead of STRING when possible and avoid storing timestamps as strings</li><li>Use Compression Wisely. Snappy (default) for a good balance between speed and compression, ZSTD for better compression at a slightly higher CPU cost and avoid GZIP for frequently queried data due to slow decompression</li></ul><h3><strong>Conclusion</strong></h3><p>After understanding the internal structure of the Parquet format, its row groups, column chunks, pages and metadata, it’s clear how Parquet achieves efficient, scalable, and analytics-friendly storage. By leveraging optimizations like Run-length encoding, compression, sorting and intelligent partitioning, one can significantly reduce storage costs and accelerate query performance. Whether you’re working with traditional warehouses or a modern data lake engine, applying these best practices transforms Parquet from a passive storage format into an active performance enabler in your data pipeline.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c6143b9a65a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Choosing Between Database, Data Warehouse, Data Lake and Data Lakehouse: Understanding the…]]></title>
            <link>https://medium.com/@mohammadmehdi.cis/choosing-between-database-data-warehouse-data-lake-and-data-lakehouse-understanding-the-f9a786e04878?source=rss-e991a3b8c4da------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9a786e04878</guid>
            <dc:creator><![CDATA[Syed Mehdi]]></dc:creator>
            <pubDate>Sun, 04 May 2025 18:11:29 GMT</pubDate>
            <atom:updated>2025-05-04T19:21:10.325Z</atom:updated>
            <content:encoded><![CDATA[<h3>Choosing Between Database, Data Warehouse, Data Lake and Data Lakehouse: Understanding the Differences</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BOddQpKPCLx460L6.jpg" /></figure><p>In today’s data-driven world, organizations are flooded with information from countless sources like transactional systems, IoT devices, social media and more. To harness the power of this data, it’s crucial to store, manage, and analyze it effectively. This is where terms like <strong>database</strong>, <strong>data warehouse</strong>, <strong>data lake</strong> and the emerging <strong>data lakehouse</strong> come into play. Understanding their differences is essential for choosing the right architecture for your data strategy. In this article, we’ll break down what each of these technologies means and when to use which.</p><p>But before looking into each data technology and finding out their specific strengths, let’s take a step back and understand the difference between <strong>OLTP</strong> and <strong>OLAP</strong> data system designs as most data technologies fall into one of these two.</p><h3><strong>OLTP (Online Transaction Processing):</strong></h3><ul><li>OLTP systems are mainly designed to handle frequent database transactions eg. CRUD (Create, Read, Update, Delete) operations</li><li>These systems are row-oriented, meaning all the values of a single record (row) are stored together on disk, which makes CRUD operations efficient for individual rows</li><li>These systems keep data integrity intact using ACID (Atomicity, Consistency, Isolation, Durability) compliance and also maintains speed &amp; accuracy</li><li>The data in these systems is highly normalized often following 3NF (3rd Normalization Form) or higher avoiding data redundancy and simplifying data updates</li></ul><p>Examples: Traditional relational databases like MySQL, PostgreSQL, Oracle or NoSql databases like MongoDB etc.</p><h3><strong>OLAP (Online Analytical Processing):</strong></h3><ul><li>OLAP systems are designed to handle complex data analysis and reporting over large volume of data</li><li>These systems are column oriented meaning values for the same column across many rows are stored together on disk</li><li>These systems are more focused on making analytical queries run faster like aggregations, window functions, Pivoting &amp; Unpivoting queries etc.</li><li>The data stored in these systems is often denormalized following Star or Snowflake schema and is loaded typically in batches (e.g. hourly or daily)</li></ul><p>Examples: Data warehouses like Snowflake, Amazon Redshift, Google BigQuery etc.</p><figure><img alt="OLAP vs OLTP" src="https://cdn-images-1.medium.com/max/1024/0*zzSM7qnYkKPasD8y.png" /></figure><p>Now that we have a basic understanding of OLTP and OLAP systems, it’s clear that business needs play a significant role in determining which data technologies to choose. Let’s dive deeper into each of these technologies to explore their unique purposes and use cases.</p><h3><strong>DATABASE</strong>:</h3><ul><li>A database is generally geared for frequent transactions i.e. CRUD operations</li><li>Classic databases are relational as well as Row oriented systems</li><li>Row wise data stored on disk makes CRUD operations more efficient as single record (row) data is stored together and can be read or updated without searching data in multiple locations</li><li>Data present in databases is usually highly normalized that ensures reduced data redundancy and improved data integrity</li></ul><p>Use cases:</p><ul><li>Online applications like Instagram where users are frequently interacting with the app and updating their information</li><li>Desktop applications like inventory management system where users are frequently updating their inventory</li></ul><p>Examples: MySQL, PostgreSQL, Oracle, MongoDB etc.</p><figure><img alt="Row oriented data storage illustration" src="https://cdn-images-1.medium.com/max/1024/1*oePWnzfkr-XHX_lBpIHEXQ.png" /></figure><h3><strong>DATA WAREHOUSE:</strong></h3><ul><li>A data warehouse is a centralized system designed specifically for storing and analyzing large volumes of structured data coming from various data sources</li><li>Classic data warehouses are column oriented which means the data is stored in columns instead of rows and are efficient for analytical queries where you have to read data from multiple rows instead of just one row</li><li>The data belonging to different sources can be integrated together in a warehouse to take important business decisions based on multi-dimensional analysis</li><li>Historical information can be tracked using different techniques like Slowly Changing Dimensions,<strong> </strong>Time-Partitioned Tables / Snapshots etc</li></ul><p>Use cases:</p><ul><li>Data analytics &amp; reporting for business</li></ul><p>Examples: Snowflake, Amazon Redshift, Google BigQuery, Azure Synapse Analytics etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k6_qt7GSNLNHwdeXSYYjWA.png" /></figure><h3><strong>DATA LAKE:</strong></h3><ul><li>A Data Lake is a centralized repository that allows you to store all your structured, semi-structured, and unstructured data in its raw format in form of files</li><li>Unlike data warehouses, which require predefined schemas, a data lake embraces <strong>schema-on-read</strong>, meaning data is stored as-is and structured only when read hence providing flexibility</li><li>It is built to process large amount of data at lower costs as compare to data warehouse</li><li>It supports all formats of data like CSV, JSON, XML, Avro, Parquet etc</li><li>Data is usually stored in folder structure where parent folder represents the table name, internal folder represents the partitions like year/month/day and then files</li></ul><p>Use cases:</p><ul><li>Provides AI/ML models the raw data for training purposes including unstructured data (images, audio, text)</li><li>Technical users can get quick information from this data without moving it into a data warehouse</li></ul><p>Examples: Amazon S3, Azure Data Lake Storage, Google Cloud Storage etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A1ZQSgwwShwZh90G2N3Y4A.png" /></figure><h3><strong>DATA LAKEHOUSE:</strong></h3><ul><li>A Data Lakehouse is a modern data architecture that combines the low-cost, flexible storage of a data lake with the performance and management features of a data warehouse</li><li>It provides flexibility of a data lake (handles any type of data) with the structure and performance of a data warehouse (fast queries, ACID compliance)</li><li>Eliminates the need to maintain two separate platforms i.e. data warehouse and data lake and complex ETL pipelines between them</li><li>Reduces data duplication and storage overhead</li><li>Unify Analytics and AI/ML Workflows</li></ul><p>Use cases:</p><ul><li>Data analytics &amp; reporting for business</li><li>AI/ML models can utilize the raw data present in the same platform</li></ul><p>Examples: Databricks etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ys9pRgDC2zuCkKXB7leLhA.png" /></figure><h3>CONCLUSION:</h3><p>Choosing the right storage and processing architecture whether it’s a traditional database, a data warehouse, a data lake, or a modern data lakehouse depends entirely on your specific needs and goals. After going through the basic differences, we can finally conclude that,</p><ul><li>Databases are best for transactional apps</li><li>Data Warehouses are Ideal for structured reporting and BI dashboards</li><li>Data Lakes are Great for storing raw, massive, and varied data types</li><li>Data Lakehouses provides Combine strengths of lakes and warehouses for unified analytics and ML use cases</li></ul><p>In modern day data architecture these technologies often work together each serving a distinct purpose which allows organizations to optimize performance, cost, flexibility and analytics capabilities. This topic will be discussed further in future articles.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9a786e04878" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>