[CAD_REF // 39.9334° N, 32.8597° E] + POSTGRES_KERNEL_ACTIVE
SYSTEM ARCHITECTURE BLUEPRINT // SPECIFICATION V2.4

Engineering Sovereignty Over SaaS Tenancy.

We design, build, and hand over mission-critical bespoke software systems with 100% source code, database, and infrastructure ownership. Here is the technical blueprint that powers our high-throughput vertical e-commerce engines, B2B wholesale portals, and automated ERP integrations.

DATA ENGINE POSTGRESQL 16+ RLS
ERP SYNC TRANSACTIONAL OUTBOX
ACCOUNTING APPEND-ONLY LEDGER
OWNERSHIP 100% GIT + DB + INFRA
01 // SYSTEMIC FAILURES

Why Off-the-Shelf SaaS Breaks at Scale

Generic multi-tenant platforms (Shopify, BigCommerce, Salesforce) introduce architectural compromises that inevitably create security liabilities, financial reconciliation drift, and operational bottlenecks.

01.01

The Application-Layer WHERE Leak

In naive multi-tenant systems, tenant filtering is left to application code. A single missing WHERE tenant_id = ? clause in a reporting query or microservice leaks competitors' private pricing and customer lists. We enforce tenant boundaries strictly in the PostgreSQL kernel via Row-Level Security (RLS).

CRITICAL RISK
01.02

The Network Timeout Accounting Void

Making direct HTTP calls to ERPs (Logo, Mikro, Netsis, SAP) inside user requests causes catastrophic inconsistencies. If a network socket drops midway, did the invoice book? Repeating the request duplicates debt; ignoring it drops stock decrements. We eliminate this with the Transactional Outbox pattern.

INTEGRATION HAZARD
01.03

The Floating-Point Rounding Bleed

JavaScript IEEE-754 numbers (0.1 + 0.2 !== 0.3) introduce rounding drift across thousands of line items, causing auditing penalties. We enforce integer base units (BigInt kuruş/cents) and numeric(15,4) precision with line-item half-up rounding.

FINANCIAL DRIFT
01.04

The Closed Black-Box Trap

Generic SaaS platforms impose perpetual 0.5%–2.0% transaction taxes, rate-limited APIs, and deny direct SQL database access. We deliver 100% intellectual property transfer: you own the Git repo, PostgreSQL schemas, and Docker/Terraform manifests.

VENDOR LOCK-IN
02 // DATABASE ISOLATION

Pillar 1: Multi-Tenant PostgreSQL with Row-Level Security (RLS)

Mathematical tenancy guarantees enforced by the database engine. Every query automatically inherits tenant isolation without relying on developer discipline.

POSTGRESQL 16 SESSION CONTEXT SIMULATOR
Switch tenant role to witness PostgreSQL kernel filtering in real-time.
SET LOCAL app.current_tenant_id = 'a1b2-c3d4-apex'; SELECT * FROM orders; -- 2 rows returned SQL KERNEL EXECUTION
Order ID Tenant UUID Company / Dealer Total (BigInt Kuruş) Kernel Status
#ORD-9801 a1b2-c3d4-apex Borusan Oto Yetkili Servis ₺142.500,00 PASSED_RLS
#ORD-9802 a1b2-c3d4-apex Mengerler Ticaret A.Ş. ₺89.200,00 PASSED_RLS
SCHEMA // POSTGRESQL_RLS_DEFENSE.SQL STRICT_PATH_HARDENED
-- 1. Enforce Mandatory Tenant Column & RLS on Entity
ALTER TABLE orders ENABLE ROW LEVEL SECURITY;

-- 2. Revoke Direct Client Access (Zero Client-Side Mutations)
REVOKE ALL ON orders FROM anon, authenticated;

-- 3. Kernel-Level Row Isolation Policy
CREATE POLICY tenant_isolation_policy ON orders
  FOR ALL
  USING (
    tenant_id = current_setting('app.current_tenant_id', true)::uuid
  );

-- 4. Hardened Security-Definer Mutation Function
CREATE OR REPLACE FUNCTION private.submit_order(...)
RETURNS orders
LANGUAGE plpgsql
SECURITY DEFINER
SET search_path = ''
AS $$
...
$$;
03 // RELIABLE INTEGRATION

Pillar 2: Transactional Outbox Pattern for ERP Synchronization

Guaranteed at-least-once delivery with downstream idempotency. Never lose an order, double-book an invoice, or desynchronize warehouse inventory during ERP downtime.

ORDER-TO-ERP OUTBOX DISPATCH PIPELINE
Step through the 4-phase idempotent delivery lifecycle.
STAGE 01

ACID Transaction

Order + outbox_events row committed in single atomic block.

ACTIVE
STAGE 02

Advisory Lease

Worker locks event via pg_try_advisory_xact_lock to block race conditions.

PENDING
STAGE 03

HMAC Signing

Payload signed with HMAC-SHA256 and deterministic idempotency-key.

PENDING
STAGE 04

ERP Tri-State

Logo / Mikro / Netsis / SAP acknowledgment with uncertain state defense.

PENDING
Event 01: Order committed to DB + outbox_events table in atomic ACID transaction. LIVE TELEMETRY LOG
WORKER // TRANSACTIONAL_OUTBOX_WORKER.TS ZERO_EVENT_LOSS_SPEC
// Atomic ACID Transaction: Business State + Outbox Event
await db.transaction(async (tx) => {
  const order = await tx.insert(orders).values(orderData).returning();

  // Outbox record committed in the EXACT same database transaction
  await tx.insert(outboxEvents).values({
    tenantId: order.tenantId,
    eventType: 'order.created',
    payload: order,
    status: 'PENDING'
  });
});

// Cryptographic HMAC-SHA256 Signing & Idempotency Key
const idempotencyKey = `ticiworks-${event.tenantId}-${event.id}`;
const signature = signWebhook({ secret, timestamp, body });
04 // FINANCIAL PRECISION

Pillar 3: Immutable Append-Only Financial Ledger

Zero UPDATE or DELETE operations on commercial transactions. Double-entry bookkeeping with strict debit and credit balancing and exact decimal arithmetic.

The Floating-Point Trap vs Fixed BigInt Arithmetic: In standard JavaScript, 0.1 + 0.2 yields 0.30000000000000004. Over 100,000 orders, rounding drift bleeds tens of thousands in tax reconciliation.
JS Float: 0.1 + 0.2 === 0.3 // false
LABONNI: BigInt(10) + BigInt(20) === BigInt(30) // TRUE
IMMUTABLE DOUBLE-ENTRY LEDGER SIMULATOR
Append commercial movements to verify immutable debit/credit balancing.
Total Debits (Borç Toplamı) ₺48.500,00
Total Credits (Alacak Toplamı) ₺0,00
Net Outstanding Balance ₺48.500,00
Timestamp Entry Type Description / Audit Ref Debit (Borç) Credit (Alacak)
14:02:18 INVOICE Engine Oil Filters (Pallet 14A - Ref: INV-2026-081) ₺48.500,00 —
05 // SOVEREIGNTY BLUEPRINT

Pillar 4: Full Code & Infrastructure Ownership

Compare the architectural reality of renting software from a multi-tenant SaaS vendor against owning your complete technology asset.

Architectural Dimension LABONNI Sovereign Architecture Generic Multi-Tenant SaaS (Shopify / BigCommerce)
Code & Repository Ownership ✓ 100% Full IP Transfer (Git repo in your organization) ✗ Zero backend access; vendor owns the platform runtime
Database & Data Sovereignty ✓ Dedicated PostgreSQL schema with superuser SQL access ✗ Locked black box; restricted to rate-limited REST/GraphQL APIs
Platform Tax / Transaction Cuts ✓ 0.0% Commission (Zero revenue-share penalty forever) ✗ 0.5% – 2.0% transaction tax on every sale
ERP & Accounting Sync ✓ Native Transactional Outbox worker with HMAC signatures ✗ Fragile 3rd-party webhook apps prone to desynchronization
High-SKU & Custom Fitment Engines ✓ Sub-second trigram indexing over 150,000+ SKUs ✗ Degrades heavily with variant caps and API payload limits
Infrastructure & Edge Performance ✓ Cloudflare Workers edge delivery (<50ms TTFB worldwide) ✗ Bloated client scripts degrading Core Web Vitals to <50
LABONNI SYSTEMS ARCHITECTURE STUDIO

Request an Architectural Review for Your System

Speak directly with LABONNI's principal software architects. We analyze your ERP integration surface, database tenancy requirements, and deliver a comprehensive implementation roadmap.

Talk with Technical Lead on WhatsApp Schedule Architectural Consultation via Email