Livoa LogoLivoa
WRITE PATH


(Handles: Create/Update/Delete Appointments)

GraphQL Mutation


createAppointment(input: {...})

Lambda: Appointment Handler


- Validates input

- Writes to Aurora PostgreSQL

EventBridge: Appointment Events


{

eventType: "APPOINTMENT_CREATED",

appointmentGuid: "abc-123",

tenantId: "tenant-xyz"

}

PROJECTION / VIEW BUILDER


(Event-Driven: Updates Read Model)

Lambda: Scheduler View Builder


- Listens to EventBridge

- Fetches related entities (Person, Provider)

- Builds denormalized record

DynamoDB: SchedulerView Table


PK: LOCATION#123#2025-01-20

SK: 09:00#APPT#abc-123

------------------------------------

appointmentGuid: "abc-123"

startTime: "2025-01-20T09:00:00Z"

endTime: "2025-01-20T10:00:00Z"

status: "confirmed"

# Denormalized Person Data (no joins!)

personName: "John Doe"

personPhone: "+1-555-1234"

personId: "person-456"

# Denormalized Provider Data

providerName: "Dr. Sarah Smith"

providerCredentials: "MD, PhD"

providerId: "provider-789"

# Denormalized Location Data

locationName: "Physical Therapy - Room 101"

locationAddress: "123 Main St"

# Denormalized Case Data

caseDescription: "Post-op PT"

caseStatus: "active"

# TTL for automatic cleanup

ttl: 1735689600 (90 days)

Global Secondary Indexes:

- GSI1: Provider + Date (provider schedule)

- GSI2: Person ID (patient's appointments)

READ PATH


(Handles: Query Appointments for Scheduler UI)

Frontend: GraphQL Query


getSchedulerView(

locationIds: ["location-123"],

date: "2025-01-20"

)

AppSync Resolver -> Lambda


- Constructs DynamoDB query

- Single partition key lookup

DynamoDB Query (Single Request!)


KeyConditionExpression:

PK = "LOCATION#123#2025-01-20"

Returns: All appointments with complete data

Response Time: < 50ms ⚡

Return to Frontend


- Zero joins

- Zero additional Lambda calls

- All data pre-computed and denormalized

proposal arch

by Mija

0
0 uses