DBDB.io The Encyclopedia of Database Systems · Est. 2017
Database of Databases

LinDB is a distributed time-series DBMS written in Go. It is optimized especially for real-time writing and retrieval tasks, and is used internally by ELEME Inc. The internal version is Java based, however open sourced version is redesigned in Go.[02]

Source Code
https://github.com/lindb/lindb[02]
Developer
Country of Origin
CN
Start Year
2019 [14]
Project Type
Open Source
Written in
Go
Supported Languages
SQL
Embeds / Uses
etcd
Inspired By
InfluxDB
License
Apache v2

LinDB is a distributed time-series DBMS written in Go. It is optimized especially for real-time writing and retrieval tasks, and is used internally by ELEME Inc. The internal version is Java based, however open sourced version is redesigned in Go.[02]

History[04]


The project was launched at 2016 internally at ELEME as a replacement for Graphite. Since then the DBMS has been re-written three times. The open-source version is the latest redesign and rewritten in Go starting 2019.

Compression[05][04][06]


LinDB uses a combination of bitmap encoding and data compression. Since it is designed for time-series data, all data entry contains a timestamp and several multi dimensional metrics, such as ip string, shard id, etc. The timestamp is saved with a base timestamp and a bitmap with each bit encoding a time within some time period following the base timestamp. The data blocks are compressed with xor, in reference to Gorilla.

Concurrency Control[04]


Concurrency control is not supported. All writing to the DB is first directed to the specific shard based on its tagKey and tagValue. Within each shard all writing is handled by a single thread.

Data Model[07][08][09]


Similar to other time-series DBMS, the data model contains four main components: timestamp, metrics, tags, and fields. The metric is the name of the measurement attribute. Tags are combinations of dimensions of measurement used during query, and the fields stores metric data. User has to define whether their columns belong to tags or fields.

Foreign Keys


Query Interface[10]


SQL

LinDB supports SQL-like query interface.

System Architecture[11][12][04][13]


LinDB is designed to support both fast insert and high throughput read, including mainly aggregation operations such as group by. Meanwhile, it needs distributed storage due to the size of the stored data.

The storage layer mainly stores data with write replication, with shard number configurable to user. Each cluster contains several servers, and data are redundantly stored across servers.

User interacts with the DBMS via brokers. The broker is in charge of receiving query requests, parsing queries, redirect child execute plan to storage layer, and aggregation if needed.

In addition, metadata of the clusters for broker layer and storage layer are stored by ETCD, an external dependency. It servers as a distributed configuration service in Go. The internal Java version LinDB use Zookeeper for the same functionality.

Citations

14 sources
  1. https://www.lindb.io/ lindb.io
  2. GitHub - lindb/lindb: LinDB is a scalable, high performance, high availability distributed time series database. · GitHub github.com
  3. Home · lindb/lindb Wiki · GitHub github.com
  4. https://zhuanlan.zhihu.com/p/35998778 zhihu.com Dead — Check Archive
  5. http://www.vldb.org/pvldb/vol8/p1816-teller.pdf vldb.org Dead — Check Archive
  6. lindb/tsdb/memdb/metric_store_index.go at 438001fde0c8bca73f121721e6347e123250731a · lindb/lindb · GitHub github.com
  7. https://zhuanlan.zhihu.com/p/36804890 zhihu.com Dead — Check Archive
  8. lindb/series/field at b245eee881603615a33309a3bd1f7733b383ab81 · lindb/lindb · GitHub github.com
  9. lindb/tsdb/memdb at 438001fde0c8bca73f121721e6347e123250731a · lindb/lindb · GitHub github.com
  10. https://github.com/lindb/lindb/tree/develop/sql/grammar github.com Dead — Check Archive
  11. https://lindb.io/docs/design/architecture.html#overview lindb.io Dead — Check Archive
  12. GitHub - etcd-io/etcd: Distributed reliable key-value store for the most critical data of a distributed system · GitHub github.com
  13. lindb/pkg/state at a3572de1b43d0136aa4be2e089f9c86fb3b76742 · lindb/lindb · GitHub github.com
  14. Initial commit github.com
Revision #15 Last Updated: