Skip to content

Data Flow Diagrams ​

Visual reference for how data moves through the Microtec ERP platform — from browser to storage, tenant database isolation, async message flows, and attachment handling.


Primary Request Data Flow ​

Every user action follows this path from browser to database and back.


Tenant Database Isolation ​

Each tenant operates in an entirely separate SQL database. There is no shared table or row-level isolation — complete database separation.

DataProtection Note

Connection strings in the AdminDB are encrypted using ASP.NET Core DataProtection. Keys are machine-specific. Migrating encrypted connection strings to a new server requires key migration — see Runbook: DataProtection Key Migration.

Database naming:

DatabasePurpose
MicrotecAdminTenant registry, global config, subscription management
Tenant_{tenantId}All ERP data for one tenant
Microtec_HangfireBackground job storage (shared across tenants)

Azure Service Bus Message Flow ​

Async inter-service communication uses Azure Service Bus topics with fan-out subscriptions.

Message envelope (all ASB messages):

json
{
  "messageId": "uuid",
  "correlationId": "request-correlation-id",
  "tenantId": "tenant-uuid",
  "occurredAt": "2026-05-30T10:00:00Z",
  "eventType": "InvoiceCreatedEvent",
  "payload": { "invoiceId": 42, "number": "INV-2026-001" }
}

Retry policy: 5 retries with exponential backoff (10s, 20s, 40s, 80s, 160s). After 5 failures, messages go to the dead-letter queue. The Platform team is alerted when DLQ count > 10.


Attachment Data Flow ​

Documents and files are handled by Attachment.Apis and stored in Azure Blob Storage — never in SQL.

Blob container structure:

{storage-account}/
└── attachments/
    └── {tenantId}/
        ├── invoices/{entityId}/{guid}.pdf
        ├── products/{entityId}/{guid}.png
        └── hr/{entityId}/{guid}.docx

Cache Data Flow ​

Redis sits in front of SQL for all read-heavy operations.

Cache key conventions:

PatternTTLExample
tenant:{id}:config1 hourTenant configuration
tenant:{id}:dropdown:{name}5 minutesCurrency/country dropdowns
user:{id}:permissions15 minutesRBAC permission set
rate:{ip}:{endpoint}1 minuteRate limiting counter
session:{token-hash}30 minutesSession data

Keycloak Token Flow ​

Authentication uses OIDC Authorization Code + PKCE flow.


Data Import Flow ​

Bulk data import (e.g., migrating customer records, opening balances) uses a dedicated async pipeline.


Observability Data Flow ​

All observability signals are collected and routed to environment-appropriate backends.


Summary: Data Store Responsibilities ​

Data StoreWhat is storedAccess patternIsolation
Azure SQL (per-tenant DB)All ERP business dataEF Core + DapperDatabase-per-tenant
Azure SQL (AdminDB)Tenant registry, encrypted conn stringsEF Core (AdminUoW)Shared — admin only
Azure Cache for RedisConfig cache, session, rate limitsIDistributedCacheKeyed by tenantId
Azure Blob StorageFile attachments, SBOM archives, reportsBlob SDK + SASNamespaced by tenantId
Azure Service BusIn-flight async messagesMassTransitTopic per domain event
MongoDB / Cosmos DBWorkflow engine state (flexible schema)MongoDB driverNamespaced by tenantId
Azure Key VaultSecrets, connection strings, certsManaged identityPer-environment

Internal Documentation — Microtec