Reporting DB
The Reporting DB is a read-only replica of the production PostgreSQL database used by the cTrader backend. The replica can provide near real-time information about key server entities including traders, groups, balance operation histories, etc.
If you are a non-broker entity, you cannot work with white labels through the Reporting DB. Please use other APIs or contact us at partners@spotware.com for clarifications.
How the Reporting DB Works
The Reporting DB is a relational database that you can connect to using any DB client that supports the PostgreSQL (Postgres) system.
After establishing a connection, the Reporting DB can be interacted with by simply sending SQL queries to it. As a result, the Reporting DB can be easily integrated in any existing SQL-based reporting system you have. Alternatively, you may use it as a foundation of a new custom reporting service.
Note that the Reporting DB only allows for performing 'READ' operations out of all standard CRUD operations.
The servers for the Reporting DB and the main production databases used by the cTrader backend are geographically dispersed, meaning that there may be some latency in communications between the 'main' database and its replica. On average, this latency should not exceed one (1) second; however, in some cases, it may reach 30 seconds. This also means that if anything happens to the 'main' production database, the Reporting DB should still remain in operation and contain data that was valid prior to the outage.
Key Use Cases
The Reporting DB is similar in function to the Reporting API in that it can be used to receive up-to-date information on all major server entities. Compared to the Reporting API, however, integration with the Reporting DB is less demanding in terms of development costs. We recommend integrating with the Reporting DB (rather than the Reporting API) in the following cases.
- When you want to implement a reporting solution where using real-time data is not required.
- When you need to investigate trading data for a particular period to handle a trade dispute.
- When you need to conduct an in-depth analysis of past data (e.g., to identify trends in traded symbols).
- When you want to add new analytics to your CRM suite that are not provided as part of the WebServices API (e.g., balance history).
The Reporting DB does not contain real-time information on position P&L, account equity, and similar statistics. If it is imperative for you to receive any changes to such data in real-time, we recommend integrating with the Reporting API.
Structure of the Documentation
The Reporting DB documentation includes the following guides.