https://questdb.io logo
Title
b

Badr Bouslikhin

04/11/2023, 2:31 PM
Hello, Does anyone have good ressources to design schemas/structure data for QuestDB?
b

Bolek Ziobrowski

04/11/2023, 2:48 PM
Hi @Badr Bouslikhin. https://questdb.io/docs/concept/storage-model/ explains various bits about storage but feel free to share schema and ask concrete questions .
b

Badr Bouslikhin

04/11/2023, 2:49 PM
Thanks! I’ll look into it. I generally have no experience in design relational databases. I’ve been used to InfluxDB. I was doing research on best practices and design recommendations.
n

Nicolas Hourcard

04/11/2023, 4:28 PM
we also use the influxdb line protocol (albeit on TCP), so it should feel similar. We use tables and its a relational model, but dont necessarily need a schema upfront
b

Badr Bouslikhin

04/11/2023, 4:39 PM
Do you see any issue (or futur issue) with having tables composed of 33 columns? My current use-case is data collection from IoT temperature sensors sent through LoRaWAN. I collect the data using a webhook and a home-made Rust bridge. The messages are mostly composed of metadata (network link quality, device location computed by the network, device battery voltage, etc.).
n

Nicolas Hourcard

04/11/2023, 4:47 PM
33 columns is totally fine. We have some questdb specific things that are good to know: Symbol for repetitive strings: https://questdb.io/docs/concept/symbol/ Designated timestamp: https://questdb.io/docs/concept/designated-timestamp/ Time partitions: https://questdb.io/docs/concept/partitions/
QuestDB library for Rust: https://docs.rs/crate/questdb-rs/latest
b

Badr Bouslikhin

04/11/2023, 4:48 PM
Thanks for the feedback! I’ll go through the docs.
When using
questdb-rs
, do we need to write symbols before columns? Not doing so throws the error:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { code: InvalidApiCall, msg: "State error: Bad call to `symbol`, should have called `column` or `at` instead." }', src/main.rs:165:14
n

Nicolas Hourcard

04/12/2023, 3:30 PM
@Eugene would you be able to take a look at this one? thanks
e

Eugene

04/12/2023, 3:45 PM
Yes, the symbols must come before the columns, they cannot be mixed
b

Badr Bouslikhin

04/12/2023, 4:07 PM
Ok, thanks! Maybe it’s worth adding to the crate doc. or the https://questdb.io/docs/concept/symbol/ page.
Once the table schema created (with
symbol
columns) can I write
column_str
instead of
symbol
?
e

Eugene

04/12/2023, 4:43 PM
The
column_str
method has no advantages over the
symbol
. In this case, the string will be implicitly converted to a symbol.