<?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 Javad Hosseini on Medium]]></title>
        <description><![CDATA[Stories by Javad Hosseini on Medium]]></description>
        <link>https://medium.com/@jeyhosseini?source=rss-2690ab43a609------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-QFvCGUIbN_9z5_tzsWh5w.jpeg</url>
            <title>Stories by Javad Hosseini on Medium</title>
            <link>https://medium.com/@jeyhosseini?source=rss-2690ab43a609------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 05:15:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jeyhosseini/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[Openstack Networking Service]]></title>
            <link>https://jeyhosseini.medium.com/openstack-networking-service-6d1201185f5d?source=rss-2690ab43a609------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d1201185f5d</guid>
            <category><![CDATA[network-virtualization]]></category>
            <category><![CDATA[neutron]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[private-cloud]]></category>
            <category><![CDATA[openstack]]></category>
            <dc:creator><![CDATA[Javad Hosseini]]></dc:creator>
            <pubDate>Fri, 20 Dec 2024 16:44:41 GMT</pubDate>
            <atom:updated>2025-01-03T13:31:01.991Z</atom:updated>
            <content:encoded><![CDATA[<h4>About Neutron, Open vSwitch and some other stuff | Part 1</h4><h4>Content</h4><ul><li>Part 1: Basics</li><li>part 2: OpenFlow Protocol and Open vSwitch</li><li>Part 3: Solving the puzzle</li></ul><h3>Basic Network Concepts</h3><p>I assume that you already know the basics, but I quickly review some of the basic network concepts we’ll need.</p><h4>Switching &amp; Bridges</h4><p>Switching in networking refers to the process of forwarding data packets between devices on the same network or subnet. Switches operate at the data link layer (Layer 2) and use MAC addresses to determine the correct path for data packets.</p><p>A network bridge is a virtual (there are physical devices which are used rarely now) network device that forwards packets between two or more network segments. A bridge behaves like a virtual network switch and works transparently. Other machines in the network do not need to know about its existence. Physical network devices (e.g. eth0) and virtual network devices (e.g. tap1) can be connected to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*eGrHQq2vQD4kNowRn0YsXg.png" /><figcaption>Switch &amp; bridge</figcaption></figure><p>In this enlightening image, there are multiple concepts that you should be aware of!</p><p><strong>netns:</strong> Linux Network Namespace, used for creating isolated virtual network at OS level. Each network namespace has its own interfaces, routing tables, forwarding rules, etc. ِYou should create one for better understanding! :)</p><p><strong>tap (VM):</strong> are virtual Ethernet devices that emulate physical Ethernet adapters. They are primarily used to connect virtual machines or applications to the host’s network stack as if they had their own network card. TAP interfaces are designed to interact with Ethernet frames directly, allowing them to behave like a physical NIC.</p><p><strong>veth (netns):</strong> <strong>Veth</strong> pairs, on the other hand, are point-to-point links used to connect network namespaces, typically for isolated environments like containers. Unlike TAP, which behaves as a standalone network interface, veth pairs work as a “virtual cable” between two endpoints (one in each namespace), which allows communication between isolated network environments.</p><p><strong>br0:</strong> “Linux Bridge” that in this case connects virtual interfaces to the physical Ethernet</p><p><strong>eth0: </strong>Physical (NIC) or Virtual (vNIC) Ethernet</p><h4>VLANs (Virtual Local Area Networks)</h4><p><strong>VLANs</strong> are a method for creating logically isolated networks within a switch-based network. Each VLAN behaves like a separate physical network, even though the devices might be connected to the same physical switch. VLANs can be created to divide network traffic based on <strong>functionality, project teams, or security groups</strong>, reducing broadcast traffic and enhancing network security. VLANs are crucial for Openstack private network isolation and segmentation. There are 2 types of VLANs out there.</p><ul><li><strong>Tagged:</strong> The IEEE 802.1Q standard is used to tag Ethernet frames, allowing VLANs to span multiple switches.</li><li><strong>Port-Based: </strong>There is no extra information added to the Ethernet frame on the same VLAN communications. Instead, each port on the switch is defined as belonging to a specific VLAN.</li></ul><p><strong>Trunk Ports: </strong>Multiple tagged VLANs can use the same port on a switch, called a <strong>trunk port</strong>. a <strong>trunk port</strong> is a switch port that is configured to carry traffic for multiple VLANs (it’s not configured for port-based VLANs).</p><p><strong>Access ports:</strong> Switch ports that are configured to carry network traffic for a specific VLAN only.</p><p>*Trunk ports carry <strong>tagged VLANs</strong>, while access ports carry <strong>untagged VLANs</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/1*9YjF4Ofxxk8Z6mBmGQ5hiA.jpeg" /><figcaption>Trunk Ports and Access Ports</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/422/0*aMdTAbTW6LND967d" /><figcaption>Traditional Ethernet data frame vs VLAN data frame</figcaption></figure><h4><strong>Routing</strong></h4><blockquote>Routing is the process of path selection in any network. A computer network is made of many machines, called <em>nodes</em>, and paths or links that connect those nodes. Communication between two nodes in an interconnected network can take place through many different paths. Routing is the process of selecting the best path using some predetermined rules.</blockquote><blockquote>A router is a piece of network hardware responsible for forwarding packets to their destinations. Routers connect to two or more IP networks or subnetworks and pass data packets between them as needed.</blockquote><blockquote>When a data packet arrives, the router first looks up its address in a routing table. This is similar to a passenger consulting a bus timetable to find the best bus route to their destination. Then the router forwards or moves the packet onward to the next point in the network. — AWS</blockquote><p>There are several types of routing, which these are the three main types of routing widely used in networks.</p><ul><li><strong>Static Routing:</strong> Routes are manually configured by network administrators and don’t change unless manually updated. Static routing is simple and reliable but not scalable for large or frequently changing networks.</li><li><strong>Dynamic Routing: </strong>Uses routing protocols to automatically discover and adapt routes in real time. Routers share information, and routes are updated dynamically based on network topology changes. Examples: OSPF, BGP, RIP.</li><li><strong>Default Routing: </strong>Sets a single default path for traffic when no specific route is found. Commonly used on devices at the edge of a network, directing unknown traffic to a gateway or next-hop router.</li></ul><p>To check the current routing table, in Linux or Mac, use: ip route show. Also to set up a default route use: sudo ip route add default via &lt;gateway_IP&gt; dev &lt;interface_name&gt;.</p><h4>Network Address Translation (NAT)</h4><p>The idea of NAT is to allow multiple devices with private IP to access the Internet through a single public address. To achieve this, a private IP address must be translated into a public IP address.</p><blockquote>NAT is a technique commonly used by internet service providers (ISPs) and organizations to enable multiple devices to share a single public IP address. By using NAT, devices on a private network can communicate with devices on a public network without the need for each device to have its own unique IP address. — Fortinet</blockquote><h4>Port Address Translation (PAT)</h4><blockquote>PAT, also known as port address translation, is an extension of network address translation (NAT). It allows a <strong>single public IP</strong> address to be used by multiple devices within a private network. This is accomplished by assigning each device a unique port number and routing incoming traffic accordingly. — orhanergun.net</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rs3iX742-Vbst19z.png" /></figure><h4><strong>VXLAN and Tunneling</strong></h4><blockquote>A virtual extensible LAN (VXLAN) is a networking protocol that tunnels layer-2 traffic over an IP network using the UDP protocol. For example, certain virtual machines (VMs), that are running on different hosts can communicate over a VXLAN tunnel. The hosts can be in different subnets or even in different data centers around the world. From the perspective of the VMs, other VMs in the same VXLAN are within the same layer-2 domain. — RedHat (strongly recommend to read <a href="https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/configuring_and_managing_networking/assembly_using-a-vxlan-to-create-a-virtual-layer-2-domain-for-vms_configuring-and-managing-networking#proc_creating-a-virtual-network-in-libvirt-with-an-existing-bridge_assembly_using-a-vxlan-to-create-a-virtual-layer-2-domain-for-vms"><strong>this</strong></a>!)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0OfKBILIN1CSXMyz.png" /></figure><p>*vnet is a TAP interface.</p><blockquote>Because VXLANs are encapsulated inside a UDP packet, they can run on any network able to transmit UDP packets. The physical layout and geographic distance between nodes of the underlying network don’t matter, as long as the UDP datagrams are forwarded from the encapsulating VXLAN Tunnel Endpoint (VTEP) to the decapsulating VTEP.</blockquote><blockquote>The entity that performs the encapsulation and decapsulation of packets is called the VXLAN Tunnel Endpoint (VTEP). A VTEP can be an independent network device, such as a physical router or switch, or a virtual switch deployed on a server. VTEPs encapsulate Ethernet frames into VXLAN packets, which are then sent to the destination VTEP over an IP or other Layer 3 network, where they’re decapsulated and forwarded to the destination server. — juniper.net</blockquote><p>*<strong>Open vSwitches</strong> can act as a VTEP.</p><p><strong>VXLAN </strong>is widely used in modern networking for creating scalable, flexible, and isolated virtual network overlays.</p><p>Traditional VLANs are limited to 4,094 unique IDs (due to the 12-bit VLAN ID). This restricts the number of isolated networks in large-scale environments. VXLAN uses a 24-bit <strong>VXLAN Network Identifier (VNI)</strong>, allowing up to 16 million isolated virtual networks, significantly increasing scalability for large datacenters.</p><h4>DHCP</h4><blockquote>Dynamic Host Configuration Protocol (DHCP) is a client/server protocol that automatically provides an Internet Protocol (IP) host with its IP address and other related configuration information such as the subnet mask and default gateway. DHCP allows hosts to obtain required TCP/IP configuration information from a DHCP server. — Microsoft</blockquote><h4>Security Groups</h4><p>Security groups are a fundamental security feature in many cloud environments (e.g., OpenStack, AWS, Azure) used to control inbound and outbound network traffic to and from virtual resources like virtual machines (VMs), containers, or instances. They function as <strong>virtual firewalls</strong>, enforcing network access control at the <strong>instance level</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WZTBoQizTFPTPnHs.png" /><figcaption>AWS Security Groups</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d1201185f5d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lakehouse in a nutshell.]]></title>
            <link>https://towardsdev.com/lakehouse-in-nutshell-1db9514c2caf?source=rss-2690ab43a609------2</link>
            <guid isPermaLink="false">https://medium.com/p/1db9514c2caf</guid>
            <category><![CDATA[data-architecture]]></category>
            <category><![CDATA[data-lake]]></category>
            <category><![CDATA[data-warehouse]]></category>
            <category><![CDATA[data-lakehouse]]></category>
            <category><![CDATA[modern-data-platform]]></category>
            <dc:creator><![CDATA[Javad Hosseini]]></dc:creator>
            <pubDate>Thu, 04 Jan 2024 09:37:53 GMT</pubDate>
            <atom:updated>2024-01-05T18:25:29.854Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>How we did it</strong></h4><ul><li>Intro</li><li>Why Lakehouse</li><li>Building Blocks</li><li>Conclusion</li></ul><h3><strong>Intro</strong></h3><p>In today’s data-driven world, organizations are generating and collecting vast amounts of data from various sources. Whether it’s customer interactions or transactional data, this information holds immense potential for insights that can drive business growth and innovation. To achieve this goal, companies have traditionally relied on two distinct data storage and processing paradigms: data lakes and data warehouses. Data lakes are powerful in storing raw and unstructured data in low-cost storage, while data warehouses are good choice for business intelligence and analytics derived from structured data. However, the gap between these two worlds has often posed challenges for organizations. Data lakes can become data swamps, making it difficult to derive meaningful insights, while data warehouses struggle to accommodate the ever-expanding volume and variety of data. This is where Lakehouse comes to rescue offering best of both in a unified architecture.</p><h3>Why Lakehouse</h3><p>First we mention some of key characteristic and limitations of data lake and data warehouse, and then we go through lakehouse.</p><p><strong>Data lake</strong> is a repository for storing structured/unstructured raw data in a low-cost storage without having to structure data before storing. The main characteristic of data lakes are:</p><ul><li>data lake can store massive amounts of data</li><li>data can be in different types, including structured, semi-structured, and unstructured</li><li>data from different sources can be stored in data lake</li><li>data lake can act as the “single source of truth” for gaining insights from data and act as a unified data storage</li><li>Offers cost-effective scalability and flexibility</li><li>Suitable for AI/ML use cases</li></ul><p>However data lakes have some limitations in nature, like data quality issue, complexity for end-users to use data, data security issue, etc. <a href="https://medium.com/@gauravthalpati/5-key-limitations-of-data-lakes-dc74f545a33a">Here</a> is a good article about limitation of data lakes.</p><blockquote>A <strong>data warehouse</strong> is a data management system that stores current and historical data from multiple sources in a business friendly manner for easier insights and reporting. Data warehouses are typically used for business intelligence (BI), reporting and data analysis. — Databricks</blockquote><ul><li>Data warehouses are Subject-oriented</li><li>High quality and reliable data</li><li>High performance data analytics</li><li>Easy to access data for end-users</li></ul><p>Data warehouses also have some dark sides:</p><ul><li>Can only supports structured data</li><li>Not suitable for AI/ML use cases</li><li>High cost for infrastructure</li><li>Not easy to scale</li></ul><p>A data lakehouse is a relatively new and evolving data architecture that combines the features of a data lake and a data warehouse. It is designed to address some of the mentioned limitations of these traditional data storage and processing solutions. Some key characteristics of a data lakehouse are:</p><ul><li><strong>Unified Data Storage:</strong> Single source of truth for all analytics and insights, can store both raw data, like a data lake, and structured and prepared data, like a data warehouse.</li><li><strong>Schema Flexibility:</strong> support both schema-on-read and schema-on-write</li><li><strong>Scalability: </strong>can scale horizontally to keep up with the growing data volume</li><li><strong>Cost-Effective Storage</strong>: cost of storage are much lower compare with data warehouse</li><li><strong>Data Integration: </strong>Data lakehouse supports integration with various data processing and analytics tools</li><li><strong>Support for Diversed Data Types</strong></li><li><strong>multi-purpose: </strong>Data lakehouse are suitable for AI/ML uses cases and also BI analytics (we can have warehousing structure like star schema and snowflake on lakehouse!)</li></ul><p>Data lakehouse can also have some challenges like data quality management, metadata management, and performance optimization which can become a headache in some scenarios so it depends on the business data requirement and technology stack.</p><p>In the following we briefly describe building blocks of a data lakehouse architecture.</p><h3>Data lakehouse building blocks</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4u2Ap5bL5IdqTQzEspH-Sw.jpeg" /><figcaption><em>The multi-layered data lakehouse architecture- </em><a href="https://www.altexsoft.com/blog/data-lakehouse/">https://www.altexsoft.com/blog/data-lakehouse/</a></figcaption></figure><p>I will briefly describe each layer and component but If you are interested to know more details of each component, <a href="https://www.altexsoft.com/blog/data-lakehouse/"><strong>here</strong></a> is a good read.<br>For the sake of simplicity I prefer something more tangible. So here is a another point of view on data lakehouse architecture…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zEfOICqjDlG2KOVQ" /><figcaption><a href="https://www.dremio.com/resources/guides/what-is-a-data-lakehouse/">https://www.dremio.com/resources/guides/what-is-a-data-lakehouse/</a></figcaption></figure><p>I’ll also explain our implementation of lakehouse while we are going through each layer.</p><h4><strong>Sources</strong></h4><p>Where all of our data come from. It could be an external database, a messaging system, etc. Usually there are ETL jobs (or just an EL) in that layer for gathering data to the lake storage.</p><p>In our implementation, we have multiple python and spark jobs that collect data in batch and stream from external sources (like OLTP, APIs, Kafka and etc.) and store them on MinIO object storage. This Layer is essential for the rest of ecosystem to work properly. ETL Jobs must be on time and validity of the data must be ensured.</p><h4>File Formats</h4><p>At the “Source Layer” we did not talked about how to store data coming from external sources. There are multiple file formats out there that suits every data use cases. In our case most of our data are in Parquet or JSON format. If you need a row-based format with less needed space than JSON you can use Avro, which is supported in many tools in data ecosystem. But for the most of our analytic and ML use cases we stored data in Parquet (column-oriented) format. We utilize Minio cluster as our storage layer with the bunch of buckets.</p><h4>Open Table Formats</h4><p>The mentioned first two layers are the same in lake and lakehouse systems. But Table Formats makes a lake evolves as a lakehouse. Table formats bring structure to scattered raw data and help to query data easier. There are 4 main table formats: Apache Hive, Delta Table, Apache Hudi and Apache Iceberg. <a href="https://medium.com/geekculture/open-table-formats-delta-iceberg-hudi-732f682ec0bb"><strong>Here</strong></a> is a good read if you’re curious about details of each one.</p><p>In our lakehouse ecosystem we are using Apache Iceberg table format which is a great choice for analytics usage and tables with large volume. It also offers:</p><ul><li><a href="https://iceberg.apache.org/docs/latest/evolution/#schema-evolution"><strong>schema evolution</strong></a><strong>:</strong> Which you can evolve a table schema just like SQL with DDL queries.</li><li><a href="https://iceberg.apache.org/docs/latest/partitioning"><strong>Hidden partitioning</strong></a><strong>:</strong> Unlike hive tables end-user does not need to know the partition strategy to write high performance queries.</li><li><a href="https://iceberg.apache.org/docs/latest/evolution#partition-evolution"><strong>Partition layout evolution</strong></a><strong>: </strong>Table partitioning can be updated through the time, in that case there may be separated query planning for each query on data that have updated partitioning.</li><li><a href="https://iceberg.apache.org/docs/latest/spark-queries#time-travel"><strong>Time travel</strong></a><strong>: </strong>Each Apache Iceberg table maintains a versioned manifest of the objects that it contains. Previous versions of the manifest can be used for time travel and version travel queries.</li></ul><p>Apache Iceberg persist data in two layer, “Metadata Layer” and “Data Layer”. I’m not going through the details of Iceberg architecture, but there is a good article on this<strong> </strong><a href="https://medium.com/snowflake/understanding-iceberg-table-metadata-b1209fbcc7c3"><strong>here</strong></a>.</p><p>**We also have kind of an “<strong>abstract”</strong> extra layer for warehousing schemas, like Star schema, on top of this layer for the purpose of high performance BI analytics (It’s just some bunch of tables that are conceptually connected and forms Facts and Dimensions paradigm).</p><h4>Process Engine</h4><p>The “Table Format” is just a format for storing data and a process engine like Spark, Trino/Presto, StarRocks, Dremio or other solutions is needed for storing data in that table format and of course for using that data later!</p><p>In our architecture we are utilizing Apache Spark for loading data to Iceberg tables and in case of reading data in SQL manner we use Trino. We also using Python and Spark for analytics and ML and Metabase for dashboarding (through Sturburst Trino plugin for metabase)</p><h3>Conclusion</h3><p>In summary, the data lakehouse is like a superhero for managing a ton of data in today’s tech world. It solves the problems of data lakes and data warehouses by combining their best parts. Data lakes are great for storing lots of messy data, but they can get confusing, and data warehouses are good for organized data but have their own issues. The data lakehouse is like a middle ground, letting you store both messy and organized data in one place. It’s like having the best of both worlds! However, using it comes with some challenges, like making sure the data is good quality and works well, governance and security.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1db9514c2caf" width="1" height="1" alt=""><hr><p><a href="https://towardsdev.com/lakehouse-in-nutshell-1db9514c2caf">Lakehouse in a nutshell.</a> was originally published in <a href="https://towardsdev.com/">Towards Dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data warehouses: A Brief Comparison]]></title>
            <link>https://jeyhosseini.medium.com/data-warehouses-a-brief-comparison-282398f22b18?source=rss-2690ab43a609------2</link>
            <guid isPermaLink="false">https://medium.com/p/282398f22b18</guid>
            <category><![CDATA[data-warehouse-solutions]]></category>
            <category><![CDATA[starrocks]]></category>
            <category><![CDATA[apache-doris]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[data-warehouse]]></category>
            <dc:creator><![CDATA[Javad Hosseini]]></dc:creator>
            <pubDate>Sat, 27 May 2023 14:38:03 GMT</pubDate>
            <atom:updated>2023-07-06T18:45:36.896Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qIl2kVbboi8GLoix" /><figcaption>Photo by <a href="https://unsplash.com/@carmendis?utm_source=medium&amp;utm_medium=referral">Lance Chang</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Content</h3><ul><li>Why data warehouse?</li><li>Key Considerations</li><li>Selected candidates</li><li>Comparison</li><li>Choosing the right one</li></ul><h3>Why data warehouses</h3><p>We are in crypto business! So there are tons of data everywhere in different shape and size and what we want is to know our customers better, improve business processes and decision-making. The challenge we face lies in the vast volume and disparate nature of this data. We’re dealing with an different type of information, ranging from transactional data to varied sources of external data. Gathering up this data into a single, manageable repository is a task that a traditional transactional database in a production environment struggles to accomplish.</p><p>here’s why:</p><ol><li>Performance Impact: The volume of data required for analysis is usually big. If this data is processed through a transactional database, it can severely impact the performance of transactional queries, creating bottlenecks in operational workflows.</li><li>Structural Inefficiencies: Transactional databases are designed with normalization as a priority. This approach is aimed at improving performance and manageability while minimizing data redundancy. However, this configuration is inappropriate to analytics and fails to deliver the required performance.</li></ol><p>Given these constraints, it becomes evident that we need an alternative, a solution that separates our analytics operations from the transactional environment without compromising on either. Enter: Data Warehouses. These systems have emerged as a vital backbone for gaining valuable insights from our data, providing the necessary infrastructure for efficient and effective data analytics.</p><h3>Key Considerations in Choosing a Data Warehouse Solution</h3><p>When it comes to deciding on the most suitable data warehouse for your organization, there are several crucial parameters to consider. These aren’t just ‘nice-to-haves’ but are essential factors that will significantly impact how effectively you can manage and analyze your data. We dive into each of these parameters later.</p><ul><li>Standard SQL Support</li><li>Computing Framework and Join Query Performance</li><li>Data Updating Strategy</li><li>Analytic Functions (Window Functions)</li><li>High Availability Architecture</li><li>Partitioning Strategy</li></ul><h3>Selected candidates</h3><p>Below are the selected data warehouse candidates. We have chosen these based on their functionalities that align with our specific requirements and their amount of contribution as open-source solutions.</p><ul><li>Apache Doris</li><li>Apache Druid</li><li>ClickHouse</li><li>StarRocks</li><li>Apache Pinot</li></ul><h3>Comparison</h3><p>At first, we’ll describe the details of the parameters and then discuss how the candidates differ from each other based on the parameters. Furthermore, we will present our findings from various sources and articles.</p><h3>Support for standard SQL</h3><p>SQL is a mainstream query language used for data analytics. The selected data warehouse should ideally support standard SQL to ensure seamless querying and managing of data, even in complex scenarios. Good support for SQL has advantages like:</p><ul><li>Lower learning curve comparing tools-specific analytics query language</li><li>Easier migration of existing analytics service</li><li>More compatibility with other transactional and analytical system</li></ul><h4>Apache Doris</h4><p>In terms of interfaces, Apache Doris adopts MySQL protocol, supports standard SQL, and is highly compatible with MySQL dialect. Users can access Doris through various client tools and it supports seamless connection with BI tools.</p><h4>Apache Druid</h4><p>Apache Druid supports two query languages: Druid SQL and <a href="https://druid.apache.org/docs/latest/querying/querying.html">native queries</a>. You can query data in Druid data sources using <a href="https://druid.apache.org/docs/latest/querying/sql.html">Druid SQL</a>. Druid translates SQL queries into its native query language. Druid’s native query language is JSON over HTTP. Apache Druid does not fully support standard SQL (is not compatible with MySQL dialect) and some of operations has different syntax from standard SQL.</p><h4>ClickHouse</h4><p>ClickHouse supports a <a href="https://clickhouse.com/docs/en/sql-reference/">declarative query language based on SQL</a> that is identical to the ANSI SQL standard in <a href="https://clickhouse.com/docs/en/sql-reference/ansi">many cases</a>. Supported queries include GROUP BY, ORDER BY, subqueries in FROM, JOIN clause, IN operator, window functions and scalar subqueries. ClickHouse adaptively chooses how to JOIN multiple tables, by preferring hash-join algorithm and falling back to the merge-join algorithm if there’s more than one large table. In some of the cases query feature works in ClickHouse, but behaves <a href="https://clickhouse.com/docs/en/sql-reference/ansi">not as specified in ANSI SQL</a>.</p><h4>StarRocks</h4><p>StarRocks was a fork of Apache Doris 0.13 developed in 2020. StarRocks was formerly known as DorisDB. StarRocks is Compatible with MySQL protocols and standard SQL syntax and can communicate smoothly across the MySQL ecosystem, for example, MySQL clients and common BI tools such as Tableau and Power BI.</p><h4>Apache Pinot</h4><p>Apache Pinot support only a subset of SQL; for instance, joins and nested queries are not supported. PinotSQL (PQL) is a derivative of SQL derivative that supports selection, projection, aggregation, grouping aggregation.</p><h3>Computing Framework</h3><p>The warehouse’s ability to handle vast amounts of data and execute queries in an efficient, scalable manner is a key feature. A robust computing framework ensures rapid data processing, enabling quick insights. Also in the context of our analytics tasks, ‘joining’ different data sets is very common. Hence, the performance of join queries is a critical factor. The chosen solution should be capable of handling these queries efficiently to maintain an optimal performance level.</p><h4>Apache Doris</h4><p>Apache Doris is implemented based on MPP (Massively Parallel Processing) architecture and comes with an efficient columnar storage engine, which can support data <a href="https://doris.apache.org/docs/dev/data-table/data-model#aggregate-model">pre-aggregation</a> and automatic update of pre-aggregation results which is suitable for reporting and multi-dimensional analysis business.</p><p>Apache Doris supports two physical operators, one is <strong>Hash Join</strong>, and the other is <strong>Nest Loop Join </strong>which Hash Join has performance superiority and because of MPP architecture the way shuffling is taking place is crucial and has a significant impact on join performance. Apache Doris supports 4 Shuffle methods, Broadcast Join, Shuffle Join, Bucket Shuffle Join, Colocation, which the last one has minimum network overhead because related data is located in the same node and joins take place locally. Colocation join uses Hash Join operator.</p><p>The Doris query engine is vectorized, with all memory structures laid out in a columnar format. This can largely reduce virtual function calls, improve cache hit rates, and make efficient use of SIMD instructions. Doris delivers a 5–10 times higher performance in wide table aggregation scenarios than non-vectorized engines. Apache Doris supports high-concurrency and low-latency query services, and a single machine supports up to thousands of QPS.</p><h4>Apache Druid</h4><p>Apache Druid query engine is not fully vectorized and is not suitable for complex queries such as large-table joins and nested queries therefore has a low QPS. Apache Druid has two features related to joining of data:</p><ul><li><a href="https://druid.apache.org/docs/latest/querying/lookups.html">Query-time lookups</a>, simple key-to-value mappings</li><li><a href="https://druid.apache.org/docs/latest/querying/datasource.html#join">Join</a> operators. In Druid 25.0.0, joins are implemented with a broadcast hash-join algorithm. This means that all datasources other than the leftmost “base” datasource must fit in single server memory.</li></ul><p>Therefore Apache Druid is not suitable for joining two wide tables in query time.</p><h4>ClickHouse</h4><p>ClickHouse can support Broadcast Memory-based Join, but the performance is not good for the Join between large and wide tables with a large data volume. Also The capability for concurrency of ClickHouse is low. Therefore ClickHouse is more suitable for scenarios with flat tables.</p><h4>StarRocks</h4><p>The fully vectorized execution engine makes more efficient use of CPU processing power because this engine organizes and processes data in a columnar manner. Specifically, StarRocks stores data, organizes data in memory, and computes SQL operators all in a columnar manner.</p><p>StarRocks designs a brand-new CBO (Cost-based Optimizer) from scratch. This CBO adopts the cascades-like framework and is deeply customized for the vectorized execution engine with a number of optimizations and innovations. The CBO enables StarRocks to deliver good multi-table join query performance, especially in complex multi-table join queries.</p><h4>Apache Pinot</h4><p>Apache Pinot supports dimension <a href="https://docs.pinot.apache.org/users/user-guide-query/lookup-udf-join">lookup joins</a> currently. Therefore, join performance is not good for the Join between large and wide tables. <a href="https://github.com/apache/pinot/issues/8260">Full SQL join</a> support in Apache Pinot is <a href="https://startree.ai/blog/apache-pinot-native-join-support">coming soon</a>. And also there is no support for Subqueries.</p><h3>Data Updating Strategy</h3><p>The chosen solution should have a robust strategy for updating data. Whether it’s real-time updates or batch updates, the strategy should ensure data is always up-to-date and reliable.</p><h4>Apache Doris</h4><p>The data update is limited to the version of Doris and can only be used in Doris <strong>Version 0.15.x +</strong>. By default, multiple concurrent Update operations on the same table are not allowed at the same time. Apache Doris supports row-level update and the update command can only be executed on a table with a Unique data model.</p><h4>Apache Druid</h4><p>Apache Druid stores data <a href="https://druid.apache.org/docs/latest/design/architecture.html#datasources-and-segments">partitioned by time chunk</a> and supports overwriting existing data using time ranges. Data outside the replacement time range is not touched. Therefor, row-level data update is not supported in Apache Druid and it only append data to a segment or overwrite/delete the entire segment.</p><h4>ClickHouse</h4><p>Earlier versions did not support UPDATE and DELETE. After version 1.15, ClickHouse provides MUTATION operations (through ALTER TABLE statements) to update and delete data, but this is a “heavier” move, which is different from the UPDATE and DELETE move in the standard SQL grammar. With ALTER TABLE … UPDATE command data can be updated at row-level. But this operation is not designed for frequent use. Using whole partition insert/update has better performance and can update large amount of data easily.</p><h4>StarRocks</h4><p>StarRocks supports the analysis of detailed data and aggregated data, and real-time data updates. You can use the update model and primary key model provided by StarRocks to implement UPDATE and DELETE operations based on primary keys.</p><h4>Apache Pinot</h4><p>Pinot is an immutable datastore, which means that there is no genuine concept of upsert as you stream data into it from Kafka. For the upsert implementation, it’s essential to understand that an individual record is not updated via a write, instead, updates are appended to a log and a pointer maintains the most recent version of a record. So updates can only happen while streaming data into Apache Pinot.</p><h3>Analytic functions (Window Functions)</h3><p>The analytic functions can perform the summarisations similar to aggregate functions, they can access data in non-sequential way, can result in the same rows as incoming data, will help in having the simple SQL code with no join, eliminate the intermediate tables etc.</p><h4>Apache Doris</h4><p>In Apache Doris analytical functions are a special class of built-in functions. Similar to aggregate functions, analytic functions also perform calculations on multiple input rows to obtain a data value. The difference is that the analytic function processes the input data within a specific window, rather than grouping calculations by group by. The data within each window can be sorted and grouped using the over() clause.</p><h4>Apache Druid</h4><p>At the time of this writing (latest current Druid release is 24.0.1) window functions are not available in Druid.</p><h4>ClickHouse</h4><p>ClickHouse supports the standard grammar for defining windows and window functions but in general ClickHouse do not performs well with complex query.</p><h4>StarRocks</h4><p>StarRocks window functions are similar to Apache Doris in action.</p><h4>Apache Pinot</h4><p>Apache Pinot does not supports window functions and just support a number of aggregation functions.</p><h3>High Availability Architecture</h3><p>The data warehouse should be always available and resistant to failures. A high availability architecture ensures that your operations continue unhindered, even in the face of unforeseen events or spikes in demand.</p><h4>Apache Doris</h4><p>As shown in the figure below, the Apache Doris architecture is simple and neat, with only two types of processes.</p><ul><li>Front-end (FE): user request access, query parsing and planning, metadata management, node management, etc.</li><li>Back-end (BE): data storage and query plan execution</li></ul><p>Both types of processes are horizontally scalable, and a single cluster can support up to hundreds of machines and tens of petabytes of storage capacity. And these two types of processes guarantee high availability of services and high reliability of data through consistency protocols. This highly integrated architecture design greatly reduces the operation and maintenance cost of a distributed system.</p><h4>Apache Druid</h4><p>Apache Druid uses six types of processes (Overlord, Coordinator, MiddleManager, Router, Broker, and Historical). In addition, Apache Druid relies on MySQL for storing metadata, Apache ZooKeeper for electing Coordinator and Overlord processes, and deep storage for storing data. If you want to use HA deployment, you may need to manage many processes. The operations related to rolling updates are also complex.</p><h4>ClickHouse</h4><p>ClickHouse supports high availability and distributions, but it’s not straight forward and has some difficulties. The ClickHouse cluster cannot automatically sense changes in the cluster topology, so it cannot automatically balance data. When the cluster data is large, adding cluster nodes may bring great operation and maintenance costs to data load balancing. Also it needs Apache Zookeeper for cluster management and it adds even more complexity to maintain ClickHouse cluster.</p><h4>StarRocks</h4><p>StarRocks has two types of nodes: front end (FE) and back end (BE). FE is responsible for metadata and scheduling management. BE is responsible for data storage and calculation. FE and BE nodes can be horizontally scaled. StarRocks does not rely on other third-party components. Like HDFS, when the StarRocks cluster perceives a change in the cluster topology, it can perform online elastic expansion and contraction,avoid adding nodes to the business intrusion.</p><h4>Apache Pinot</h4><p>Apache Pinot architecture is very similar to Apache Druid architecture and same as Apache Druid it has multiple components that make it a bit harder to scale comparing to Apache Doris or StarRocks which have only two main components.</p><h3>Partitioning Strategy</h3><p>Effective data management often involves data partitioning. The right solution should offer flexible partitioning strategies, helping manage data more efficiently and improve query performance.</p><h4>Apache Doris</h4><p>In the Doris storage engine, user data are horizontally divided into data tablets (also known as data buckets). Each tablet contains several rows of data. The data between the individual tablets do not intersect and is physically stored independently. A Partition contains several tablets and a Table is formed of multiple Partitions. Partition can be thought of as the smallest logical unit of management. Data import and deletion can be performed on only one Partition.</p><p>Apache Doris supports two layer of partitioning The first level is Partition, including range partitioning and list partitioning. The second is Bucket (Tablet), which only supports hash partitioning.</p><h4>Apache Druid</h4><p>Apache Druid Similar to Apache Doris supports two layer of partitioning, which the first layer of partitioning is based on time and secondary partition can be create by maximum number of rows in a segment or by a column.</p><h4>ClickHouse</h4><p>Partitioning is available for the <a href="https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree">MergeTree</a> family tables (including <a href="https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/replication">replicated</a> tables). A partition is a logical combination of records in a table by a specified criterion. You can set a partition by an arbitrary criterion, such as by month, by day, or by event type. Each partition is stored separately to simplify manipulations of this data. When accessing the data, ClickHouse uses the smallest subset of partitions possible. Partitioning in ClickHouse may result in performance degradation in some scenarios and also performance of data ingestion can degrade for partitioned tables.</p><h4>StarRocks</h4><p>Similar to Apache Doris, StarRocks supports two layer of partitioning, the first layer divides a table into multiple segments called partitions based on the partitioning column and the second layer which called Bucketing divides a partition into multiple more manageable parts called tablets, which is the smallest unit of storage that you can use and allocate. StarRocks like Apache Doris uses a hash algorithm to bucket data.</p><h4>Apache Pinot</h4><p>Pinot breaks a table into multiple small <em>chunks of data</em> known as <strong>segments</strong> that are distributed across Pinot servers. These segments can also be stored in a <strong>deep store</strong> such as HDFS. Pinot segment is a unit of <em>partitioning</em>, <em>replication</em>, and <em>query processing</em> that represents a subset of the input data along with the specified indices.</p><h3>Choosing the right one</h3><p>Our primary concern lies in the ability of a data warehouse solution to efficiently handle complex queries, including multiple wide table joins and analytic functions, while maintaining good performance. Additionally, given the mutable nature of our data, it is crucial to consider the performance of data updates as another important parameter. The support for standard SQL is also a significant advantage for us.</p><p>Considering these factors, we have narrowed down our options to Apache Doris and StarRocks. It’s worth noting that we have a data lake, utilizing MinIO object storage, which serves as a central repository for our data from various sources. At times, we may need to query our data lake. While Apache Doris continues to focus on real-time analytics, StarRocks has recently added data lake query capabilities. In the latest TPC-H benchmark, StarRocks has demonstrated its superiority, performing 3x to 5x faster than traditional data lake query engines like Trino. Therefore, StarRocks aligns better with our needs and requirements.</p><h3>References</h3><ol><li><a href="https://senthilnayagan.com/apache-pinot/2022/introduction-to-apache-pinot">https://senthilnayagan.com/apache-pinot/2022/introduction-to-apache-pinot</a></li><li><a href="https://celerdata.com/blog/apache-druid-vs.-starrocks-a-deep-dive">https://celerdata.com/blog/apache-druid-vs.-starrocks-a-deep-dive</a></li><li><a href="https://celerdata.com/blog/clickhouse-vs.-starrocks-a-detailed-comparison">https://celerdata.com/blog/clickhouse-vs.-starrocks-a-detailed-comparison</a></li><li><a href="https://clickhouse.com/docs">https://clickhouse.com/docs</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=282398f22b18" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>