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:
- Different deployment targets: Ocean deploys to Supabase/Vercel, while Ebisu deploys to Crunchy Bridge
- Different technology stacks: Ocean uses React/Edge Functions, while Ebisu uses Drizzle ORM/PostgreSQL schemas
- Repository size: Ebisu contains large data import files that increase Ocean's repository size
- CI/CD performance: Running tests and deployments for both systems together slows down development
- 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
-
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
- Create an npm package
-
Cross-Repository Testing:
- Use GitHub Actions to trigger integration tests when either repository changes
- Maintain a separate
integration-testsrepository if needed
-
Documentation:
- Maintain clear documentation in both repositories about their relationship
- Use consistent ADR numbering with prefixes (OCEAN-xxx, EBISU-xxx)
Implementation
-
Create new repository:
git remote add origin git@github.com:goldfish-inc/ebisu.git
git push -u origin main -
Update Ocean's .gitignore:
# Ignore local ebisu development
/ebisu-database/
/ebisu/ -
Configure GitHub Secrets in both repositories:
- Ocean: Needs Ebisu connection details for replication
- Ebisu: Needs Neon connection details for tenant provisioning
-
Update CI/CD workflows:
- Ocean: Remove any Ebisu-specific build steps
- Ebisu: Create new workflows for schema deployment to Crunchy Bridge
References
- ADR-0047: Ebisu Data Warehouse Integration (defines the logical replication architecture)
- ADR-0048: Logical Replication Implementation Review
- Crunchy Bridge Documentation: https://docs.crunchybridge.com/
- Drizzle ORM Documentation: https://orm.drizzle.team/