Giter Club home page Giter Club logo

go-questdb-client's Introduction

QuestDB Logo

 

QuestDB community Slack channel QuestDB open source contributors QuestDB on Apache Maven

English | 简体中文 | 繁體中文 | العربية | Italiano | Українська | Español | Português | 日本語 | Türkçe | हिंदी | Tiếng Việt

QuestDB

QuestDB is an open-source time-series database for high throughput ingestion and fast SQL queries with operational simplicity.

QuestDB is well-suited for financial market data, IoT sensor data, ad-tech and real-time dashboards. It shines for datasets with high cardinality and is a drop-in replacement for InfluxDB via support for the InfluxDB Line Protocol.

QuestDB implements ANSI SQL with native time-series SQL extensions. These SQL extensions make it simple to filter and downsample data, or correlate data from multiple sources using relational and time-series joins.

We achieve high performance by adopting a column-oriented storage model, parallelized vector execution, SIMD instructions, and low-latency techniques. The entire codebase is built from the ground up in Java, C++ and Rust with no dependencies and zero garbage collection.

QuestDB supports schema-agnostic streaming ingestion using the InfluxDB line protocol and a REST API for bulk imports and exports. The QuestDB SQL Web Console is an interactive SQL editor facilitating CSV import. Finally, QuestDB also includes the Postgres Wire Protocol for programmatic queries.

Popular tools that integrate with QuestDB include Apache Kafka, Grafana, Superset, Telegraf and Apache Flink.

Try QuestDB

We provide a live demo provisioned with the latest QuestDB release and sample datasets:

  • Trips: 10 years of NYC taxi trips with 1.6 billion rows
  • Trades: live crypto market data with 30M+ rows per month
  • Pos: geolocations of 250k unique ships over time

Checkout our interactive real-time market data dashboards and NYC Taxi Data Analytics Dashboards powered by QuestDB and Grafana.

Query Execution time
SELECT sum(double) FROM trips 0.15 secs
SELECT sum(double), avg(double) FROM trips 0.5 secs
SELECT avg(double) FROM trips WHERE time in '2019' 0.02 secs
SELECT time, avg(double) FROM trips WHERE time in '2019-01-01' SAMPLE BY 1h 0.01 secs
SELECT * FROM trades LATEST ON timestamp PARTITION BY symbol 0.00025 secs

Our demo is running on c5.metal instance and using 24 cores out of 96.

Get started

Install QuestDB

To run QuestDB, Docker can be used to get started quickly:

docker run -p 9000:9000 -p 9009:9009 -p 8812:8812 questdb/questdb

macOS users can use Homebrew:

brew install questdb
brew services start questdb

questdb start // To start questdb
questdb stop  // To stop questdb

The QuestDB downloads page provides direct downloads for binaries and has details for other installation and deployment methods.

QuestDB Cloud

QuestDB Cloud is the fully managed version of QuestDB, with additional features such as Role-based access control, Cloud-native Replication, Compression, monitoring and cloud-native snapshots. Get started with $200 credits.

Connect to QuestDB

You can interact with QuestDB using the following interfaces:

Insert data

Below are the official QuestDB clients for ingesting data via the InfluxDB Line Protocol:

End-to-end quickstart

Want to walk through everything, from streaming ingestion to visualization with Grafana? Check out our multi-path quickstart repository.

How QuestDB compares to other open source TSDBs

Checkout our benchmark blog post which compares QuestDB and InfluxDB across functionality, maturity and performance.

A chart comparing the ingestion rate of QuestDB, InfluxDB and TimescaleDB.

Resources

📚 Read the docs

❓ Get support

🚢 Deploy QuestDB

Contribute

We welcome contributions to the project, whether source code, documentation, bug reports, feature requests or feedback. To get started with contributing:

✨ As a sign of our gratitude, we also send QuestDB swag to our contributors. Claim your swag.

A big thanks goes to the following wonderful people who have contributed to QuestDB: (emoji key):


clickingbuttons

💻 🤔 📓

ideoma

💻 📓 ⚠️

tonytamwk

💻 📓

sirinath

🤔

igor-suhorukov

💻 🤔

mick2004

💻 📦

rawkode

💻 🚇

solidnerd

💻 🚇

solanav

💻 📖

shantanoo-desai

📝 💡

alexprut

💻 🚧

lbowman

💻 ⚠️

chankeypathak

📝

upsidedownsmile

💻

Nagriar

💻

piotrrzysko

💻 ⚠️

mpsq

💻

siddheshlatkar

💻

Yitaek

💡

gabor-boros

💡

kovid-r

💡

TimBo93

🐛 📓

zikani03

💻

jaugsburger

💻 🚧

TheTanc

📆 🖋 🤔

davidgs

🐛 🖋

kaishin

💻 💡

bluestreak01

💻 🚧 ⚠️

patrickSpaceSurfer

💻 🚧 ⚠️

chenrui333

🚇

bsmth

📖 🖋

Ugbot

💬 📓 📢

lepolac

💻 🔧

tiagostutz

📓 🐛 📆

Lyncee59

🤔 💻

rrjanbiah

🐛

sarunas-stasaitis

🐛

RiccardoGiro

🐛

duggar

🐛

postol

🐛

petrjahoda

🐛

t00

🐛

snenkov

📓 🐛 🤔

marregui

💻 🤔 🎨

bratseth

💻 🤔 📓

welly87

🤔

fuzzthink

🤔 📓

nexthack

💻

g-metan

🐛

tim2skew

🐛 📓

ospqsp

🐛

SuperFluffy

