Skip to main content

Infrastructure

This document provides technical details about the 23blocks platform infrastructure, including our edge architecture, URL patterns, and environment routing.

Edge Architecture

Every API request to 23blocks flows through our global edge network:

Your App → CloudFront (400+ edge locations) → Lambda@Edge → Service API

Request Flow

  1. Edge Location - Request hits the nearest CloudFront edge location (typically < 50ms from any user)
  2. Lambda@Edge - Validates API key and determines routing
  3. Origin Shield - Regional caching layer reduces origin requests
  4. Application Load Balancer - SSL termination and health checking
  5. Service Container - Your request reaches the service API

Per-Service URL Pattern

Each 23blocks service has its own dedicated URL following this pattern:

https://{service}.api.us.23blocks.com

Complete Service URL List

ServiceURLDescription
Authhttps://auth.api.us.23blocks.comAuthentication, users, MFA, SSO
Contenthttps://content.api.us.23blocks.comHeadless CMS
Fileshttps://files.api.us.23blocks.comCloud storage & CDN
Formshttps://forms.api.us.23blocks.comDynamic forms
CRMhttps://crm.api.us.23blocks.comCustomer relationships
Wallethttps://wallet.api.us.23blocks.comDigital wallets & payments
Assetshttps://assets.api.us.23blocks.comDigital asset management
Onboardinghttps://onboarding.api.us.23blocks.comUser activation flows
Companieshttps://company.api.us.23blocks.comTeams & organizations
Productshttps://products.api.us.23blocks.comProduct catalog
Saleshttps://sales.api.us.23blocks.comSubscriptions & payments
Rewardshttps://rewards.api.us.23blocks.comLoyalty & gamification
Searchhttps://search.api.us.23blocks.comFull-text search
Universityhttps://university.api.us.23blocks.comLearning management
AI/Jarvishttps://jarvis.api.us.23blocks.comMachine learning features
Geolocationhttps://geolocation.api.us.23blocks.comMaps & locations
Real Timehttps://conversations.api.us.23blocks.comWebSocket & WebRTC

Environment Routing

API Key-Based Routing

Use the same URL for all environments. Your API key prefix determines routing:

API Key PrefixEnvironmentUse Case
pk_test_*StagingPublic key for client-side staging
sk_test_*StagingSecret key for server-side staging
pk_live_*ProductionPublic key for client-side production
sk_live_*ProductionSecret key for server-side production

How It Works

The Lambda@Edge function reads your API key and routes to the appropriate backend:

API Key: pk_test_abc123

Prefix: pk_test_

Route to: Staging environment

Configuration Example

import { create23BlocksClient } from '@23blocks/sdk';

// Development/Staging
const stagingClient = create23BlocksClient({
urls: { authentication: 'https://auth.api.us.23blocks.com' },
apiKey: process.env.BLOCKS_TEST_API_KEY, // pk_test_* or sk_test_*
});

// Production
const productionClient = create23BlocksClient({
urls: { authentication: 'https://auth.api.us.23blocks.com' },
apiKey: process.env.BLOCKS_LIVE_API_KEY, // pk_live_* or sk_live_*
});

Benefits

  • Same URL everywhere - No environment-specific URLs to configure
  • Safer deployments - Swap API keys, not infrastructure
  • Consistent testing - Same code paths, same URLs
  • Simple CI/CD - Environment is a configuration value

Health Check Endpoints

Each service exposes a health check endpoint for monitoring:

GET https://{service}.api.us.23blocks.com/health

Response Format

{
"status": "healthy",
"service": "auth",
"version": "2.4.1",
"timestamp": "2026-01-20T10:30:00Z",
"checks": {
"database": "healthy",
"cache": "healthy",
"dependencies": "healthy"
}
}

Status Values

StatusDescription
healthyAll systems operational
degradedPartial functionality, some features may be slow
unhealthyService is down or unresponsive

Using Health Checks

# Check Auth service health
curl https://auth.api.us.23blocks.com/health

# Check multiple services
for service in auth content files forms; do
curl -s "https://${service}.api.us.23blocks.com/health" | jq '.status'
done

AWS Infrastructure

Compute Layer

  • ECS Fargate - Serverless container orchestration
  • Auto Scaling - Automatic capacity based on demand
  • Multi-AZ - Containers distributed across availability zones

Database Layer

  • RDS Aurora PostgreSQL - Multi-AZ database clusters
  • Read Replicas - Distributed read capacity
  • Automated Backups - Daily snapshots with 35-day retention

Caching Layer

  • ElastiCache Redis - In-memory caching
  • Multi-AZ Replication - High availability cache cluster

Storage Layer

  • S3 - Object storage with 99.999999999% durability
  • CloudFront - Global CDN for file delivery
  • S3 Transfer Acceleration - Fast uploads worldwide

Network Layer

  • CloudFront - 400+ edge locations
  • Lambda@Edge - Intelligent routing at the edge
  • Application Load Balancer - SSL termination, health checks
  • WAF - Web application firewall protection

Security

Encryption

  • In Transit - TLS 1.3 for all connections
  • At Rest - AES-256 encryption for databases and storage
  • Key Management - AWS KMS for key rotation

Network Security

  • VPC Isolation - Private subnets for services
  • Security Groups - Strict inbound/outbound rules
  • WAF Rules - Protection against common attacks

DDoS Protection

  • AWS Shield Standard - Always-on DDoS protection
  • CloudFront - Edge-level DDoS mitigation
  • Rate Limiting - Per-API key request limits

Monitoring

Metrics

  • Prometheus - Time-series metrics collection
  • Custom Metrics - Request latency, error rates, throughput

Visualization

  • Grafana - Real-time dashboards
  • Per-Service Dashboards - Service-specific metrics
  • Executive Dashboard - Platform-wide health overview

Logging

  • Loki - Centralized log aggregation
  • Structured Logs - JSON format for easy querying
  • Log Retention - 90 days for debugging

Alerting

  • Alert Rules - Threshold-based alerts
  • PagerDuty Integration - On-call engineer notification
  • < 30 Second Alert Time - Fast incident response

SLA & Uptime

TierUptime SLAResponse Time
Shared Cloud99.5%24-48 hours
Dedicated Cloud99.9%4 hours
Enterprise99.99%1 hour

Incident Communication

  • Status Page - https://status.23blocks.com
  • Email Notifications - Subscribed customers notified
  • Slack Updates - Real-time incident updates

Regional Availability

Currently available in:

RegionLocationStatus
usUS East (N. Virginia)Active

Coming Soon

  • eu - Europe (Frankfurt)
  • ap - Asia Pacific (Singapore)