System Architecture Document (SAD)

Hybrid Cloud Architecture (On-Premise + GCP) — Phase 1

A. Document controlA. Kiểm soát tài liệu

Doc IDCPG-SAD-V3
VersionPhiên bản3.0
StatusTrạng tháiPre-Final
OwnerPhong Dinh
AudienceĐối tượngArchitecture, Engineering, Ops, Security
ClassificationPhân loạiConfidential — Architecture
Effective dateNgày hiệu lực01/12/2026
Related docs Monitoring Stack · BR/NFR Catalog · Module Map · Doc03 Security · 02_FSD Index

B. Version historyB. Lịch sử phiên bản

Version Date Author ChangesThay đổi
1.0 Dec 2025 Phong Dinh Initial draft
2.0 Jan 2026 Phong Dinh Complete infrastructure decisions (AWS)
2.1 Jan 2026 Phong Dinh Full NFR coverage update
3.0 Jan 2026 Phong Dinh GCP Migration + Warm Standby Architecture

C. Table of contentsC. Mục lục

D. ContentD. Nội dung

1. Summary

1.1 Purpose

This System Architecture Document (SAD) provides a comprehensive technical blueprint for the Crypto Payment Gateway solution. It defines the system architecture, infrastructure decisions, deployment topology, security controls, and operational procedures required to build and operate a production-grade, cryptocurrency payment platform.

1.2 Key Changes in Version 3.0

Cloud Provider Migration: Migrated from AWS to Google Cloud Platform (GCP) for improved cost efficiency and network performance.

Warm Standby Architecture: Added warm standby configuration for core services on GCP Kubernetes to enable rapid failover from on-premise infrastructure.

Enhanced DR Strategy: Reduced RTO from 1 hour to 15 minutes through warm standby services.

Network Connectivity: Replaced AWS Direct Connect with GCP Cloud Interconnect.

2. Architecture Principles

Principle Description Rationale
Hybrid Cloud Sensitive data on-premise, scalable services on GCP Balance security and scalability
Warm Standby Core services run in minimal mode on cloud for instant failover Business continuity
Microservices Domain-driven, independently deployable services Agility and fault isolation
API-First All functionality exposed via versioned REST APIs Integration flexibility
Security by Design Defense in depth, zero-trust networking Compliance and protection
Observable by Default Comprehensive metrics, logs, traces for all components Operational excellence
On-chain as Truth On-chain state is the single source of truth (NFR-CC1) Data integrity

3. Infrastructure Architecture

3.1 Cloud Provider Selection

Decision: Google Cloud Platform (GCP)

Criteria GCP AWS Decision Factor
SEA Region Presence asia-southeast1 (Singapore) ap-southeast-1 (Singapore) Both have Singapore region
Managed PostgreSQL Cloud SQL (Mature) RDS (Mature) Cloud SQL competitive
Dedicated Interconnect Available SG (Equinix) Direct Connect GCP pricing better for 1Gbps
Kubernetes Service GKE (Market leader) EKS GKE more mature, better autoscaling
Network Performance Premium tier global backbone Good GCP superior network
Cost (1Gbps Interconnect) Lower (shared option) Higher GCP 30-40% savings
PCI DSS Compliance Level 1 Level 1 Both compliant

3.1 Deployment Region

Decision: Singapore (Single Region) for Phase 1 with DR to Hong Kong

Component Location Rationale
On-Premise DC Singapore (Equinix SG1) Tier-3+ DC, Cloud Interconnect location
GCP Region (Primary) asia-southeast1 (Singapore) Lowest latency to on-prem (\<5ms)
GCP Region (DR) asia-east2 (Hong Kong) Cross-region backup, \<30ms latency
Phase 2+ Plan Multi-region active For scale and DR

3.2 Environment Strategy

Decision: 4 Core Environments + On-Demand

