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

# Data Architecture

> Cross-module overview of how Planning Center data is organized and interconnected in Parable

# Planning Center Data Architecture

## Overview

Parable integrates with **8 Planning Center modules**, each representing a different aspect of church management. This page provides a high-level view of how these modules connect and share data.

## Module Overview

<Frame>
  <img src="https://mintcdn.com/parable/dIkTtcPi0zjaWA0V/diagrams/planning-center/architecture-01.svg?fit=max&auto=format&n=dIkTtcPi0zjaWA0V&q=85&s=510059f122c024a35ed6ce5fa8e35ac7" alt="Planning Center modules and their relationships" width="2021" height="620" data-path="diagrams/planning-center/architecture-01.svg" />
</Frame>

[Open diagram in new tab →](/diagrams/planning-center/architecture-01.svg)

## Module Interconnections

### People as the Central Hub

The **People module** is the foundation of the entire system. Nearly every other module references people in various roles:

* **Giving**: People as donors, joint givers, and batch creators
* **Groups**: People as group members, leaders, and owners
* **Check-ins**: People checking in to events
* **Services**: People as team members, leaders, and plan assignees
* **Calendar**: People as event creators and resource bookers
* **Registrations**: People as registrants and attendees
* **Publishing**: People as speakers and content creators

**Key Principles:**

1. **Sequential Processing**: Workflows execute sequentially to respect dependencies (People before Giving, etc.)
2. **Bulk Operations**: Data is collected and inserted in batches for performance
3. **Multi-tenant Isolation**: Row-level security ensures tenant data separation
4. **Heartbeat Pattern**: Long-running activities send heartbeats to prevent timeouts

## Database Schema Organization

All Planning Center data is stored in the `planning_center` schema with prefixed table names:

```
planning_center.{module}_{entity}
```

### Examples

* `planning_center.people_people` - People entities
* `planning_center.people_households` - Household entities
* `planning_center.giving_donations` - Donation entities
* `planning_center.groups_groups` - Group entities
* `planning_center.services_plans` - Service plan entities

### Common Patterns Across All Modules

Every table follows these patterns:

#### System Fields

All tables include:

* `system_status` - All tables have a `system_status` column that filters to only show `active` records
* `system_created_at` - When record was first created
* `system_updated_at` - Last modification timestamp
* `tenant_organization_id` - All tables have a `tenant_organization_id` column that filters to only show records for the current organization

#### Entity ID Pattern

All entities store their Planning Center ID:

* `{entity}_id` - Original Planning Center identifier (e.g., `people_id`, `donation_id`)

#### Row Level Security (RLS)

All tables have RLS policies that automatically:

* Filter data by current database role
* Ensure tenant isolation
* Restrict access to `system_status = 'active'` records

## Module Details

### People Module (84 tables)

**Core Entities:**

* People, Households, Household Memberships
* Addresses, Emails, Phone Numbers
* Campuses, Organizations
* Forms, Form Submissions
* Workflows, Workflow Cards
* Lists, Notes, Messages

**Complexity**: Highest - manages the foundational identity layer

**Key Relationship Pattern**: Heavy use of relationship tables for flexible associations

### Giving Module (24 tables)

**Core Entities:**

* Donations, Batches, Batch Groups
* Pledges, Pledge Campaigns
* Recurring Donations, Refunds
* Designations, Funds
* Payment Methods, Payment Sources

**Dependencies**: Requires People (donors), Campuses

**Key Feature**: Financial transaction tracking with audit trails

### Groups Module (25 tables)

**Core Entities:**

* Groups, Group Types
* Memberships, Enrollments
* Events, Event Notes, Attendance
* Locations, Resources, Tags

**Dependencies**: Requires People (members, leaders)

**Key Feature**: Community organization and event management

### Check-ins Module (26 tables)

**Core Entities:**

* Check-ins, Check-in Groups
* Events, Event Times, Event Periods
* Locations, Location Labels
* Person Events, Attendance Types
* Stations, Passes, Themes

**Dependencies**: Requires People (attendees), Events

**Key Feature**: Event attendance tracking with label printing

### Services Module (55+ tables)

**Core Entities:**

* Service Types, Plans, Plan Times
* Teams, Team Positions
* Songs, Arrangements, Keys
* Items, Media, Schedules
* Blockouts, Signup Sheets

**Dependencies**: Requires People (team members), potentially Groups

**Key Feature**: Complex worship service planning

### Calendar Module (27 tables)

**Core Entities:**

* Events, Event Instances, Event Times
* Resources, Resource Bookings
* Room Setups, Resource Questions
* Conflicts, Attachments, Feeds

**Dependencies**: Integrates with Groups, Services, Check-ins events

**Key Feature**: Centralized event and resource management

### Registrations Module (14 tables)

**Core Entities:**

* Registrations, Signups
* Attendees, Emergency Contacts
* Categories, Selection Types
* Locations, Campuses

**Dependencies**: Requires People (registrants)

**Key Feature**: Event registration and attendee management

### Publishing Module (15 tables)

**Core Entities:**

* Channels, Channel Times
* Episodes, Episode Times, Episode Resources
* Series, Speakers, Speakerships
* Note Templates

**Dependencies**: Requires People (speakers), potentially Services (sermons)

**Key Feature**: Sermon and content publishing workflow

## Performance Characteristics

### Table Sizes (Approximate)

Based on typical church databases:

