Skip to content

Splitwise — Detailed#

flowchart TB
  subgraph Apps
    APP
    WEB
  end

  subgraph Edge
    CDN
    GW
  end

  subgraph Domain
    USR[Users]
    GRP[Groups + memberships]
    EXP[Expense Service]
    SPLIT[Splitter<br/>equal / unequal / shares / percentage / exact]
    CAT[Categories]
    CURR[Currency / FX]
    REC([Receipt OCR])
    OBJ[Image store]
  end

  subgraph Ledger
    JE[(Journal entries<br/>per-pair balance)]
    BAL[Pair balance materialized]
    GROUP_BAL[Group balance]
    SETTLE[Simplify-debts algorithm]
    PAYREC[Settle Up records]
  end

  subgraph Notif
    PUSH
    EMAIL
    REMIND[Reminders]
  end

  subgraph Sync
    OFF[Offline support]
    CONF[Conflict resolution<br/>last-writer-wins / per-expense version]
  end

  subgraph Integration
    UPI_LINK[UPI / payment link out]
    EXPORT[CSV / Excel export]
  end

  Apps --> CDN --> GW --> Domain
  Domain --> Ledger
  Ledger --> Notif
  Integration --- Ledger

    classDef client fill:#dbeafe,stroke:#1e40af,stroke-width:1px,color:#0f172a;
    classDef edge fill:#cffafe,stroke:#0e7490,stroke-width:1px,color:#0f172a;
    classDef service fill:#fef3c7,stroke:#92400e,stroke-width:1px,color:#0f172a;
    classDef datastore fill:#fee2e2,stroke:#991b1b,stroke-width:1px,color:#0f172a;
    classDef cache fill:#fed7aa,stroke:#9a3412,stroke-width:1px,color:#0f172a;
    classDef queue fill:#ede9fe,stroke:#5b21b6,stroke-width:1px,color:#0f172a;
    classDef compute fill:#d1fae5,stroke:#065f46,stroke-width:1px,color:#0f172a;
    classDef storage fill:#e5e7eb,stroke:#374151,stroke-width:1px,color:#0f172a;
    classDef external fill:#fce7f3,stroke:#9d174d,stroke-width:1px,color:#0f172a;
    classDef obs fill:#f3e8ff,stroke:#6b21a8,stroke-width:1px,color:#0f172a;
    class USR,GRP,EXP,SPLIT,CAT,CURR,BAL,GROUP_BAL,SETTLE,PAYREC,REMIND,OFF,CONF,UPI_LINK,EXPORT service;
    class OBJ,JE datastore;
    class REC compute;

Data model#

  • One expense → many participants with share_amount.
  • Each expense generates symmetric journal entries between payer and others.
  • Per-pair balance = sum of (i,j) - sum of (j,i).
  • Group balance = sum of pair balances within group.

Simplify debts#

  • Net all pair balances within a group.
  • Reduce to minimum number of payments: classic flow / greedy net-positions algorithm.

Multi-currency#

  • Each expense in original currency; store exchange rate snapshot at create.
  • Recompute display in user's preferred currency.

Glossary & fundamentals#

Concepts referenced in this design. Each row links to its canonical page; the tag column shows whether it is a high-level (HLD) or low-level (LLD) concept.

Tag Concept What it is Page
HLD CDN edge caching for static assets cdn