Environment Purpose Infrastructure Data
Local Developer machines Docker Compose Mock/seed data
DEV Integration testing Shared GKE namespace Synthetic data
STG/UAT Pre-production, acceptance Dedicated GKE cluster Anonymized prod clone
PROD Live production Dedicated GKE cluster + On-prem Real production data
PERF (On-demand) Performance testing Ephemeral via IaC Synthetic load data
PENTEST (On-demand) Security testing Isolated ephemeral Synthetic data

3.4 Hybrid Cloud Connectivity

3.4.1 Network Connection Type

Decision: GCP Cloud Interconnect (Primary) + Cloud VPN (Backup)

Connection Type Bandwidth Latency Use Case
Primary GCP Partner Interconnect 1Gbps 1 Gbps dedicated 2-5ms All production traffic
Secondary Cloud VPN (IPSec HA) 300 - 500 Mbps 15-30ms Failover, non-critical
Failover Automatic (BGP) \<30 seconds - HA requirement

3.4.2 Latency Requirements

Traffic Type Requirement Target Latency Connection
Payment Checkout Flow Critical \<10ms P95 Cloud Interconnect
Scanner to On-prem DB Critical \<10ms P95 Cloud Interconnect
Standard API Calls Standard \<50ms P95 Cloud Interconnect/VPN
Backup/Replication Background \<200ms P95 Either
Logs/Metrics Shipping Best Effort \<500ms P95 VPN acceptable

3.4.3 Hybrid Cloud Resilience (NFR-R2)

Requirement: Services on GCP must have local queue/cache to buffer events when interconnect is down

Component Resilience Mechanism Buffer Capacity Recovery Action
Scanner Service Local Redis queue + Pub/Sub 1 hour of events (\~360K) Auto-flush to DB on reconnect
Webhook Dispatcher Cloud Pub/Sub topic 24 hours of webhooks Retry with backoff on reconnect
API Gateway Local config cache Last known good config Serve from cache, log warnings
Reporting Service Offline mode queue Queue report requests Process queue on reconnect

4. Warm Standby Architecture

4.1 Overview

The warm standby architecture ensures business continuity by maintaining core services in a minimal running state on GCP. In case of on-premise infrastructure failure, these services can be scaled up to full capacity within minutes.

4.2 Warm Standby Strategy

Aspect On-Premise (Primary) GCP Warm Standby Failover Time
Core Payment Services Full capacity (8-12 pods) Minimal (1-2 pods) \<5 minutes to scale
Transaction Service Full capacity (6 pods) Warm (1 pod) \<5 minutes
Ledger Service Full capacity (4 pods) Warm (1 pod) \<5 minutes
Refund Service Full capacity (3 pods) Warm (1 pod) \<5 minutes
Settlement Service Full capacity (3 pods) Warm (1 pod) \<5 minutes
Governance Service Full capacity (2 pods) Warm (1 pod) \<5 minutes
Database Primary PostgreSQL Cloud SQL replica (read) \<15 minutes to promote

4.3 Warm Standby Components

4.3.1 GKE Warm Cluster Configuration

Configuration Value Purpose
Cluster Name cpg-warm-standby-cluster Dedicated warm standby
Node Pool (Warm) 2 nodes, e2-standard-4 Minimal footprint
Node Pool (Scale-up) Autoscale 0-20 nodes, e2-standard-8 Rapid expansion
Region asia-southeast1 (Singapore) Same region as on-prem
Preemptible Nodes Disabled for warm pods Guaranteed availability
Cluster Autoscaler Enabled, aggressive scale-up Fast response

4.4 Database Warm Standby

4.4.1 Cloud SQL Configuration

Configuration Value Purpose
Instance Type db-custom-4-16384 4 vCPU, 16GB RAM (can scale)
Storage 500GB SSD Initial allocation
High Availability Regional (Multi-zone) Automatic failover
Replication Continuous from on-prem Near real-time sync
Backup Automated daily + on-demand Point-in-time recovery
Read Replica Enabled Serve read traffic immediately