🐛

nu11ptr

🐛

comunidadio

🐛

mugendi

🤔 🐛 📖

paulwoods222

🐛

mingodad

🤔 🐛 📖

houarizegai

📖

jjsaunier

🐛

zanek

🤔 📆

Geekaylee

📓 🤔

lg31415

🐛 📆

null-dev

🐛 📆

ultd

🤔 📆

ericsun2

🤔 🐛 📆

giovannibonetti

📓 🐛 📆

wavded

📓 🐛

puzpuzpuz

📖 💻 📓

rstreics

💻 🚇 📖

mariusgheorghies

💻 🚇 📖

pswu11

🖋 🤔 🎨

insmac

💻 🤔 🎨

eugenels

💻 🤔 🚧

bziobrowski

💻 📆

Zapfmeister

💻 📓

mkaruza

💻

DylanDKnight

📓 🐛

enolal826

💻

glasstiger

💻

argshook

💻 🤔 🎨 🐛

amunra

💻 📖 🐛

GothamsJoker

💻

kocko

💻

jerrinot

💻 🤔 🐛

rberrelleza

💻

Cobalt-27

💻

eschultz

💻

XinyiQiao

💻

terasum

📖

PlamenHristov

💻

tris0laris

📝 🤔

HeZean

💻 🐛

iridess

💻 📖

selmanfarukyilmaz

🐛

donet5

🤔 🐛

Zahlii

🐛

salsasepp

🐛

EmmettM

🐛 ⚠️

robd003

🤔

AllenEdison

🐛

CSharpDummy

🐛

shimondoodkin

🐛 🤔

huuhait

🐛 🤔

alexey-milovidov

🐛

suconghou

🐛

allegraharris

💻

oliver-daniel

💻

kerimsenturk5734

📖

This project adheres to the all-contributors specification. Contributions of any kind are welcome!

go-questdb-client's People

Contributors

amunra avatar bluestreak01 avatar goodroot avatar jammutkarsh avatar jerrinot avatar puzpuzpuz avatar sklarsa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

go-questdb-client's Issues

Now that Data Deduplication is available, make the LineSender safer

There are several issues and pull requests throughout this repo that discuss the fact that the LineSender is not fully safe, i.e. there's issues in auto-reconnection, there's no way to retrieve the failed sent buffer to retry if there is a connection issue, etc.

@puzpuzpuz has said that this can't be implemented without data deduplication on the server side.

According to the QuestDB Docs site, data deduplication is implemented on the DB since QuestDB 7.3: https://questdb.io/docs/concept/deduplication/

Can we get this MAJOR ISSUE fixed (at the very least as an option on the client that we can enable) so we can have some better safety in what will happen if there's a connection issue, so we don't lose data and we don't have to implement reconnection logic on our own?

Does not reconnect on disconnection?

Hello and thank you for all the great efforts put into the questdb project. I have been using the client for a few days now and it came to my attention that the client does not seem to reconnect on TCP disconnections. The way it works now is that you will need to take the following steps

  1. Establish a connection
  2. Call LineSender.Table... then LineSender.At
  3. Flush lines
  4. Close connection

The above will need to be repeated every time there is a need to send the data to questdb. This is most likely by design and is intended to work this way. Though there is an overhead for establishing a connection every time one wants to send data or reconnect during a flush error.

Would it be desirable to have the client auto-connect and maintain the connection with the server?

Add support for sending ready line

Hi,

thanks for your library and awesome db! I generate line protocol entry via reflection and I got all my lines ready to be pushed. I want to use the library so it handles batch, connection, tls, etc. Is there a way where I can write the line directly to the buffer?

Improve connection logic

There are a few issues with the current approach:

  • If flush fails due to a network issue, you are forced to create a new sender... meaning all the messages you have buffered to be flushed get lost.
  • There's no re-connection logic (automatic or manual) and there's no way to check if the connection is alive.

Actually maybe it's not even a good idea to connect on NewLineSender() init, as there may be substantial delay between initialization and flushing, causing the connection to timeout (or disconnect due to any network error) before flush is even called.

Bad address on attempt to create sender leads to hang w/o error

The Bug

If you try to create a sender with a bad URL the code hangs indefinitely. I think it should return an error, perhaps after a configurable timeout.

To Replicate

You should be able to replicate this behavior by running the following code:

package main

import (
	"context"
	"encoding/json"
	"fmt"
	qdb "github.com/questdb/go-questdb-client/v2"
	"io"
	"log"
	"net/http"
	"os"
)

func main() {
	fmt.Printf("Attempting to connect...")
	ctx := context.TODO()

	sender, err := qdb.NewLineSender(
		ctx,
		qdb.WithAddress("trial-instance-xxxxxxxx.ilp.xxxx.questdb.com:3xxxx"), // <== If this is wrong the program will hang
		qdb.WithBufferCapacity(4096),
	)
	if err != nil {
		log.Fatal(fmt.Errorf("error: Failed to connect to QDB: %w", err))
		return
	}
	//defer sender.Close()
	// Make sure to close the sender on exit to release resources.
	defer func(sender *qdb.LineSender) {
		err := sender.Close()
		if err != nil {
			log.Printf("Error closing sender to QuestDB - may cause resource leak: %v", err)
		}
	}(sender)

	fmt.Printf("Connection made")
}

For Others Looking For Connection URL:

For anyone else trying to connect to your cloud trial instance, poke around your trial instance webpage a bit, but not in the web-console. You'll find the correct URL in places where they talk about adding data to the DB. The port is not 9009, unlike the local hello-world install.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.