Skip to main content

23blocks Platform Architecture: Edge Infrastructure & Environment Routing

· 3 min read
23blocks Team
The 23blocks Engineering Team

We're excited to share details about our platform architecture, designed to give you the best developer experience while maintaining enterprise-grade reliability.

Edge Architecture Overview

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

Your App → CloudFront Edge → Lambda@Edge → Service API

CloudFront Global Edge

Requests hit one of 400+ CloudFront edge locations worldwide, ensuring sub-50ms latency regardless of where your users are located.

Lambda@Edge Routing

Our Lambda@Edge function handles intelligent routing:

  1. API Key Validation - Verifies your API key instantly
  2. Environment Detection - Routes to staging or production based on key prefix
  3. Service Routing - Directs traffic to the correct service backend

Per-Service URL Pattern

Each 23blocks service has its own dedicated URL:

ServiceURL
Authhttps://auth.api.us.23blocks.com
Contenthttps://content.api.us.23blocks.com
Fileshttps://files.api.us.23blocks.com
Formshttps://forms.api.us.23blocks.com
CRMhttps://crm.api.us.23blocks.com
Wallethttps://wallet.api.us.23blocks.com
Onboardinghttps://onboarding.api.us.23blocks.com
Companieshttps://company.api.us.23blocks.com
Productshttps://products.api.us.23blocks.com
Saleshttps://sales.api.us.23blocks.com
Rewardshttps://rewards.api.us.23blocks.com
Searchhttps://search.api.us.23blocks.com
Universityhttps://university.api.us.23blocks.com
AI/Jarvishttps://jarvis.api.us.23blocks.com
Geolocationhttps://geolocation.api.us.23blocks.com
Real Timehttps://conversations.api.us.23blocks.com
Assetshttps://assets.api.us.23blocks.com

Environment Routing via API Keys

One of the most powerful aspects of our architecture is API key-based environment routing. Use the same URL for all environments - your API key determines where traffic goes:

API Key PrefixEnvironment
pk_test_*Staging (public key)
sk_test_*Staging (secret key)
pk_live_*Production (public key)
sk_live_*Production (secret key)

Benefits

  • Simpler Configuration - No environment-specific URLs to manage
  • Safer Deployments - Just swap API keys, not URLs
  • Consistent Testing - Same code paths in dev and production

Example Usage

// Staging
const stagingClient = new BlocksClient({
baseUrl: 'https://auth.api.us.23blocks.com',
apiKey: 'pk_test_abc123' // Routes to staging
});

// Production
const productionClient = new BlocksClient({
baseUrl: 'https://auth.api.us.23blocks.com',
apiKey: 'pk_live_xyz789' // Routes to production
});

Monitoring Infrastructure

Every service is monitored 24/7 with:

  • Prometheus - Metrics collection and alerting
  • Grafana - Real-time dashboards and visualization
  • Loki - Centralized log aggregation
  • Custom Health Checks - Per-service availability monitoring

Our SRE team receives alerts within 30 seconds of any service degradation.

Health Check Endpoints

Each service exposes a health check endpoint:

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

Response:

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

AWS Infrastructure

Behind the scenes, each service runs on:

  • Application Load Balancers - SSL termination and routing
  • ECS Fargate - Serverless container orchestration
  • RDS Aurora - Multi-AZ PostgreSQL databases
  • ElastiCache - Redis caching layer
  • S3 - Durable object storage

All infrastructure is multi-AZ within the US East region, with automatic failover and daily backups.

What This Means for You

  1. Faster APIs - Edge routing reduces latency globally
  2. Simplified Code - One URL per service, environment via API key
  3. Enterprise Reliability - Multi-AZ, auto-scaling, 24/7 monitoring
  4. Zero DevOps - We handle all infrastructure management

Getting Started

Update your SDK configuration to use the new per-service URLs:

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

const client = new BlocksClient({
baseUrl: 'https://auth.api.us.23blocks.com',
apiKey: process.env.BLOCKS_API_KEY // pk_test_* or pk_live_*
});

Check out the Infrastructure Documentation for more technical details.


Questions? Join our Slack community or reach out to support@23blocks.com.