4.4.2 Data Replication Strategy

Data Type Replication Method Lag Target Failover Behavior
Transactions & Ledger Logical replication (streaming) \<30 seconds Promote replica to primary
Merchant Config Logical replication \<1 minute Read from replica immediately
Governance State Logical replication \<1 minute Read from replica
KYC/Compliance Encrypted backup to GCS 15 minutes Restore from backup
Audit Logs Continuous sync to BigQuery \<5 minutes Read from BigQuery

4.5 Failover Procedures

4.5.1 Automatic Failover Triggers

Trigger Detection Method Threshold Action
On-prem DB unreachable Health check from GCP 3 consecutive failures (30s) Alert + Prepare failover
Interconnect down BGP monitoring >60 seconds Switch to VPN + Alert
Core services down Kubernetes health probes 5 pods failed for 2 min Scale warm standby
Network partition Cross-region health check >2 minutes Initiate DR procedure

4.5.2 Failover Sequence

  1. Detection: Monitoring system detects on-premise failure (automatic, 30-60 seconds)

  2. Validation: Cross-check with multiple health endpoints (automatic, 30 seconds)

  3. Alert: PagerDuty alert to on-call team (automatic, immediate)

  4. DNS Switch: Update Cloud DNS to point to GCP endpoints (manual approval, 2 minutes)

  5. Scale Up: Warm services scale to full capacity (automatic, 3-5 minutes)

  6. Database Promote: Promote Cloud SQL replica to primary (manual approval, 5-10 minutes)

  7. Validation: Run smoke tests on failover environment (automatic, 2 minutes)

  8. Traffic Cutover: Enable full traffic to GCP (manual approval, immediate)

Total RTO: 15 minutes (with pre-approved runbook) to 30 minutes (with manual approvals)

4.6 Cost Optimization for Warm Standby

Resource Monthly Cost (Warm) Monthly Cost (Active) Savings
GKE Nodes (Warm Pool) \$150 (2x e2-standard-4) \$1,600 (20x e2-standard-8) 91%
Cloud SQL (Replica) \$400 (read replica) \$800 (primary) 50%
Network (Replication) \$100 (replication traffic) \$500 (full traffic) 80%
Cloud Storage \$50 (backups) \$50 (backups) 0%
Total Warm Standby \$700/month - -
vs Full Active-Active - \$2,950/month 76% savings

5. Kubernetes Architecture

5.1 Cluster Strategy

Location Cluster Type Management Purpose
GCP (PROD) GKE Autopilot Google Managed Control Plane Public-facing + Warm Standby
GCP (Non-PROD) GKE Standard Google Managed Control Plane DEV/STG environments
On-Premise (PROD) kubeadm + Patroni Self-managed Core services, DB access
On-Premise (Non-PROD) kubeadm Self-managed Development/testing

5.2 GKE Configuration

5.2.1 Production Cluster (Primary + Warm Standby)

Configuration Value Purpose
Cluster Name cpg-prod-cluster Production workloads
Mode GKE Autopilot Reduced ops overhead
Region asia-southeast1 Singapore region
Network VPC-native Pod-level networking
Private Cluster Enabled No public node IPs
Workload Identity Enabled Secure GCP API access
Binary Authorization Enabled Verified deployments only
Release Channel Regular Balanced stability/features

5.2.2 Node Sizing (On-Premise)

Node Pool Instance Type vCPU RAM Count Purpose
Core Services Custom VM 7 32GB 8-12 Payment, Ledger, Governance
API Gateway Custom VM 3 16GB 2-4 Kong, Ingress
Observability Custom VM 3 16GB 2-4 Prometheus, Loki, Grafana
Database Custom VM 15 64GB 2 PostgreSQL HA (Patroni)

5.3 Autoscaling Configuration (NFR-S1)

