For the functioning of the system you should install the following tools
Installing the tools
Installing the tools
ClickHouse is an open-source column-oriented DBMS (columnar database management system) for online analytical processing (OLAP) that allows users to generate analytical reports using SQL queries in real-time.
Deploy ClickHouse in the local machine using Docker
This is docker-compose file that you can use for deploying of ClickHouse.
There is also README.md where you can see all commands to deploy ClickHouse.
Important:
Users (users.d):
User with access to DB deals_history:
password - deals_history.
DataBase deals_history and tables for working with deals_history. Catalog docker-entrypoint-initdb.d.
Example of docker-copmpose:
You can see the official doumentation for ClickHouse here:
For the installation of ClickHouse use the following:
NATS is a connective technology that powers modern distributed systems. A connective technology is responsible for addressing, discovery and exchanging of messages that drive the common patterns in distributed systems; asking and answering questions, aka services/microservices, and making and processing statements, or stream processing.
Software applications and services need to exchange data. NATS is an infrastructure that allows such data exchange, segmented in the form of messages. We call this a "message-oriented middleware.
This is docker-compose file for installing NATS where you should define login nats and password nats for the connection.
There is also README.md where you can see all commands to deploy NATS.
Example of docker-copmpose:
You can see the official doumentation for NATS here:
For the installation of NATS Server use the following:
2. Deploy NUTS in Kubernetes Cluster Use Helm chart.
Get more information in Official Documentation:
Creation of Stream in NATS
You can see the officail documentation about working with JetStream:
or you can use the following command for creation of JetStream in NATS:
If you need you can replace user and password on what you use.
If you need you can change localhost to ip where nats-server is situated.
While the command executing you will be asked questions about the JetStream settings. You can use the following:
? Stream Name DEALS
? Subjects RW-MANAGER.MT5-DEAL.>
? Storage file
? Replication 1
? Retention Policy Limits
? Discard Policy Old
? Stream Messages Limit 1000000
? Per Subject Messages Limit -1
? Total Stream Size -1
? Message TTL 1h
? Max Message Size -1
? Duplicate tracking time window 2m0s
? Allow message Roll-ups No
? Allow message deletion Yes
? Allow purging subjects or the entire stream Yes
Let's mention the main parameters:
Stream Name - the name of JetStream;
Subjects - subjects that will be in JetStream. You can use special symbol > for specifing any other symbols.
As confirmation of the creation of the JetStream, the following information will be displayed:
To make sure that JetStream was created you can execute the following command:
The result of the command:
After RWManager sends deals to JetStream the information will change:
To get information from JetStream you can execute the following command:
The result will display the JetStream list in which we want to view the message, select the DEALS we created:
? Select a Stream DEALS