| Module        | Tables | Est. Rows (Small Church) | Est. Rows (Large Church) |
| ------------- | ------ | ------------------------ | ------------------------ |
| People        | 84     | 10K - 50K                | 500K - 2M                |
| Giving        | 24     | 5K - 20K                 | 200K - 1M                |
| Groups        | 25     | 1K - 5K                  | 50K - 200K               |
| Check-ins     | 26     | 5K - 20K                 | 100K - 500K              |
| Services      | 55+    | 2K - 10K                 | 50K - 200K               |
| Calendar      | 27     | 1K - 5K                  | 20K - 100K               |
| Registrations | 14     | 500 - 2K                 | 10K - 50K                |
| Publishing    | 15     | 100 - 1K                 | 5K - 20K                 |

### Sync Performance

* **Full sync time**: 5 minutes - 2 hours (depends on data size)
* **Typical interval**: Every 24 hours
* **Bulk insert performance**: 1K-10K rows/second per table

## Multi-Tenant Architecture

### Tenant Isolation

<Frame>
  <img src="https://mintcdn.com/parable/dIkTtcPi0zjaWA0V/diagrams/planning-center/architecture-02.svg?fit=max&auto=format&n=dIkTtcPi0zjaWA0V&q=85&s=1b92b76f1b5be6e0ce2dbd4819b3e2dc" alt="Multi-tenant architecture with row-level security" width="737" height="774" data-path="diagrams/planning-center/architecture-02.svg" />
</Frame>

[Open diagram in new tab →](/diagrams/planning-center/architecture-02.svg)

**Key Security Features:**

1. **Role-based access**: Each tenant has a dedicated database role
2. **Automatic filtering**: Views filter by `CURRENT_ROLE` to show only tenant's data
3. **No cross-tenant queries**: Impossible to access other tenants' data
4. **Schema-level isolation**: All Planning Center data in dedicated schema

## Common Query Patterns

### Cross-Module Queries

**Example: Find all donations from a specific group's members**

```sql theme={null}
-- Get all donations from small group members
WITH group_members AS (
    SELECT DISTINCT person_id
    FROM planning_center.groups_memberships_view
    WHERE group_id = 'group_123'
)
SELECT
    p.first_name,
    p.last_name,
    d.amount_cents / 100.0 AS amount,
    d.received_at,
    f.name AS fund_name
FROM group_members gm
JOIN planning_center.people_people_view p
    ON gm.person_id = p.people_id
JOIN planning_center.giving_donation_relationships_view dr
    ON p.people_id = dr.relationship_id
    AND dr.relationship_type = 'person'  -- Via relationship table
JOIN planning_center.giving_donations_view d
    ON dr.donation_id = d.donation_id
JOIN planning_center.giving_designations_view des
    ON d.donation_id = des.donation_id
JOIN planning_center.giving_funds_view f
    ON des.fund_id = f.fund_id
WHERE d.received_at >= '2024-01-01'
ORDER BY d.received_at DESC;
```

**Example: Find people who are both group leaders and service team members**

```sql theme={null}
-- Find people serving in both groups and services
WITH group_leaders AS (
    SELECT DISTINCT person_id
    FROM planning_center.groups_memberships_view
    WHERE role = 'leader'
),
service_team AS (
    SELECT DISTINCT person_id
    FROM planning_center.services_plan_people_view
    WHERE status = 'C'  -- Confirmed
)
SELECT
    p.first_name,
    p.last_name,
    p.primary_email AS email,
    COUNT(DISTINCT gm.group_id) AS groups_led,
    COUNT(DISTINCT pp.plan_id) AS services_on
FROM planning_center.people_people_view p
JOIN group_leaders gl ON p.people_id = gl.person_id
JOIN service_team st ON p.people_id = st.person_id
LEFT JOIN planning_center.groups_memberships_view gm
    ON p.people_id = gm.person_id AND gm.role = 'leader'
LEFT JOIN planning_center.services_plan_people_view pp
    ON p.people_id = pp.person_id
GROUP BY p.people_id, p.first_name, p.last_name, p.primary_email
ORDER BY groups_led DESC, services_on DESC;
```

## Next Steps

Explore specific module data models:

<CardGroup cols={2}>
  <Card title="People Data Model" icon="user" href="/planning-center/people/data-model">
    Core identity and household management
  </Card>

  <Card title="Giving Data Model" icon="dollar-sign" href="/planning-center/giving/data-model">
    Donations, pledges, and financial tracking
  </Card>

  <Card title="Groups Data Model" icon="users" href="/planning-center/groups/data-model">
    Small groups and community organization
  </Card>

  <Card title="Check-ins Data Model" icon="check" href="/planning-center/check-ins/data-model">
    Event attendance and check-in tracking
  </Card>

  <Card title="Services Data Model" icon="music" href="/planning-center/services/data-model">
    Worship service planning and teams
  </Card>

  <Card title="Calendar Data Model" icon="calendar" href="/planning-center/calendar/data-model">
    Event scheduling and resource booking
  </Card>

  <Card title="Registrations Data Model" icon="clipboard" href="/planning-center/registrations/data-model">
    Event registration and signups
  </Card>

  <Card title="Publishing Data Model" icon="video" href="/planning-center/publishing/data-model">
    Sermon and content publishing
  </Card>
</CardGroup>

## Additional Resources

<Card title="API Reference" icon="code" href="/api-reference/introduction">
  Query the Planning Center data via API
</Card>