Service Type Metric Min (On-prem) Min (Warm) Max Target
Core Payment Services CPU + RPS 2 1 14 70% CPU, 50 req/s
Scanner Service Queue Depth (KEDA) 1 1 7 1000 pending events
Webhook Dispatcher Queue Depth 1 1 9 500 pending webhooks
API Gateway RPS 2 1 19 100 req/s/pod
Frontend Services CPU 1 N/A 9 70% CPU

6. Data Architecture

6.1 Hybrid Data Model

Data Type Primary Location Replicated To Rationale
Transactions & Ledger On-Premise PostgreSQL Cloud SQL (GCP) ACID compliance, data residency
Merchant PII On-Premise PostgreSQL Masked to Cloud SQL Compliance, data protection
Governance Config On-Premise PostgreSQL Cloud SQL (read-only) Critical business rules
KYC/KYB Documents On-Premise Object Storage Encrypted to GCS Regulatory requirement
Tickets & Support Cloud SQL (GCP) Not replicated Operational, non-sensitive
Notifications Cloud SQL (GCP) Not replicated High volume, ephemeral
Reports & Exports Cloud Storage (GCS) Not replicated Analytics, long-term storage
Audit Logs Both (On-prem primary) BigQuery for analytics Compliance, immutable

6.2 Database Architecture

6.2.1 On-Premise PostgreSQL Cluster

HA Solution: Patroni + etcd

Component Configuration Purpose
Primary Node 16 vCPU, 64GB RAM, NVMe SSD Write operations
Standby Node 1 16 vCPU, 64GB RAM, NVMe SSD HA failover (sync replication)
Standby Node 2 16 vCPU, 64GB RAM, NVMe SSD Read replica (async)
etcd Cluster 3 nodes, dedicated Distributed consensus for Patroni
HAProxy 2 nodes, active-passive Connection routing
Failover Time \<60 seconds Automatic via Patroni

6.2.2 GCP Cloud SQL Configuration

Configuration Value Purpose
Instance Type db-custom-4-16384 Reporting + Warm standby
Storage 500GB SSD (auto-expand) Initial allocation
Multi-AZ Enabled (Regional) High availability
Read Replicas 1 replica Heavy query offload (NFR-S2)
Backup Retention 7 days automated Point-in-time recovery
Maintenance Window Sunday 02:00-06:00 SGT Minimal impact

7. Security Architecture

7.1 Network Security

7.1.1 Network Architecture

Zone Components Access
DMZ (Public) Cloud Load Balancer, Cloud Armor Internet (filtered)
Application (GCP) API Gateway, Scanner, Frontends DMZ only
Application (On-prem) Core Services, Kafka GCP via Interconnect
Data (On-prem) PostgreSQL, Redis, Object Storage Application zone only
Management Vault, Monitoring, CI/CD VPN + bastion only

7.1.2 GCP Security Controls

Control Implementation Location
WAF Cloud Armor with OWASP rule set Global Load Balancer
DDoS Protection Cloud Armor (Standard) All public endpoints
Rate Limiting Kong + Cloud Armor API Gateway
VPC Firewall Hierarchical firewall policies All VPCs
Private Google Access Enabled All subnets
VPC Service Controls Enabled for sensitive APIs Project perimeter

7.2 Identity and Access Management

User Type Identity Provider Authentication MFA
Merchant Users Local (Portal DB) Email/Password TOTP Required (NFR-Sec4)
Internal Staff (CRM) Google Workspace (SSO) SAML 2.0 TOTP/Hardware Key
API Clients API Key Store API Key + HMAC N/A (IP whitelist)
Service Accounts GCP IAM / K8s SA Workload Identity N/A
Warm Standby Services GCP IAM Workload Identity N/A

7.3 Secret Management (NFR-Sec3)

Solution: HashiCorp Vault (On-Premise) + GCP Secret Manager

