# Platform Federation

---

{{% callout style="info" %}}
Platform Federation for self-managed deployments is available in early access. Contact JFrog Customer Success to join.
{{% /callout %}}

{{% include file="common-pages/platform-federation.md" %}}

## Key Capabilities

- **Manage once, apply everywhere**: Automate global administration across all distributed sites and eliminate manual overhead
- **Repository provisioning (future release)**: Map the global stages to sites once. Repositories are provisioned automatically on every site mapped to their stage
- **Zero configuration drift**: Monitor the federation in real time and reconcile drift as soon as it appears

## What Gets Synced

- **Global Entities**: Platform entities and configurations, including Projects, stages and roles, access control and policies
- **Repositories (future release)**: Repositories will be provisioned on the member sites from the main site, according to the Stage to Site mapping:
  - **Local repositories**: Configuration and artifacts are federated. The artifacts are kept in sync using Federated Repositories
  - **Remote and virtual repositories**: Configuration only is federated
- **Curation policies**: Already supported as part of [Curation Federation](https://docs.jfrog.com/administration/docs/curation-federation), currently as a standalone solution. Curation Federation is planned to be included in Platform Federation

## Architecture

Platform Federation is implemented by the following services, together with the Artifactory service on each site:

- **Grid Service**: Runs on the main site and orchestrates the Platform Federation. It manages the member sites, validates them before they join (health, connectivity, Circle of Trust and entitlement), and monitors the sync events. In a future release, it will also orchestrate the repositories, provisioning them on the member sites through the Artifactory service, according to the Stage to Site mapping
- **PFED (Platform Federation Service)**: Runs on every member site. Syncs the Global Entities directly with the other member sites. Messages are queued and retried, so a site that was offline catches up automatically when it returns
- **RTFS (Artifactory Federation Service)**: Runs on every member site. Syncs the artifacts of the provisioned local repositories between the sites

```mermaid
flowchart LR
    A["JFrog Self-Managed<br/>Main Site<br/>(Artifactory, Grid, PFED, RTFS)"]
    B["JFrog Self-Managed<br/>Site B<br/>(Artifactory, PFED, RTFS)"]
    C["JFrog Self-Managed<br/>Site C<br/>(Artifactory, PFED, RTFS)"]
    A <-- "Global Entities" --> B
    B <-- "Global Entities" --> C
    A <-- "Global Entities" --> C
    A -. "Repository provisioning" .-> B
    A -. "Repository provisioning" .-> C
```

Each site is a single JFrog Platform deployment built from several microservices: Artifactory, PFED and RTFS on every site, plus the Grid Service on the main site. Solid lines are the Global Entities sync by PFED, a full mesh between all member sites. Dotted lines are the repository provisioning by the Grid Service.

- Every member site must be able to reach all other member sites, as the PFED and RTFS services sync peer-to-peer
- Each site must have a unique base URL. See [Multi-Site](../) considerations for using a common URL across sites

## Resources

The Grid, PFED, and RTFS services that operate Platform Federation run on every member site, and the JFBus service is also required. These services add to the site footprint, and their sizing files are included in the Grid Helm Chart used for Kubernetes installation.

{{% include file="common-pages/platform-federation-guidelines.md" %}}

## Implementation Guidelines

- **Prerequisites**: Enterprise+ subscription with the Platform Federation entitlement, and all sites live and in the same Circle of Trust
- **Align before joining**: When a Platform Federation is created, or a site is added to it, the most recent value of each Global Entity is applied to all member sites. Overwritten values cannot be restored, so align the configuration of the sites in advance
- **Mesh topology and uniform configuration**: All member sites sync with each other as peers, and all Global Entities are synced to all of them, with no filtering or mapping per site
- **One Platform Federation per site**: A site can be a member of only one Platform Federation
- **Existing federation**: Federated Repositories and [Curation Federation](https://docs.jfrog.com/administration/docs/curation-federation) keep working on sites that join a Platform Federation
- **Impact of removing a site**: A removed site keeps the last synced configuration, and stops sending and receiving updates
