Architecture Overview
How All ID works and how components interact.
System architecture
┌─────────────┐
│ Client │
└──────┬──────┘
│ HTTPS
┌──────▼──────────┐
│ Load Balancer │
└──────┬──────────┘
│ HTTP:1302
┌──────▼──────────┐ ┌────────────────┐
│ Peer Service │──────▶│ Facematch │
│ • Orchestrates │HTTP │ • Face match │
│ • Exposes API │:8080 │ • Anonymize │
│ • Stores data │ │ • Extract │
└──────┬──────────┘ └────────────────┘
│ MySQL:3306
┌──────▼──────────┐
│ MySQL Database │
│ • Profiles │
│ • Identifiers │
│ • Transactions │
└─────────────────┘Peer Service
The Peer Service is the main application component.
What it does:
Exposes
RESTAPIendpoints (/profiles,/profiles/biometric-validation)Validates incoming requests
Orchestrates biometric operations
Stores and retrieves data from MySQL
Calls Facematch Service for facial recognition
Can communicate with Certta Router Service for distributed operations
Returns responses to clients
Technology: Node.js application
Requires: Facematch Service, MySQL Database
Facematch Service
The Facematch Service handles facial recognition operations.
What it does:
Receives biometric images from Peer
Extracts facial features using ML models
Calculates similarity scores between faces
Anonymizes biometric images
Returns feature vectors and scores to Peer
Technology: Machine learning service with embedded models
Requires: None (self-contained, models included in image)
Router Service (Certta-hosted)
The Router Service is an orchestration component hosted and managed by Certta (not deployed by you).
What it does:
Routes biometric queries across multiple customer Peer instances
Enables distributed profile lookups across regions
Coordinates cross-instance operations for multi-region deployments
Communication:
Your Peer → Certta Router: HTTP requests for distributed queries
Certta Router → Your Peer: HTTP callbacks with results
When used: Multi-region deployments where profile data is distributed across geographic locations
MySQL Database
Persistent storage for all biometric data.
What it stores:
Biometric profiles (facial features, metadata)
User identifiers (CPF, name, etc.)
Transaction history
Validation results
Technology: MySQL 8.0+ or Aurora MySQL 3.10.0+
Schema: Provided by Certta during setup
Data flows
Profile creation flow
What gets persisted in the database:
Embedding vector (bytes) — the rotated, anonymized feature vector. The raw image is never stored.
Engine metadata — model version and image hash used to generate the embedding.
Profile/asset metadata — identifiers and other profile-level data.
Anonymization (rotation) happens inside Facematch before the vector is returned, so Peer only ever handles and persists already-anonymized data.
Biometric validation flow
Distributed validation flow (with Certta Router)
Embedding rotation across peers:
Each peer holds its own private orthogonal rotation matrix, so an embedding anonymized for one peer isn't directly comparable against another peer's data. When a query crosses peer boundaries, the Router re-rotates the embedding — reversing the requesting peer's rotation and re-applying the responding peer's rotation — before forwarding it for comparison. This lets Peer instances compare biometric data across the network without any peer ever seeing another peer's private rotation matrix or an unrotated embedding.
Service discovery
Your services locate each other using DNS:
Configure via environment variables (FACEMATCH_IP, MYSQL_IP, etc.)
For distributed deployments, configure Certta Router endpoint (provided by Certta) in DS_IP and DS_PORT variables.
Scaling strategy
Horizontal scaling (recommended):
Add more Peer instances → handle more API requests
Add more Facematch instances → process more matches in parallel
Use database read replicas → handle more read queries
Vertical scaling:
Increase Peer resources → faster request processing
Increase Facematch resources → faster matching (limited benefit, horizontal preferred)
Increase database resources → faster query processing
High availability
Multi-instance deployment:
Deploy 2+ Peer instances behind load balancer
Deploy 2+ Facematch instances
Use Multi-AZ database
Health checks:
Peer:
GET /healthon port 1302Facematch:
GET /healthon port 8080Database: MySQL ping
Automatic failover:
Load balancer removes unhealthy Peer instances
Peer discovers healthy Facematch instances via DNS
Database fails over to standby (Multi-AZ)
Security architecture
Network tiers:
Authentication:
Client → Load Balancer: Implement authentication (API keys, OAuth2, etc.)
Services: Communicate within private network without authentication
Encryption:
Client traffic: HTTPS (TLS)
Database connections: TLS enabled
Data at rest: Database encryption enabled
Last updated

