Technology Sharing

Understanding DolphinDB thread model from the entire process of a SQL query

2024-07-08

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

1 Introduction

DolphinDB's thread model is relatively complex, and writing and querying distributed tables may require multiple types of threads.Understanding the entire process of SQL query can help us understand the thread model of DolphinDB, master the configuration of DolpinDB, and optimize system performance.

This tutorial takes a distributed SQL query as an example to introduce the data flow of the DolphinDB distributed database query process and the various thread pools it goes through.

2. DolphinDB's main node types

  • agent

Responsible for executing commands issued by the control node to start and shut down data nodes or computing nodes. In a cluster, each physical server has only one agent node.

  • controller

Responsible for collecting the heartbeats of proxy nodes, data nodes, and computing nodes, monitoring the working status of each node, and managing metadata and transactions of the distributed file system.

  • data node

It can store data and also be used for data query and calculation.

  • compute node

Only used for data query and calculation. Compute nodes are used for computation-intensive operations, including stream computing, distributed association, and machine learning. Compute nodes do not store data, but can be used to query and calculate data.