Find all the information about how to set up your Postgre instance for Speculare.
Speculare is built on top of TimescaleDB which is built on top of Postgres and is an extremely scalable Relational / Timeseries Database.
As we need to use some advanced Postgres functionnality and to ease the development of our project, we rely on some features of Postgres that need to be enabled as well as some plugins. We'll cover here the configuration needed to be able to run Speculare correctly.
We strongly recommend you to use the version 13, but in theory any version above 10 should work just fine.
Install TimescaleDB 13 on Ubuntu
You can refer to this link from Timescale for installation on your system: docs of Timescale.
As a little tips, I suggest you to install timescaledb-tools. This will allow you to run:
The above command will offer you to apply certain settings to your Postgres instance.
You can then verify that Postgres has been installed correctly by running:
As you probably know, Postgres doesn't offer a realtime API to listen to change over a WebSocket or such. Because of that we had to develop a Capture Data Change service which listen to the WAL functionnality.
This feature allow us to get a stream of change which is then filtered and broadcasted over WebSocket to subscribed clients. This is done though Speculare-PGCDC.
Logical replication can be enabled by changing a few line in /etc/postgresql/13/main/postgresql.conf: