Database Infrastructure
Tarasol uses a multi-database strategy with Microsoft SQL Server as the primary relational store, MongoDB for document-oriented data, and Redis for caching.
Microsoft SQL Server
Multi-Tenant Provisioning
Each tenant gets an isolated database. The provisioning flow:
Tenant Database Provisioning
Loading diagram...
Key Databases
| Database | Purpose | ORM |
|---|---|---|
Tarasol.MultiTenancy | Central tenant configs | Sequelize |
Tarasol.Administration | Users, roles, permissions | Sequelize |
Tarasol.[TenantName] | Tenant business data | Sequelize |
Connection Configuration
| Name | Type | Default | Description |
|---|---|---|---|
| DB_HOST | string | localhost | SQL Server hostname |
| DB_PORT | number | 1433 | SQL Server port |
| DB_USERNAME | string | sa | Database username |
| DB_PASSWORD | string | - | Database password |
| DB_POOL_MAX | number | 10 | Max connections per pool |
| DB_POOL_MIN | number | 5 | Min connections per pool |
| DB_POOL_IDLE | number | 10000 | Idle timeout (ms) |
MongoDB
Used by Identity Service, Post Office, and Session Manager for flexible document storage.
Connection Configuration
| Name | Type | Default | Description |
|---|---|---|---|
| MONGO_URI | string | mongodb://localhost:27017/tarasol | MongoDB connection string |
| MONGO_DB_NAME | string | tarasol | Database name |
# Docker setup
docker run -d --name mongodb \
-p 27017:27017 \
mongo:6
⚠Warning
Always back up tenant databases before running migrations. The migration scripts modify schema in-place and are not reversible.