Secret Type Storage Location Access Method Rotation
Smart Contract Admin Keys Vault (HSM-backed) Manual approval workflow Annual + on compromise
JWT Signing Keys Vault K8s CSI driver injection 90 days automatic
Database Credentials Vault Dynamic secrets 24 hours automatic
Node SaaS API Keys Vault Environment injection 90 days
GCP Service Keys Secret Manager Workload Identity Automatic
Warm Standby Secrets Secret Manager Workload Identity Synced from Vault

8. Observability Architecture

8.1 Observability Stack

Decision: CNCF Stack (Prometheus + Grafana + Loki + Tempo)

Component Tool Purpose Location
Metrics Prometheus Time-series metrics collection Central (Cloud)
Visualization Grafana Single pane of glass dashboards Central (Cloud)
Logs Loki Log aggregation and search Central (Cloud)
Traces Tempo Distributed tracing Central (Cloud)
Alerting Alertmanager + PagerDuty Alert routing and on-call Central (Cloud)

8.2 Metrics Architecture (RED + USE)

8.2.1 Application Metrics (RED Method)

Metric Type Metric Name Labels Requirement
Rate http_requests_total service, endpoint, method, status REQ-OBS-4
Errors http_errors_total service, endpoint, error_type REQ-OBS-5
Duration http_request_duration_seconds service, endpoint (histogram) REQ-OBS-6

8.2.2 Resource Metrics (USE Method)

Metric Type Metric Name Purpose Requirement
Utilization container_cpu_usage_seconds_total CPU usage REQ-OBS-7
Utilization container_memory_usage_bytes Memory usage REQ-OBS-7
Saturation pg_stat_activity_count DB connection pool REQ-OBS-7
Saturation kafka_consumer_lag Queue backlog REQ-OBS-7
Errors node_network_receive_errs_total Network errors REQ-OBS-8

8.2.3 Business Metrics

Metric Type Labels Requirement
payment_processed_total Counter merchant_id, chain, token, status REQ-OBS-9
payment_value_usd Histogram merchant_id, chain, token REQ-OBS-9
gateway_fee_collected_total Counter merchant_id, chain, token REQ-OBS-10
blockchain_scanner_lag_blocks Gauge chain REQ-OBS-11
treasury_wallet_balance Gauge chain, token REQ-OBS-11

8.2.4 Dependency Metrics

Metric Type Labels Requirement
external_api_request_duration_seconds Histogram dependency, endpoint REQ-OBS-12
external_api_requests_total Counter dependency, status_code REQ-OBS-13
interconnect_ping_latency_ms Gauge source, destination REQ-OBS-14

8.3 Logging Architecture

8.3.1 Log Format

All logs must be structured JSON with correlation IDs:

Field Description Example
timestamp ISO 8601 timestamp 2026-01-15T10:30:00.123Z
level Log level INFO, WARN, ERROR
service Service name payment-service
correlationId Request trace ID req-abc123
merchantId Merchant identifier (if applicable) m-xyz789
txHash Transaction hash (if applicable) 0x1234...
message Log message Payment processed successfully
metadata Additional structured data {amount: 100, token: USDT}

8.3.2 Log Retention

Log Type Hot Storage Warm Storage Archive Requirement
Security Logs 90 days 2 years 7 years NFR-Obs4
Audit Logs 90 days 2 years 7 years NFR-Obs4
Application Logs 30 days 90 days 1 year Standard
Transaction Logs 90 days 1 year 7 years Compliance
Webhook Logs 30 days 180 days Delete NFR-Data2

8.4 Alerting Strategy

8.4.1 Alert Severity Levels

Severity Response Time Notification Example
P0 (Critical) Immediate PagerDuty + Phone Payment flow down, scanner stopped
P1 (High) 15 minutes PagerDuty + Slack Error rate >5%, latency >1s P99
P2 (Medium) 1 hour Slack Error rate >1%, single pod crash
P3 (Low) Business hours Email Disk >80%, certificate expiry \<30d

8.4.2 Key Alerts

