thingsboard / thingsboard-pe-docker-compose

Docker configuration example for ThingsBoard PE Microservices
Apache License 2.0
13 stars 33 forks source link

Document hybrid database strategy (postgres and cassandra) #11

Closed Delapouite closed 4 days ago

Delapouite commented 4 years ago

Hi

Currently the docker-compose files present in this repository tend to favor a "full-on" approach. Using the DATABASE variable in the main .env file, the user can either takes the postgres OR the cassandra road.

Often, it is convenient to take the best of both worlds by storing the entities in postgres and the telemetries in cassandra as described in the official documentation as the "hybrid" storage:

DATABASE_TS_TYPE=cassandra
DATABASE_ENTITIES_TYPE=sql

Do you intend to evolve this repository so it can handle this common scenario? Thanks.

pon0marev commented 4 days ago

In ThingsBoard 3.0, the database architecture was redesigned, and the DATABASE_ENTITIES_TYPE variable was removed. Since version 3.0, all entities are stored only in the Postgres database, and DATABASE_TS_TYPE has cassandra, sql, or timescale parameters. Timescale database has shown no advantage over postgres, so there is no point in using it. Therefore, the DATABASE variable has 2 values: postgres (PostgreSQL) or hybrid (PostgreSQL for entities database and Cassandra for timeseries database)