Skip to main content
The migration helper is a set of REST endpoints that automate the one-off task of seeding a DirectQuery database from an existing in-memory Atoti Market Risk deployment.
The migration helper requires an in-memory data cube. It reads rows directly from the in-memory IDatastore and uses the runtime IActivePivotManagerDescription to generate schema-compatible DDL. It is therefore only available when the application starts with starter.deployment.type=in-memory (the default). It is intentionally not registered when:
  • starter.deployment.type=direct-query: there is no in-memory dataset to extract.
  • starter.deployment.type=query-node: query-only nodes do not host a data cube.

Typical workflow

  1. Start Atoti Market Risk in in-memory mode and load the dataset you want to migrate.
  2. Call the migration helper endpoints to produce the DDL and CSV files (see below).
  3. Apply the DDL to your target database and load the CSV files.
  4. Restart Atoti Market Risk with the DirectQuery profile pointing at the now-populated database (see Getting started).

Endpoints

The controller is mounted at host:port/mr-application/migrationHelper/ and exposes: Names are mapped through MrDirectQueryNameMapper, so tables and columns in the generated DDL follow the same convention as the runtime DirectQuery schema (e.g. TradePnLsTRADEPNLS, not TRADE_PN_LS). The following stores are excluded from the generated schema by default (see MRMigrationHelperRestController.getDefaultExtractionBuilder()):
  • Parent-child stores: BookParentChild, CounterpartyParentChild, LegalEntityParentChild: these are used to populate their hierarchy stores and are not needed in the DQ schema.
  • Summary cube base stores: BaseStore, SensiBaseStore, PnLBaseStore: summary cubes are not supported under DirectQuery.
  • The What-If simulation persistence table.
  • Atoti Sign-Off companion stores for TradePnLs, TradeSensitivities, PnL.
To customise the set of exported stores, subclass MRMigrationHelperRestController and override getDefaultExtractionBuilder().
POST /extract and POST /extractForDatabase/{database} declare consumes = application/json and produces = text/plain;charset=UTF-8. REST clients must send Content-Type: application/json; calls without this header will fail with HTTP 415 Unsupported Media Type.

Offline DDL generation

GET /migrationHelper/sqlSchema returns the DDL without opening a database connection or extracting data. It is useful to hand the schema to a DBA, to review the generated SQL in pull requests, or to bootstrap an environment where the target database is not yet provisioned.
If databaseName or schema are omitted, the controller falls back to the Spring properties directquery.database.<type>.database and directquery.database.<type>.schema (<type> being snowflake, mssql, or databricks), then to spring.application.name, and finally to the constants returned by getDatabaseName() / getSchemaName() on the controller. For Atoti Market Risk these resolve to MR_DATABASE and MR_SCHEMA (see MRMigrationHelperRestController). MSSQL’s schema property additionally has a built-in default of dbo; for Snowflake and Databricks, the corresponding Spring properties have no Java-side default: PUBLIC (Snowflake) and default (Databricks) are JDBC connection-level defaults applied by the database server, not Spring fallbacks.

Vector emulation modes

Atoti Market Risk contains four vector tables: TradePnLs, TradeSensitivities, SensiLadders, and MarketShifts. For each table you can choose how the migrator represents the vector fields in the target database: Modes can be selected at runtime through the REST endpoint, or programmatically on the Migrator bean:

Per-store, via REST

POST /migrationHelper/extract with body:
The autoRowSameTable flag opts every key-only-plus-vector table into ROW_SAME_TABLE automatically, useful when many of your stores fit that shape. Per-store entries in vectorStoreBehaviours always win over autoRowSameTable.

Per-store, on the Migrator bean

For COLUMN mode, schema discovery picks up the columns that actually exist in the live database and adjusts the in-memory schema accordingly, so existing tables continue to work regardless of the size configured here.The directquery.schema.default-vector-size property (default 250) and the columnVectorSizes extraction-DTO field are only consulted when discovery is skipped or cannot determine the size, typically during DDL generation via GET /migrationHelper/sqlSchema, where they decide how many indexed columns the freshly generated DDL contains. Once the DDL is applied and Atoti Market Risk starts against the populated database, discovery takes over and the property no longer has any effect on the column count.
To change the default used for DDL generation:

Configuration properties

Example: