Skip to main content

Source: ocean/docs/adr/0049-ebisu-repository-separation.md | ✏️ Edit on GitHub

ADR-0049: Separate Repository for Ebisu Master Database

Status

Accepted

Context

The Ebisu master database contains industry reference data (ASFIS, WoRMS, ITIS, vessel data, etc.) that serves as the authoritative data source for tenant databases. Currently, the ebisu-database directory exists within the Ocean monorepo, but this creates several challenges:

  1. Different deployment targets: Ocean deploys to Supabase/Vercel, while Ebisu deploys to Crunchy Bridge
  2. Different technology stacks: Ocean uses React/Edge Functions, while Ebisu uses Drizzle ORM/PostgreSQL schemas
  3. Repository size: Ebisu contains large data import files that increase Ocean's repository size
  4. CI/CD performance: Running tests and deployments for both systems together slows down development
  5. Access control: Different teams may need access to one system but not the other

Decision

We will maintain Ebisu as a separate repository at github.com/goldfish-inc/ebisu while keeping Ocean at github.com/goldfish-inc/ocean.

Repository Structure

github.com/goldfish-inc/
├── ocean/ # Main application repository
│ ├── src/ # React application
│ ├── supabase/ # Edge functions, migrations
│ └── docs/ # Ocean-specific documentation

└── ebisu/ # Master database repository
├── src/ # Drizzle schemas
├── scripts/ # Data import scripts
├── migrations/ # Schema migrations
└── docs/ # Data documentation

Consequences

Positive

  • Clear separation of concerns: Each repository has a single, well-defined purpose
  • Independent versioning: Ocean and Ebisu can evolve at different rates
  • Smaller repository sizes: Faster clones and better CI/CD performance
  • Better security boundaries: Different access controls for application vs. reference data
  • Cleaner git history: Data import logs don't clutter application development history
  • Focused development: Developers can work on one system without the complexity of the other

Negative

  • Cross-repository coordination: Changes affecting both systems require coordination
  • Duplicated tooling: Some development tools may need to be configured in both repositories
  • Shared type definitions: TypeScript types used by both systems need careful management

Mitigation Strategies

  1. Shared Types: If types need to be shared between repositories:

    • Create an npm package @goldfish-inc/ebisu-types
    • Or use GitHub Packages for private type sharing
  2. Cross-Repository Testing:

    • Use GitHub Actions to trigger integration tests when either repository changes
    • Maintain a separate integration-tests repository if needed
  3. Documentation:

    • Maintain clear documentation in both repositories about their relationship
    • Use consistent ADR numbering with prefixes (OCEAN-xxx, EBISU-xxx)

Implementation

  1. Create new repository:

    git remote add origin git@github.com:goldfish-inc/ebisu.git
    git push -u origin main
  2. Update Ocean's .gitignore:

    # Ignore local ebisu development
    /ebisu-database/
    /ebisu/
  3. Configure GitHub Secrets in both repositories:

    • Ocean: Needs Ebisu connection details for replication
    • Ebisu: Needs Neon connection details for tenant provisioning
  4. Update CI/CD workflows:

    • Ocean: Remove any Ebisu-specific build steps
    • Ebisu: Create new workflows for schema deployment to Crunchy Bridge

References