Project layout

This entire project is implemented by Go, so it follows the common rule of general Go project. Below is a brief description for project structure

├── aggregation           : data aggregation, function and expression calculation
├── app                   : runtime for broker\storage\standalone etc.
│   ├── broker            : runtime dependencies and implementation in Broker
│   ├── standalone        : runtime dependencies and implementation in Standalone mode 
│   └── storage           : runtime dependencies and implementation in Storage 
├── bin                   : directory of binary files, name of the binary package is `lind`
├── cmd                   : entrance to the entire system, including Broker, Storage and Standalone mode
│   ├── cli               : interactive command line 
│   ├── lind              : lind binary package 
│   └── tools             : command line tools
├── config                : configuration for all components
├── constants             : common constant definitions 
├── coordinator           : the distributed coordinator, including MetaData, State and Task management for Broker, Storage and Master 
├── docker                : docker image build 
├── e2e                   : integration and performance test cases
├── flow                  : query flow interface
├── ingestion             : metric data ingestion
│   ├── common            : common tools such as gzip handler\line parsing etc.
│   ├── influx            : covert influxdb data to linmetric
│   ├── native            : native data receiver
│   └── prometheus        : PB data receiver
├── internal              : internal toolkits
│   ├── bootstrap         : method of initializing such as create _internal database at startup
│   ├── client            : Broker API Client
│   ├── concurrent        : goroutine pool
│   ├── conntrack         : grpc/tcp conn hook for self-monitoring
│   ├── linmetric         : multi-value sdk for self-monitoring 
│   |── mock              : mock helper functions used in the project
|   ├── monitoring        : system/runtime self-monitoring
│   └── server            : app server common interface 
├── kv                    : the underling common KV storage
├── metrics               : definition of all self-monitoring metrics
├── models                : model definition for the entire project
├── pkg                   : general toolkit
│   ├── bit               : Bit read/write
│   ├── bufioutil         : buffer io toolkit 
│   ├── bufpool           : buffer pool
│   ├── collections       : data structures such as float array\bit array etc.
│   ├── encoding          : encoding toolkit such as delta-bit-packing\zigzag etc.
│   ├── fasttime          : millisecond time, avoid frequent system calls
│   ├── fileutil          : file toolkit
│   ├── hostutil          : host toolkit such as read host info
│   ├── http              : http toolkit such gin
│   ├── lockers           : file lock
│   ├── logger            : zap logger wrapper
│   ├── ltoml             : toml file parsing and types
│   ├── option            : shard configuration options 
│   ├── queue             : persistent queue 
│   ├── state             : etcd toolkit 
│   ├── stream            : stream toolkit 
│   ├── strutil           : string toolkit 
│   ├── timeutil          : time/date toolkit 
│   |── trie              : compact trie tree for string->int storage 
│   |── unique            : blobal unique ID storage
│   └── validate          : toolkit for validating struct
├── proto                 : protobuf
│   ├── gen               : protobuf code generate protobuf
│   ├── opentelemetry-v1  : open telemetry protobuf file
│   └── v1                : protobuf file(v1)
├── query                 : metric data and metadata distributed query
│   ├── broker            : data query and aggregation in computing node
│   ├── context           : query context
│   ├── operator          : query operator 
│   ├── stage             : query stage
│   └── tracker           : track query execute
├── replica               : broker data write/storage data replication
├── rpc                   : RPC for internal communication 
├── series                : time series iterators\aggregators\data structure
│   ├── field             : field structure and aggregators
│   ├── metric            : metric data structure
│   └── tag               : tag data structure
├── sql                   : lin query language parse 
│   ├── grammar           : grammar parse generated by antlr4
│   └── stmt              : SQL statement 
├── tsdb                  : time series engine storage 
│   ├── indexdb           : index storage
│   ├── memdb             : memory database
│   ├── metadb            : metric metadata
│   ├── tblstore          : flushers and readers for metric data files and index files
│   └── template          : generate common code using templates
└── web                   : front-end for LinDB admin