Alert Condition Severity Requirement
ScannerLagHigh blockchain_scanner_lag_blocks > 10 P1 REQ-OPS-3
PaymentErrorRateHigh payment errors > 5% for 5min P0 SLO-based
APILatencyHigh P95 latency > 600ms for 5min P1 NFR-P1
DBConnectionSaturation connections > 80% for 5min P1 REQ-OBS-7
NodeSaaSDown external API errors > 50% P0 NFR-Dep1
InterconnectDown interconnect_ping_latency_ms \= 0 P0 NFR-R2

9. Disaster Recovery and Business Continuity

9.1 RPO/RTO Requirements

Component RPO RTO (Traditional) RTO (Warm Standby) Strategy
PostgreSQL (On-prem) 5 min 1 hour 15 min Warm replica promotion
PostgreSQL (GCP) 5 min 15 min 5 min Multi-AZ + automated
Redis Cache N/A 15 min 5 min Warm Redis on GCP
Kafka Topics 0 (durable) 30 min 10 min Multi-broker + Pub/Sub
Core Services N/A 30 min 5 min Warm standby scale-up
Full System 5 min 1 hour 15 min Warm standby architecture

9.2 DR Scenarios

Scenario Detection Recovery Strategy RTO
Single Service Failure K8s health check Auto-restart via K8s \<5 min
Node Failure K8s node status Reschedule pods to healthy nodes \<10 min
On-prem DC Network Issue Interconnect monitoring VPN failover (automatic) \<1 min
On-prem DC Total Failure Multiple health checks Scale up warm standby \<15 min
On-prem DB Failure Patroni/HAProxy Promote Cloud SQL replica \<15 min
GCP Region Failure Multi-region health check Failover to asia-east2 (HK) \<30 min

9.3 Annual DR Drill (NFR-DR3)

Test Type Frequency Success Criteria Participants
Warm Standby Scale-up Monthly Full capacity in \<5 min DevOps
Database Failover Quarterly Promote replica in \<15 min DevOps + DBA
Full DR Drill Annually Full system recovery within RTO All teams
Interconnect Failover Quarterly VPN takes over in \<30 sec Network team

10. Cost Estimates

10.1 Monthly Infrastructure Cost (Phase 1)

Resource Category Component Monthly Cost (Est.)
Compute (GCP) GKE Autopilot + Warm Standby \$1,500
Compute (On-prem) K8s Nodes (12x servers) \$2,500 (colo)
Database (On-prem) PostgreSQL HA (3 nodes) \$1,500 (colo)
Database (GCP) Cloud SQL Multi-AZ + Replica \$600
Network Cloud Interconnect 1Gbps \$1,700
Network Cloud VPN Backup \$100
Storage (GCP) Cloud Storage + Glacier (5TB) \$150
Cache (GCP) Memorystore for Redis \$300
Node SaaS Alchemy Growth Plan (NFR-C2) \$500
Observability Cloud Monitoring + self-hosted \$200
Warm Standby GKE nodes + Cloud SQL replica \$700
Total - \$9,750 - \$11,000

10.2 Cost Comparison vs AWS

Component GCP Cost AWS Cost Savings
Network Connectivity \$1,800/mo \$2,600/mo 31%
Managed Kubernetes \$1,500/mo \$1,700/mo 12%
Database (Cloud) \$600/mo \$800/mo 25%
Total Monthly \$9,750/mo \$11,500/mo 15%
3-Year Total \$351,000 \$414,000 \$63,000

11. NFR Traceability Matrix (Key Items)

NFR ID Requirement SAD Section Status
NFR-A1 99.9% availability 9.1 ✓ (Warm standby)
NFR-A2 99.95% critical paths 9.1 ✓ (Warm standby)
NFR-DR1 RPO ≤5 minutes 9.1 ✓
NFR-DR2 RTO ≤1 hour 9.1 ✓ (15 min with warm)
NFR-R2 Hybrid Cloud resilience 3.4.3, 4.5 ✓
NFR-S1 HPA scaling 5.3 ✓
NFR-S2 DB read replicas 6.2.2 ✓
NFR-Dep1 Auto-failover 4.5 ✓
NFR-Sec1 TLS 1.3, HSTS 7.1 ✓
NFR-Sec3 Secret management 7.3 ✓

