Trinity Beast Infrastructure (TBI) is a high-performance, serverless cryptocurrency price oracle and reporting system built on AWS. The infrastructure leverages cutting-edge AWS services including ECS Fargate, Aurora Serverless v2 with Optimized I/O, and MemoryDB for Valkey to deliver sub-50ms average latency for price queries and comprehensive usage analytics.
Trinity Beast Infrastructure employs a modern, cloud-native architecture built entirely on AWS managed services. The system is designed for high availability, low latency, and horizontal scalability.
| Attribute | Value |
|---|---|
| Cluster Name | trinity-beast-fargate-cluster |
| Cluster ARN | arn:aws:ecs:us-east-2:211998422884:cluster/trinity-beast-fargate-cluster |
| Region | us-east-2 (Ohio) |
| Launch Type | Fargate (Serverless) |
| Total Tasks | 3 (1 Main + 1 Mirror + 1 LRS) |
| Platform Version | LATEST (1.4.0) |
The ECS Fargate cluster orchestrates all containerized workloads for Trinity Beast. It manages three distinct services, each running the unified Trinity Beast application with different configurations (SERVER_TYPE environment variable).
| Attribute | Value |
|---|---|
| Service Name | trinity-beast-main-service |
| Service ARN | arn:aws:ecs:us-east-2:211998422884:service/trinity-beast-fargate-cluster/trinity-beast-main-service |
| Task Definition | trinity-beast-lpo-task:5 |
| Desired Count | 1 task |
| Server Type | APP_SERVER (LPO Only) |
| Node Name | BeastMain |
| CPU | 2048 (2 vCPU) |
| Memory | 4096 MB (4 GB) |
| Architecture | X86_64 (AMD64) |
Primary LPO service handling cryptocurrency price queries. Optimized for high-throughput price requests with local memory caching and MemoryDB fallback. Handles TCP (port 8080) and UDP (port 2679) protocols.
SERVER_TYPE=APP_SERVER
MEMORYDB_URL=clustercfg.trinity-beast-memdb-single-region.ptsbmm.memorydb.us-east-2.amazonaws.com
AURORA_URL=vpce-01935c7c9df23d302-30hrzsj5.rds.us-east-2.vpce.amazonaws.com
TCP_PORT_LPO=8080
UDP_PORT_LPO=2679
CLUSTER_NODE=BeastMain
NODE_ENV=production
| Attribute | Value |
|---|---|
| Service Name | trinity-beast-mirror-service |
| Service ARN | arn:aws:ecs:us-east-2:211998422884:service/trinity-beast-fargate-cluster/trinity-beast-mirror-service |
| Task Definition | trinity-beast-mirror-task:5 |
| Desired Count | 1 task |
| Server Type | APP_SERVER (LPO Only) |
| Node Name | BeastMirror |
| CPU | 2048 (2 vCPU) |
| Memory | 4096 MB (4 GB) |
| Architecture | X86_64 (AMD64) |
Mirror service providing LPO price queries only. Configured as APP_SERVER for load distribution and high availability. Handles TCP (port 8080) and UDP (port 2679) protocols for price requests.
| Attribute | Value |
|---|---|
| Service Name | trinity-beast-lrs-service |
| Service ARN | arn:aws:ecs:us-east-2:211998422884:service/trinity-beast-fargate-cluster/trinity-beast-lrs-service |
| Task Definition | trinity-beast-lrs-task:3 |
| Desired Count | 1 task |
| Server Type | APP_REPORT_SERVER (LPO + LRS) |
| Node Name | BeastLRS |
| CPU | 4096 (4 vCPU) |
| Memory | 8192 MB (8 GB) |
| Architecture | X86_64 (AMD64) |
Combined service providing both LPO price queries and LRS reporting capabilities. Configured as APP_REPORT_SERVER with higher resource allocation to support concurrent price fetching and report generation. Handles both TCP (ports 8080, 9090) and UDP (ports 2679, 2680) protocols.
211998422884.dkr.ecr.us-east-2.amazonaws.com/trinity-beast-lpo-server:latestsha256:61acf2a32a004e782165ee07d1f0513f54607895be89b194c773979d370e9ec5
| Task Definition | Family | Revision | CPU | Memory | Platform |
|---|---|---|---|---|---|
| LPO Task | trinity-beast-lpo-task | 5 | 2048 | 4096 MB | X86_64/LINUX |
| Mirror Task | trinity-beast-mirror-task | 5 | 4096 | 8192 MB | X86_64/LINUX |
| LRS Task | trinity-beast-lrs-task | 3 | 2048 | 4096 MB | X86_64/LINUX |
| Attribute | Value |
|---|---|
| Cluster Identifier | cpmp-aurora-cluster-east2 |
| Cluster ARN | arn:aws:rds:us-east-2:211998422884:cluster:cpmp-aurora-cluster-east2 |
| Engine | Aurora PostgreSQL 15.5 |
| Deployment | Serverless v2 with Optimized I/O |
| Endpoint (Writer) | cpmp-aurora-cluster-east2-cluster.cluster-cvg4oeysemon.us-east-2.rds.amazonaws.com |
| VPC Endpoint | vpce-01935c7c9df23d302-30hrzsj5.rds.us-east-2.vpce.amazonaws.com |
| Port | 5432 |
| Multi-AZ | Yes (3 AZs) |
Primary relational database storing API keys, user accounts, subscription data, application parameters, and transaction logs. Aurora Serverless v2 automatically scales compute capacity based on demand, eliminating the need for capacity planning.
| Attribute | Value |
|---|---|
| Cluster Name | trinity-beast-memdb-single-region |
| Cluster ARN | arn:aws:memorydb:us-east-2:211998422884:cluster/trinity-beast-memdb-single-region |
| Engine | Valkey 7.2 |
| Node Type | db.r7g.large (Graviton3) |
| Nodes | 1 (Single-node cluster) |
| Endpoint | clustercfg.trinity-beast-memdb-single-region.ptsbmm.memorydb.us-east-2.amazonaws.com |
| Port | 6379 |
| Encryption | In-transit + At-rest |
High-performance in-memory cache for cryptocurrency prices and usage analytics. MemoryDB provides Redis-compatible data structures with microsecond latency and automatic persistence to durable storage.
| Attribute | Value |
|---|---|
| VPC ID | vpc-03deaddb7083cd59c |
| CIDR Block | 10.0.0.0/16 (65,536 IPs) |
| Region | us-east-2 (Ohio) |
| DNS Hostnames | Enabled |
| DNS Resolution | Enabled |
| Subnet ID | AZ | CIDR | Type | Purpose |
|---|---|---|---|---|
| subnet-06781ce7266a4b870 | us-east-2a | 10.0.1.0/24 | Public | ALB |
| subnet-0e7e032219e0a6956 | us-east-2b | 10.0.2.0/24 | Public | ALB |
| subnet-0d77afcde34842b5c | us-east-2c | 10.0.3.0/24 | Public | ALB |
| subnet-0433c423c48c88fa8 | us-east-2a | 10.0.11.0/24 | Private | MemoryDB |
| subnet-0fb79c9f7d01b8997 | us-east-2b | 10.0.12.0/24 | Private | MemoryDB |
| subnet-0595eb04f1ba859f0 | us-east-2c | 10.0.13.0/24 | Private | MemoryDB |
| Attribute | Value |
|---|---|
| Name | trinity-beast-alb-v3 |
| ARN | arn:aws:elasticloadbalancing:us-east-2:211998422884:loadbalancer/app/trinity-beast-alb-v3/3334a0f208e5d4c7 |
| DNS Name | trinity-beast-alb-v3-875828767.us-east-2.elb.amazonaws.com |
| Scheme | Internet-facing |
| IP Address Type | IPv4 |
| Listeners | HTTP:80, HTTPS:443, HTTP:8080 |
| Name | Port | Protocol | Health Check |
|---|---|---|---|
| trinity-beast-fargate-group | 8080 | HTTP | /health (30s interval) |
| trinity-beast-targets-v3 | 8080 | HTTP | /health (30s interval) |
| Group ID | Name | Purpose | Inbound Rules |
|---|---|---|---|
| sg-050b617f93b2388f6 | ECS Tasks SG | ECS task security | 8080/tcp from 10.0.0.0/16 9090/tcp from 10.0.0.0/16 |
| sg-08a14f22df269a909 | MemoryDB SG | MemoryDB access | 6379/tcp from sg-050b617f93b2388f6 |
MemoryDB delivers consistent microsecond read and write latency even under heavy load:
Real-World Impact: Price queries hit MemoryDB cache 85-95% of the time, resulting in total response times of 5-10ms including network overhead and application processing.
Traditional Aurora charges separately for I/O operations, which can be unpredictable during traffic spikes. Optimized I/O bundles I/O into compute costs:
Aurora Serverless v2 scales compute capacity in 0.5 ACU increments (1-16 ACU range):
Fargate eliminates the need to provision and manage EC2 instances:
Scaling Note: All components can scale up with simple parameter adjustmentsβincreased capacity is available in less than 5 minutes for Aurora ACU, ECS task count, and MemoryDB node upgrades.
| Component | Setting | Current Value | Impact | |
|---|---|---|---|---|
| Aurora | I/O Model | Optimized I/O | 40% cost reduction, unlimited IOPS | |
| Aurora | ACU Range | 1-16 ACU | Auto-scales based on demand | |
| MemoryDB | Node Type | db.r7g.large | 13 GB memory, 100K+ ops/sec | |
| ECS | Launch Type | Fargate | No infrastructure management, serverless scaling | |
| ALB | Idle Timeout | 60s | 300s | Better connection reuse, reduced overhead |
| Operation | Component | Latency | Notes |
|---|---|---|---|
| DNS Resolution | Route 53 | <5ms | Cached by client |
| TLS Handshake | ALB | 10-20ms | First request only |
| Load Balancing | ALB | <1ms | Minimal overhead |
| API Key Validation | Aurora | 1-3ms | Indexed query |
| Cache Lookup | MemoryDB | <1ms | In-memory read |
| Exchange API Call | External | 20-40ms | Cache miss only |
| Cache Write | MemoryDB | <1ms | Async operation |
| Transaction Log | Aurora | 2-5ms | Async operation |
| JSON Serialization | Application | <1ms | Minimal overhead |
Trinity Beast Infrastructure is defined and deployed using AWS CloudFormation stacks, enabling:
| Component | Backup Method | Frequency | Retention | RTO | RPO |
|---|---|---|---|---|---|
| Aurora | Automated Snapshots | Daily | 7 days | <15 min | 5 min |
| MemoryDB | Automated Snapshots | Daily | 7 days | <10 min | 1 hour |
| ECS Tasks | ECR Image Tags | Per deployment | Unlimited | <2 min | 0 |
| Configuration | CloudFormation | Per change | Unlimited | <5 min | 0 |
# 1. Deploy CloudFormation stack
aws cloudformation create-stack \
--stack-name trinity-beast-production \
--template-body file://infrastructure.yaml \
--region us-east-2
# 2. Restore Aurora from snapshot
aws rds restore-db-cluster-from-snapshot \
--db-cluster-identifier trinity-beast-restored \
--snapshot-identifier latest-snapshot
# 3. Restore MemoryDB from snapshot
aws memorydb restore-cluster-from-snapshot \
--cluster-name trinity-beast-memdb-restored \
--snapshot-name latest-snapshot
# 4. Deploy ECS services
aws ecs update-service \
--cluster trinity-beast-fargate-cluster \
--service trinity-beast-main-service \
--force-new-deployment
# Total Recovery Time: ~20 minutes
| Metric | Source | Threshold | Action |
|---|---|---|---|
| CPU Utilization | ECS Tasks | >80% | Scale up tasks |
| Memory Utilization | ECS Tasks | >85% | Scale up tasks |
| Request Count | ALB | >5000/min | Monitor for scaling |
| Target Response Time | ALB | >100ms | Investigate performance |
| Unhealthy Targets | ALB | >0 | Alert operations |
| Database Connections | Aurora | >4000 | Review connection pooling |
| Cache Hit Rate | MemoryDB | <80% | Review cache strategy |
Note: Actual monthly costs vary based on usage patterns, Aurora ACU scaling, data transfer, and CloudWatch logging. The infrastructure is designed for cost efficiency through:
| Component | Specification | Monthly Cost | % of Total |
|---|---|---|---|
| ECS Fargate - Main | 1 task Γ 2 vCPU Γ 4 GB | $30 | 14% |
| ECS Fargate - Mirror | 1 task Γ 2 vCPU Γ 4 GB | $30 | 14% |
| ECS Fargate - LRS | 1 task Γ 4 vCPU Γ 8 GB | $60 | 28% |
| Aurora Serverless v2 | 0.5 ACU avg, Optimized I/O | $25 |