> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect to an Atoti project

> Overview of how to connect Atoti Limits to an Atoti project: Java and Python integration, Atoti UI, several Atoti servers, persistence, and performance tuning.

Atoti Limits runs as its own server and connects to the Atoti servers of your project. These pages explain how to connect it with the Java or Python API, show it in Atoti UI, connect more than one server, store limits in an external database, and tune performance.

## What do you need before you connect?

1. The Atoti server(s) you wish to connect to must contain a slicing date hierarchy. This hierarchy
   will be used by Atoti Limits when evaluating limits.
2. User and role configurations must be consistent between Atoti Limits and the connected
   Atoti server(s) in order to guarantee proper access control. We recommend placing your security
   configurations in a single module and referencing that module in both Atoti Limits and the
   Atoti server.

In order to start loading data and evaluating limits, Atoti Limits must be connected to your Atoti server.
Atoti Limits utilizes [Spring Auto-configuration](https://docs.spring.io/spring-boot/reference/using/auto-configuration.html)
to create the connection to your Atoti server, minimizing the amount of manual configuration required.
Atoti Limits also supports connections to multiple Atoti servers to allow for managing limits across multiple
applications in one place.

## How to externalize the connection properties

> [!NOTE]
>
> We recommend externalizing the connection properties into a profile for each Atoti server you wish to connect to
> Atoti Limits. This makes it easier to separate server-specific configurations.

Below are examples of property files that can be used to connect to Atoti FRTB and Atoti Market Risk:

> [accordion] application-frtb.yml
>
> ```yaml theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
> limits:
>   data-access-control:
>     servers:
>       FRTB:
>         role-permissions:
>           ROLE_RESTRICTED_USER:
>             structure-groups:
>               - Desk All PV
>   structure:
>     templates:
>       Book PV Structure:
>         template-name: Book PV Structure
>         server-name: FRTB
>         group: Book All PV
>         name: Book All PV
>         kpi-type: GREATER
>         polling-frequency: EOD
>         measure-name: PV
>         absolute-value-indicator: false
>         warning-threshold: 10
>         exception-workflow: Exception
>         limit-changes-workflow: StraightThrough
>         cube-name: StandardisedApproachCube
>         scope-keys:
>           - Book@Books@Booking
>
> activeviam:
>   apps:
>     inter-server-event-service:
>       issuer:
>         target-servers:
>           - name: FRTB
>             url: http://localhost:8080/frtb-starter
> ```

> [accordion] application-mr.yml
>
> ```yaml theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
> activeviam:
>   apps:
>     inter-server-event-service:
>       issuer:
>         target-servers:
>           - name: MR
>             url: http://localhost:10010/mr-application
> ```

> [!TIP]
>
> Refer to the [Atoti Limits Properties](https://docs.activeviam.com/atoti-intelligence/workflows/limits/6.2/reference/properties/config-properties/limits-activeviam.md) for more information on the specific properties used in the examples above.

With these files present, the profiles can then be activated by starting the application with
`-Dspring.profiles.active=frtb` or `-Dspring.profiles.active=mr` respectively, or `-Dspring.profiles.active=frtb,mr`
to connect Atoti Limits to both servers.
