What is distributed mode
In a distributed Atoti Server deployment, data is partitioned across multiple data nodes, with a query node coordinating requests. Atoti What-If supports this architecture by sending simulation operations to all data nodes via REST calls. When distributed mode is enabled, the starter creates aRestDistributedDatabaseService that:
- Discovers data node addresses from the distributed pivot
- Forwards database operations to all nodes
- Merges query results from multiple nodes
- Handles authentication using JWT tokens
Prerequisites
Before enabling distributed mode:- Your Atoti Server application must be configured for distribution
- A query node with
IMultiVersionDistributedActivePivotmust be available - JWT authentication must be configured
- Data nodes must expose the Database Service REST API
How to enable distributed mode
Add the following properties to yourapplication.yml:
query-node-name must match the name of your query node pivot as configured in your Atoti Server application.
Auto-configured beans
Whendistribution.enabled: true, the starter creates:
Configuration properties
How to provide a custom address supplier
By default, the starter discovers data node addresses from the distributed pivot. To use a custom address supplier:How to provide a custom authenticator
By default, JWT authentication is used. To provide a custom authenticator:How to provide a custom distributed database service
To replace the auto-configuredRestDistributedDatabaseService:
- Set
create-distributed-service: falsein your configuration:
- Define your custom bean:
How to customize result merging
TheDefaultDistributedQueryResultsMerger combines query results from all data nodes. To customize merging logic:
Error handling
TheRestDistributedDatabaseService throws:
ActiveViamRuntimeExceptionif no data node addresses are availableInternalServiceExceptionif operations on distributed nodes fail