Database
Database
OpenSya relies on a flexible and scalable database architecture powered by MongoDB.
The database runtime is fully orchestrated by OpenSya through filesystem conventions, runtime discovery and generated typings.
Philosophy
Modern recruitment and business platforms handle highly dynamic and evolving data structures.
Examples include:
- Candidate profiles
- Job applications
- Pipelines
- Custom workflows
- HR data
- Activity logs
- Attachments
- Integrations
- Analytics
These structures evolve constantly between organizations and business domains.
Because of this, OpenSya prioritizes:
- Flexibility
- Scalability
- Rapid iteration
- Schema evolution
- Modular architecture
OpenSya is designed for evolving infrastructures rather than rigid database schemas. ::
Why MongoDB?
OpenSya uses MongoDB because it aligns naturally with the architecture and goals of the platform.
MongoDB provides several advantages for OpenSya infrastructures:
Flexible Schemas
Easily evolve data structures without complex migrations.
Modular Data
Perfect for modular architectures and independently evolving features.
Scalability
Built for scalable and distributed infrastructures.
Developer Experience
Strong integration with TypeScript and generated typings.
MongoDB allows OpenSya to model recruitment and business workflows with far less friction than traditional relational architectures.
Database Runtime
The database layer is orchestrated automatically by the OpenSya runtime.
server/database/
├── models/
└── plugins/
The runtime continuously discovers:
- Models
- Plugins
- Database definitions
- Runtime hooks
and automatically integrates them into the generated backend runtime.
Models
Models define application entities and business data structures.
Examples:
server/database/models/
├── user.ts
├── company.ts
├── apply.ts
Models are automatically discovered, registered and typed by the runtime.
Plugins
Plugins provide reusable database behaviors and extensions shared across models.
Examples:
server/database/plugins/
├── timestamps.ts
├── soft-delete.ts
├── slug.ts
└── audit.ts
Plugins allow infrastructures to remain modular and maintainable at scale.
Runtime Integration
The database runtime is deeply integrated into the OpenSya orchestration system.
During startup, OpenSya automatically:
- Discovers database definitions
- Registers models
- Loads plugins
- Generates typings
- Integrates the database layer into the backend runtime
Filesystem Discovery
↓
Model Registration
↓
Plugin Initialization
↓
Type Generation
↓
Runtime Integration
Database orchestration is fully managed by the OpenSya runtime. ::
Future Evolution
OpenSya currently focuses on MongoDB because it provides the best balance between flexibility, scalability and developer experience for recruitment infrastructures.
However, the architecture is intentionally designed to remain modular and extensible for future database integrations.