Back to All Projects
CASE STUDY·Rastafan Co.·Software Architecture·2021 — 2026

Modular Enterprise ERP

Domain-driven architecture, enterprise REST APIs, and systematic performance optimization

ASP.NET CoreDDDClean ArchitectureAngularMS SQL ServerPerformance

01 — Overview

Between 2021 and 2026, I served as Lead Software Engineer at Rastafan Co., leading the architectural design and backend engineering of a commercial modular ERP platform built on ASP.NET Core, Angular, and MS SQL Server[cite: 6].

The platform supports multi-department enterprise operations—spanning accounting, inventory control, sales, procurement, and executive reporting—serving organizations that require high transactional reliability and rapid customization[cite: 6].

02 — Business Challenge

As commercial adoption expanded and customer databases grew into millions of ledger and inventory rows, two structural bottlenecks threatened platform scalability:

  • Feature Coupling: Rapid client-driven customizations risked creating tight dependencies across accounting, warehouse, and sales logic.
  • Query & API Degradation: Heavy multi-table financial aggregations and unoptimized ORM access patterns caused peak API latency to reach 20 seconds, while critical end-of-period reports took up to 10 minutes to complete[cite: 6].

03 — Architecture

To support independent module evolution without sacrificing transactional consistency, we structured the backend around Clean Architecture and Domain-Driven Design (DDD) principles[cite: 6].

Architecture Blueprint · Modular Enterprise ERP75% Latency Reduction
Angular SPAEnterprise Web ClientASP.NET CoreREST API LayerAuth · Caching · Rate LimitDDD BOUNDED CONTEXTSCore AccountingInventory & SupplySales & TreasuryReporting EngineSQL ServerIndexed Views &Query Tuning
Fig 1. Decoupled DDD module boundaries backed by optimized SQL Server execution plans.

Architectural Structure

  • Domain-Centric Bounded Contexts: Core business rules for Accounting, Inventory, Treasury, and Sales were isolated inside pure domain layers free of UI or database coupling.
  • Standardized REST API Layer: Versioned ASP.NET Core APIs enforcing consistent DTO contracts, role-based authorization, and validation pipelines.
  • Read/Write Separation for Heavy Reporting: Transactional writes remained strictly normalized, while analytical reports were offloaded to tuned SQL Server execution paths and indexed projection views.

04 — Engineering Decisions

  • Pragmatic Modular Monolith Over Premature Microservices: Given our team size and the strong transactional consistency required between accounting entries and inventory movements, a well-structured modular monolith delivered the maintainability of DDD without distributed transaction overhead.
  • Targeted SQL & Execution Plan Profiling: Rather than throwing hardware at slow endpoints, we profiled real production workloads, eliminated N+1 ORM queries, redesigned composite indexes, and refactored bottleneck stored procedures.
  • Engineering Mentorship: Established code review checklists and architectural katas to align the team around SOLID principles and clean separation of concerns[cite: 6].

05 — Implementation

We rolled out architectural refactoring and performance tuning incrementally alongside regular feature releases:

  1. Telemetry & Baseline Profiling: Instrumented API middleware to capture p95/p99 latencies and identify the top 15 slowest database queries across customer workloads.
  2. Domain Refactoring: Extracted scattered business validations into explicit domain services and aggregate roots, making business rules testable in isolation.
  3. Query & Caching Optimization: Rewrote heavy reporting pipelines and introduced selective caching for high-read reference data (chart of accounts, tax rules, and permissions).

06 — Results & Evaluation

  • 75% Faster API Latency: Core ERP endpoint response times dropped from 20 seconds down to 5 seconds under peak concurrency[cite: 6].
  • Over 80% Faster Critical Reporting: Mission-critical financial reports that previously blocked users for 10 minutes now execute in under 2 minutes[cite: 6].
  • Higher Team Velocity: Clear module boundaries enabled parallel feature development with significantly fewer regression bugs across releases.

Building something similar for your organization?

Let's discuss enterprise AI architecture, RAG pipelines, or ERP integration.

Discuss Architecture