relation-data-design

Design robust relation data bags for Juju charms.

1|Updated Feb 8, 2026
One-click install
npx skills add https://github.com/tonyandrewmeyer/cantrip --skill relation-data-design
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: relation-data-design
Source: https://github.com/tonyandrewmeyer/cantrip/tree/main/src/cantrip/skills/relation-data-design
Command: npx skills add https://github.com/tonyandrewmeyer/cantrip --skill relation-data-design

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Relation data bags are the primary mechanism for charms to exchange configuration, credentials, and status across relations. This skill provides a structured approach to designing robust app-wide and per-unit data bags for Juju charms, including clear guidance on scopes, data formats, and lifecycle patterns.

Core Features & Use Cases

  • Define application data and unit data bags with correct leader-writes and access controls.
  • Choose appropriate scopes and sides (provider, requirer, peer) for reliable inter-unit communication.
  • Follow best practices for data types, size limits, and secret handling across relationships.
  • Provide a ready-to-use template for charmcraft.yaml metadata and interface selection.

Quick Start

Apply this skill to design and implement relation data bags for Juju charm integrations in your project.

Frequently Asked Questions about relation-data-design

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design Juju relation data bags for multi-unit charms?

Design Juju relation data bags by defining separate application and unit data scopes, enforcing leader-writes for app data, and following best practices for key naming and string data storage to ensure predictable multi-unit communication.

What is the difference between application data and unit data in Juju relations?

Application data in Juju relations is written exclusively by the leader unit for app-wide configuration, while unit data is written by each unit individually to exchange per-unit status or credentials safely across relation boundaries.

How do I handle secrets and sensitive data in Juju charm relation data bags?

Handle secrets in Juju relation data bags by using guarded access patterns for sensitive information and leveraging leader-writes for application data, ensuring credentials and status are exchanged safely across relations without exposure.

What are the best practices for key naming and data types in Juju relation data?

Best practices for Juju relation data include using clear key naming conventions, storing only string data types, respecting size limits, and correctly handling the relation lifecycle to ensure reliable data exchange between charms.

Does this relation data approach work for cross-model Juju deployments?

Yes, this relation data design approach is applicable to cross-model Juju deployments, providing safe and predictable data exchange where per-unit and application-wide data must be managed across separate models.

When should I use peer relations versus provider or requirer relations for data exchange?

Use peer relations for inter-unit communication within the same Juju application, and choose provider or requirer sides for cross-application data exchange, ensuring correct scopes and access controls for reliable integration.