Skip to content

Requirements for ScaleTrade Report Modules

Best practices and mandatory requirements for developing ScaleTrade report plugins under Linux.


Overview

ScaleTrade report modules operate within the server address space and are tightly coupled with the trading engine.
Because of this, developers must follow strict performance, stability, and compatibility standards to ensure reliable operation of report plugins.

Platform Note

ScaleTrade runs natively on Linux (x86_64). Report modules are implemented as shared libraries (.so), not DLLs.


Compatibility

Each module must match the bitness of the server it runs on.

Server Type Required Module
64-bit Server 64-bit Report Module
32-bit Server 32-bit Report Module

Architecture Mismatch

A 64-bit report module cannot be loaded on a 32-bit server — and vice versa.
Always compile and distribute both builds when targeting multiple architectures.

Recommended Naming Convention

report_module.so      # 32-bit build
report_module64.so    # 64-bit build

Memory Management

Since report modules execute inside the ScaleTrade server’s memory space, they must follow strict memory safety guidelines:

  • Efficient Memory Use
    Use memory allocations only when necessary and prefer stack allocation where possible.
  • :material-fragment:{ .lg .middle } Avoid Fragmentation
    Minimize heap fragmentation by reusing buffers and avoiding excessive dynamic allocation.
  • No Memory Leaks
    Every allocated resource must be released. Use RAII patterns and smart pointers when coding in C++.

Recommended Practice (C++)

std::vector<ReportData> data;
data.reserve(1024);  // preallocate memory efficiently

Failure to comply with these principles can lead to server instability, degraded performance, or crashes.


Exception Handling

A report module must never produce unhandled exceptions.

Requirement Description
All exceptions must be caught and handled gracefully.
The server should never terminate due to a module fault.
Use logging to capture unexpected states for post-mortem debugging.

Example

try {
    GenerateReport();
} catch (const std::exception& e) {
    log_error("Report module error: {}", e.what());
    return MODULE_FAILURE;
}

Performance and Responsiveness

A well-written ScaleTrade report module must quickly return control to the server after handling any event or callback.
Long blocking operations (e.g., database queries or heavy computations) should be handled asynchronously.

Responsiveness

  • Avoid blocking I/O operations inside event hooks.
  • Keep your processing time per request under 200 ms where possible.
  • Use non-blocking APIs and worker threads for long tasks.

Summary

  • Ensure bitness compatibility (32/64-bit match with the server).
  • Optimize for memory efficiency and low fragmentation.
  • Prevent any unhandled exceptions.
  • Return control quickly from event handlers.
  • Follow Linux-native shared library (.so) deployment practices.

SEO and Metadata

SEO Element Content
Title ScaleTrade Report API — Module Development Requirements
Description Developer guide outlining key requirements for creating ScaleTrade report modules under Linux, including memory management, performance, and stability.
Keywords ScaleTrade, report module, development guide, Report API, Linux, C++, memory management, performance optimization
Audience C++ developers, brokerage IT engineers, platform integrators
Platform Linux (x86_64) — ScaleTrade distributed trading architecture

Back to Documentation Home