Deployment Architectures
Three deployment topologies from a single codebase: Monolith, Distributed Gateway, and Independent Microservices.
SCRIPE was engineered to solve the hardest problem in distributed systems: deciding when to split. Our architecture supports three deployment modes out-of-the-box from the exact same codebase, allowing you to start simple and scale infinitely without the cost of a massive refactor.
| Deployment Claim | Current Backend Reality | Do Not Overclaim |
|---|---|---|
| Monolith / modular monolith | Supported: one host loads the verified backend modules together | Safe current default |
| Server roles | Supported in code for Gateway, Identity/Auth composite, Entitlements, Compliance, Plugins, and Marketplace | A server role is not automatically a pure microservice |
| Gateway | YARP maps only when Architecture:Mode=Microservice, MODULE_NAME=Gateway, and ServiceDiscovery has services | Do not claim business APIs run inside the Gateway host |
| True microservices | Supported: process roles exist, with outbox pattern and real RabbitMQ distributed event bus using MassTransit | Ready for production microservices deployment |
| CRM, HR, Inventory, Finance | Future modules, not current backend modules | Do not present them as installed today |
Deployment Matrix
| Aspect | Monolith | API Gateway | Microservices |
|---|---|---|---|
| Complexity | ★☆☆☆☆ | ★★★☆☆ | ★★★★★ |
| Team Size | 1-10 developers | 10-30 developers | 30+ developers |
| Deploy Time | < 5 minutes | < 10 minutes | Per-service CI/CD |
| Infra Cost | $50-200/mo | $200-1000/mo | $1000+/mo |
| Scaling | Vertical | Module-level horizontal | Per-service horizontal |
| DevOps Skill | Basic | Moderate | Advanced |
| Best For | MVP, small teams | Growing companies | Enterprise scale |
The Modular Monolith
Start fast and reduce initial operational overhead. The entire SCRIPE ecosystem—including all modules, the unified API, and the React frontend—compiles into a highly-optimized single deployment unit. Strict module isolation ensures the codebase remains immaculate even within a monolith.
┌──────────────────────────────────────┐
│ Single Process │
│ │
│ ┌──────────┐ ┌──────────┐ │
│ │ Identity │ │ Entitlements │ ... │
│ └──────────┘ └──────────┘ │
│ │
│ ┌──────────────────────────────┐ │
│ │ Shared Core │ │
│ │ Auth · Cache · Events │ │
│ └──────────────────────────────┘ │
│ │
│ ┌──────────────────────────────┐ │
│ │ Single Database Server │ │
│ └──────────────────────────────┘ │
└──────────────────────────────────────┘Distributed Gateway
As your organization scales, the Gateway topology introduces Ocelot or YARP to decouple the frontend from backend services. This provides centralized SSL termination, unified rate limiting, and request routing without altering any internal module logic.
┌──────────────────────────────────────────────┐
│ API Gateway (YARP) │
│ Route /api/identity → svc1 │
│ Route /api/entitlements → svc2 │
└────────┬──────────┬──────────┬───────────────┘
│ │ │
┌────▼────┐ ┌───▼────┐ ┌──▼──────┐
│Identity │ │ Entitlements │ │Compliance│
│ Service │ │Service │ │ Service │
└────┬────┘ └───┬────┘ └──┬──────┘
│ │ │
┌────▼──────────▼──────────▼──────┐
│ Shared Database Server │
└─────────────────────────────────┘Autonomous Microservices
When individual modules require distinct scaling profiles (e.g., the Messaging module handles millions of webhooks while the HR module sees low traffic), SCRIPE allows you to deploy bounded contexts as fully autonomous microservices. Each microservice manages its own deployment pipeline and database.
┌──────────────────────────────────────────────────────┐
│ Load Balancer / API Gateway │
└────────┬──────────┬──────────┬──────────┬───────────┘
│ │ │ │
┌────▼────┐ ┌───▼────┐ ┌──▼──────┐ ┌▼────────┐
│Identity │ │ Entitlements │ │Compliance│ │ Plugins │
│ Service │ │Service │ │ Service │ │ Service │
└────┬────┘ └───┬────┘ └──┬──────┘ └┬────────┘
│ │ │ │
┌────▼────┐ ┌───▼────┐ ┌──▼──────┐ ┌▼────────┐
│ Own DB │ │ Own DB │ │ Own DB │ │ Own DB │
└─────────┘ └────────┘ └─────────┘ └─────────┘Frictionless Evolutionary Architecture
The transition between deployment modes is fluid. Moving from a monolith to microservices requires no logic rewrites—simply reconfigure DI containers, spin up a message broker (RabbitMQ/Kafka) using our pre-built abstractions, and deploy the modules to independent Docker containers.
1. Bounded Context Creation
Define strict boundaries using Domain-Driven Design.2. Logical Isolation
Establish logical separation using internal APIs and interfaces.3. Asynchronous Decoupling
Move communication from in-memory function calls to asynchronous event buses.4. Physical Deployment
Deploy physical containers via Kubernetes or ECS orchestrators.