Mapped Requirements

BR/NFR/REQ items from the master catalog mapped to this document. IDs link to anchors in 01_BR; local id anchors still accept deep-links from the catalog.Các BR/NFR/REQ từ catalog master được ánh xạ tới tài liệu này. ID liên kết tới anchor trong 01_BR; id cục bộ vẫn nhận deep-link từ catalog.

  • BR-CORE-ARCH-001 BR — Components required to be hosted on the Public Cloud:Các Component bắt buộc host trên Public Cloud:
  • BR-CORE-PERF-001 BR — Scanner Service (required to run on the cloud to have low latency when calling the Node SaaS API)Scanner Service (bắt buộc chạy trên cloud để có low-latency khi call API của Node SaaS)
  • BR-CORE-ARCH-002 BR — Payment Checkout Frontend (Iframe / HPP – requires CDN and edge location)Payment Checkout Frontend (Iframe / HPP – cần CDN và edge location)
  • BR-CORE-ARCH-003 BR — Components required to be hosted on-premise:Các Component bắt buộc host trên On-premise:
  • BR-CORE-ARCH-004 BR — Admin CRM & Merchant CRM (application server cho portal)
  • BR-CORE-DR-001 BR — Database (e.g., PostgreSQL) must be deployed as a High Availability (HA) cluster.Database (ví dụ: PostgreSQL) phải deploy dưới dạng High Availability (HA) cluster.
  • BR-CORE-DR-002 BR — Multi-AZ Deployment: Primary and Replica nodes must be in different Availability Zones (AZs)/physical servers, availableMulti-AZ Deployment: Primary và Replica nodes phải ở các Availability Zones (AZs)/physical server khác nhau, có
  • BR-CORE-DEVOPS-001 BR — Gateway must have an internal service to deploy, configure, and version fee-splitting contracts.Gateway phải có internal service để deploy, cấu hình và versioning các fee-splitting contract.
  • BR-CORE-ARCH-005 BR — Alerts (e.g., SLO breach, Scanner lag > 5 minutes) automatically route to the correct responsible technical member.Alerts (ví dụ: SLO breach, Scanner lag > 5 phút) tự động định tuyến đúng thành viên kỹ thuật phụ trách.
  • BR-CORE-PERF-002 BR — There are metrics monitoring health, latency, throughput, and error rate between components.Có metrics giám sát health, latency, throughput, error rate giữa các cấu phần.
  • BR-CORE-DR-003 BR — network_packet_loss, packet_drops, retransmits - including system and service packets.network_packet_loss, packet_drops, retransmits - bao gồm packet của hệ thống và dịch vụ.
  • BR-CORE-DR-004 BR — gas_relayer_wallet_balance: Gauge (chain, wallet_address).
  • BR-CORE-PERF-003 BR — external_api_request_duration_seconds: Histogram theo dependency (NodeSaaS_Alchemy, WaaS_Web3Auth,
  • BR-CORE-PERF-004 BR — external_api_requests_total: Counter by dependency and status_code (4xx, 5xx).external_api_requests_total: Counter theo dependency và status_code (4xx, 5xx).
  • BR-CORE-PERF-005 BR — interconnect_ping_latency_ms: Gauge by source (public_cloud), destination (on_premise); measure ping latency andinterconnect_ping_latency_ms: Gauge theo source (public_cloud), destination (on_premise); đo độ trễ ping và
  • NFR-P1 NFR — API p95 latency ≤ 300 ms (read endpoints); ≤ 600 ms (write endpoints).
  • NFR-P2 NFR — Web UI initial load (LCP) ≤ 2.5 s; TTI ≤ 4 s.
  • NFR-P3 NFR — Scanner Service Benchmark: Must be able to process at least 100 on-chain TPS (for example: 10 chains * 10 tx/block).Scanner Service Benchmark: Phải có khả năng process ít nhất 100 on-chain TPS (ví dụ: 10 chain * 10 tx/block).
  • NFR-P4 NFR — Scanner Service Latency: P95 Event Detection Latency (block confirmation → DB write) ≤ 15 seconds (for chains with a 3-second block time).Scanner Service Latency: P95 Event Detection Latency (block confirmation → DB write) ≤ 15 giây (cho chain có block time 3 giây).
  • NFR-S1 NFR — Stateless services must support horizontal scaling through HPA (CPU/RPS/queue depth).Stateless services phải hỗ trợ horizontal scale qua HPA (CPU/RPS/queue depth).
  • NFR-S2 NFR — DB read scale qua read replicas.
  • NFR-S3 NFR — Queue-first design for spikes; backpressure with fixed worker pools.Queue-first design cho spikes; backpressure với fixed worker pools.
  • NFR-C1 NFR — There is a 12-month growth buffer for storage.Có 12-month growth buffer cho storage.
  • NFR-C2 NFR — There must be an SLA contract with the Node SaaS provider (for example: Alchemy) to ensure the request rate limit is sufficient for NFR-P3 & NFR-P4.Phải có contract SLA với Node SaaS provider (ví dụ: Alchemy) đảm bảo rate limit request đủ cho NFR-P3 & NFR-P4.
  • NFR-A1 NFR — Service availability ≥ 99.9% monthly (Portal & APIs).
  • NFR-A2 NFR — Critical paths (Payment Checkout, Scanner Service event ingestion, webhook delivery) ≥ 99.95%.
  • NFR-R1 NFR — Idempotency keys for all critical write APIs (for example: create API key, submit wallet address).Idempotency keys cho tất cả critical write API (ví dụ: create API key, submit wallet address).
  • NFR-R2 NFR — Hybrid Cloud Resilience: Services on the Public Cloud (e.g., Scanner) must have a local queue/cache mechanism to bufferHybrid Cloud Resilience: Service trên Public Cloud (ví dụ: Scanner) phải có cơ chế local queue/cache để buffer
  • NFR-DR1 NFR — RPO ≤ 5 minutes (DB PITR, queue durability).RPO ≤ 5 phút (DB PITR, queue durability).
  • NFR-DR2 NFR — RTO ≤ 1 hour (infrastructure as code, automated restore/playbooks).RTO ≤ 1 giờ (infra as code, automated restore/playbooks).
  • NFR-DR3 NFR — Annual DR drill; document gaps and remediationAnnual DR drill; document gaps và remediation
  • NFR-Dep1 NFR — All external dependencies (Node SaaS provider, AML provider, WaaS provider, Mail/SMS) must be presentTất cả external dependencies (Node SaaS provider, AML provider, WaaS provider, Mail/SMS) bắt buộc phải có
  • NFR-Dep2 NFR — Retries must use jitter/back-off; max retry window ≤ 2 minutes (for user flows), ≤ 15 minutes (for batch).Retries phải sử dụng jitter/back-off; max retry window ≤ 2 phút (cho user flows), ≤ 15 phút (cho batch).
  • NFR-M3 NFR — Zero-downtime deploys (blue-green/canary); automatic rollback when SLO is violated.Zero-downtime deploys (blue-green/canary); tự động rollback khi vi phạm SLO.
  • NFR-KYC2 NFR — Sumsub's webhook must be HMAC authenticated; supports retry and dead-letter queue on failureWebhook của Sumsub phải được xác thực HMAC; hỗ trợ retry và dead-letter queue khi thất bại
  • REQ-OBS-1 REQ — Prometheus-Native Stack
  • REQ-OBS-12 REQ — External Dependency Latency
  • REQ-OBS-13 REQ — External Dependency Errors
  • REQ-OBS-14 REQ — Interconnect Latency

E. ReferencesE. Tham chiếu