Time Series Database based on Cassandra with Prometheus remote read/write support

SquirrelDB

Go Report Card Docker Image Version (latest by date) Docker Image Size (latest by date) Open Source? Yes!

SquirrelDB is a scalable high-available timeseries database (TSDB) compatible with Prometheus remote storage. SquirrelDB store data in Cassandra which allow to rely on Cassandra's scalability and availability.

Quickstart using Docker-compose

If you have Docker compose, you may run SquirrelDB, its Cassandra and Prometheus + Grafana using docker-compose:

docker-compose up -d

Then, go to http://localhost:3000 (default credentials are admin/admin) and:

  • Add a Prometheus datasource (using http://squirreldb:9201 as URL)
  • Create your dashboard or import a dashboard (for example import dashboard with ID 1860).

HA setup

SquirrelDB allow both availability and scalability:

  • The long term storage availability and scalability is done by a Cassandra cluster. Setup a Cassandra cluster and use a replication level > 1 (3 is recommended).
  • The short term storage (by default last 15 minutes) which is store in-memory could be moved to Redis. A Redis cluster will provide availability and scalability of short term storage.
  • When short term storage is provided by Redis, SquirrelDB instance are stateless, scalling them is just adding more of them behind a load-balancer (like nginx).

See examples/squirreldb-ha for a quickstart on HA setup.

Build a release

SquirrelDB use goreleaser and Docker to build its release, to build the release binaries and Docker images run:

# Optional, to speed-up subsequent build
mkdir -p .build-cache
./build.sh

The resulting binaries are in dist/ folder and a Docker image named "squirreldb" is built

Test and Develop

SquirrelDB need a Cassandra database, you may run one with:

docker run -d --name squirreldb-cassandra -p 127.0.0.1:9042:9042 -e MAX_HEAP_SIZE=128M -e HEAP_NEWSIZE=24M cassandra

To build binary you can use build.sh script. For example to just compile Go binary (skip building Docker image and Windows installer):

mkdir -p .build-cache
./build.sh go

Then run SquirrelDB:

./squirreldb

SquirrelDB use golangci-lint as linter. You may run it with:

mkdir -p .build-cache  # enable cache and speed-up build/lint run
./lint.sh

Note on VS code

SquirrelDB use Go module. VS code support for Go module require usage of gopls. Enable "Use Language Server" in VS code option for Go.

To install or update gopls, use:

(cd /tmp; GO111MODULE=on go get golang.org/x/tools/gopls@latest)
Owner
Bleemeo
Easy Monitoring for Scalable Infrastructure. #DevOps #Monitoring #Observability #Cloud #Containers
Bleemeo
Similar Resources

BuntDB is an embeddable, in-memory key/value database for Go with custom indexing and geospatial support

BuntDB is an embeddable, in-memory key/value database for Go with custom indexing and geospatial support

BuntDB is a low-level, in-memory, key/value store in pure Go. It persists to disk, is ACID compliant, and uses locking for multiple readers and a sing

Dec 30, 2022

pure golang key database support key have value. 非常高效实用的键值数据库。

pure golang key database support key have value.  非常高效实用的键值数据库。

orderfile32 pure golang key database support key have value The orderfile32 is standard alone fast key value database. It have two version. one is thi

Apr 30, 2022

Owl is a db manager platform,committed to standardizing the data, index in the database and operations to the database, to avoid risks and failures.

Owl is a db manager platform,committed to standardizing the data, index in the database and operations to the database, to avoid risks and failures. capabilities which owl provides include Process approval、sql Audit、sql execute and execute as crontab、data backup and recover .

Nov 9, 2022

This is a simple graph database in SQLite, inspired by "SQLite as a document database".

About This is a simple graph database in SQLite, inspired by "SQLite as a document database". Structure The schema consists of just two structures: No

Jan 3, 2023

Simple key value database that use json files to store the database

KValDB Simple key value database that use json files to store the database, the key and the respective value. This simple database have two gRPC metho

Nov 13, 2021

Beerus-DB: a database operation framework, currently only supports Mysql, Use [go-sql-driver/mysql] to do database connection and basic operations

Beerus-DB · Beerus-DB is a database operation framework, currently only supports Mysql, Use [go-sql-driver/mysql] to do database connection and basic

Oct 29, 2022

Embedded key-value store for read-heavy workloads written in Go

Embedded key-value store for read-heavy workloads written in Go

Pogreb Pogreb is an embedded key-value store for read-heavy workloads written in Go. Key characteristics 100% Go. Optimized for fast random lookups an

Jan 3, 2023

OcppManager-go - A library for dynamically managing OCPP configuration (variables). It can read, update, and validate OCPP variables.

🔌 ocppManager-go A library for dynamically managing OCPP configuration (variables). It can read, update, and validate OCPP variables. Currently, only

Jan 3, 2022

GoPostgreSQL - An example usage of PostgreSQL with GO, very simple since the objective is that others can read and learn

GoPostgreSQL - An example usage of PostgreSQL with GO, very simple since the objective is that others can read and learn

GoPostgreSQL - An example usage of PostgreSQL with GO, very simple since the objective is that others can read and learn

Feb 10, 2022
Comments
  • ScyllaDB Compatibility

    ScyllaDB Compatibility

    If SquirrelDB works with Apache Cassandra, could you also test for use with ScyllaDB? You can use our shard-aware GoCQL driver and GoCQLX extension:

    https://github.com/scylladb/gocql

    https://github.com/scylladb/gocqlx

    It should be fully compatible. Would love to hear whether it works.

  • Data retention

    Data retention

    Hi,

    I'm just starting to evaluate Squirreldb in terms of long-term storage for Prometheus. Got a question related to data retention. So let's say - I'm interested in keeping only 2 years of metrics inside squirreldb. How do you achieve this?

    My educated guess would be, that there's a need for updating data in Cassandra rows, marking it as deleted (so a basic DELETE query). This would generate tombstones which would be removed during the next compaction process.

    However, the other way around would be to set data invalidation (via TTLs) during data creation process (so in practice, setting TTLs on new data imported from prometheus).

    So, having this said - could you elaborate a bit about this? Haven't found this kind of information. In return, I can create documentation for this when I test it ;) Thanks

  • What are the supported features?

    What are the supported features?

    This project sounds interesting. However, I can find all the features that are available. I am interested in:

    • PromQL queries: I think this feature is available. Can you confirm that?
    • Multi-tenancy: Is the multi-tenancy supported?
    • Data compression: I saw in the code some references to Gorilla. Is this feature available?
    • Backfilling: Is it possible to insert data in the past?
Fast specialized time-series database for IoT, real-time internet connected devices and AI analytics.
Fast specialized time-series database for IoT, real-time internet connected devices and AI analytics.

unitdb Unitdb is blazing fast specialized time-series database for microservices, IoT, and realtime internet connected devices. As Unitdb satisfy the

Jan 1, 2023
VictoriaMetrics: fast, cost-effective monitoring solution and time series database
VictoriaMetrics: fast, cost-effective monitoring solution and time series database

VictoriaMetrics VictoriaMetrics is a fast, cost-effective and scalable monitoring solution and time series database. It is available in binary release

Jan 8, 2023
LinDB is an open-source Time Series Database which provides high performance, high availability and horizontal scalability.
LinDB is an open-source Time Series Database which provides high performance, high availability and horizontal scalability.

LinDB is an open-source Time Series Database which provides high performance, high availability and horizontal scalability. LinDB stores all monitoring data of ELEME Inc, there is 88TB incremental writes per day and 2.7PB total raw data.

Jan 1, 2023
TalariaDB is a distributed, highly available, and low latency time-series database for Presto
TalariaDB is a distributed, highly available, and low latency time-series database for Presto

TalariaDB is a distributed, highly available, and low latency time-series database that stores real-time data. It's built on top of Badger DB.

Nov 16, 2022
🤔 A minimize Time Series Database, written from scratch as a learning project.
🤔 A minimize Time Series Database, written from scratch as a learning project.

mandodb ?? A minimize Time Series Database, written from scratch as a learning project. 时序数据库(TSDB: Time Series Database)大多数时候都是为了满足监控场景的需求,这里先介绍两个概念:

Jan 3, 2023
Export output from pg_stat_activity and pg_stat_statements from Postgres into a time-series database that supports the Influx Line Protocol (ILP).

pgstat2ilp pgstat2ilp is a command-line program for exporting output from pg_stat_activity and pg_stat_statements (if the extension is installed/enabl

Dec 15, 2021
Simple-read-file - Example of how to read file in Go

simple-read-file This repository contains a simple example of how to read file i

Jan 11, 2022
🔑A high performance Key/Value store written in Go with a predictable read/write performance and high throughput. Uses a Bitcask on-disk layout (LSM+WAL) similar to Riak.

bitcask A high performance Key/Value store written in Go with a predictable read/write performance and high throughput. Uses a Bitcask on-disk layout

Sep 26, 2022
Multiple databases, read-write splitting FOR GORM

DBResolver DBResolver adds multiple databases support to GORM, the following features are supported: Multiple sources, replicas Read/Write Splitting A

Jan 6, 2023
Hard Disk Database based on a former database

Hard Disk Database based on a former database

Nov 1, 2021