Core Architecture Overview

Understanding the fundamental design principles and component relationships

MetaObjects Platform Architecture

Application Layer
Java Services React/TypeScript UI Python Analytics C# Legacy Systems
Generation Layer
Java Generator TypeScript Generator Python Generator SQL Generator
Runtime Layer
MetaData Registry Validation Engine Transform Engine Event Bus
Storage Layer
Metadata Store Version Control Configuration DB Cache Layer

Metadata Structure & Design

The core metadata model that drives consistent code generation

MetaObject Definition

The foundational metadata structure for business entities:

{
  "metaObject": {
    "name": "Customer",
    "type": "entity",
    "version": "1.2",
    "namespace": "com.company.core",
    "attributes": {
      "table": "customers",
      "cacheable": true,
      "auditable": true
    },
    "children": [
      {
        "field": {
          "name": "id",
          "type": "long",
          "key": "primary",
          "generated": true
        }
      },
      {
        "field": {
          "name": "email",
          "type": "string",
          "validation": ["required", "email", "unique"],
          "maxLength": 255,
          "pii": true
        }
      }
    ]
  }
}

Type System

Built-in types with cross-language mapping:

Core Types:
• string → String/string/str
• long → Long/number/int
• decimal → BigDecimal/number/Decimal
• boolean → Boolean/boolean/bool
• date → LocalDate/Date/datetime
• datetime → LocalDateTime/Date/datetime
• binary → byte[]/Uint8Array/bytes

Complex Types:
• object → Custom class/interface/class
• array → List<T>/T[]/List[T]
• map → Map<K,V>/Record<K,V>/Dict[K,V]

Validation Types:
• email, phone, url, regex
• min, max, minLength, maxLength
• required, unique, indexed

Code Generation Pipeline

How metadata transforms into production-ready code across multiple languages

Generation Flow

Metadata Definition Parser & Validator Template Engine
Java Code TypeScript Code Python Code SQL Schema

Java Generation Example

From metadata to Spring Boot entity:

@Entity
@Table(name = "customers")
@Cacheable
@Audited
public class Customer {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    
    @Column(name = "email", unique = true, 
            nullable = false, length = 255)
    @Email
    @PersonalData
    private String email;
    
    // Generated constructors, getters, setters
    // Generated builder pattern
    // Generated equals/hashCode/toString
}

TypeScript Generation Example

Same metadata to TypeScript interface:

export interface Customer {
  id: number;
  email: string;
}

export const CustomerSchema = z.object({
  id: z.number().int().positive(),
  email: z.string().email().max(255),
});

export class CustomerValidator {
  static validate(data: unknown): Customer {
    return CustomerSchema.parse(data);
  }
  
  static isValid(data: unknown): boolean {
    return CustomerSchema.safeParse(data).success;
  }
}

Runtime Architecture

How the platform operates at runtime for maximum flexibility

MetaData Registry

Central registry for runtime metadata access:

@Service
public class MetaDataRegistry {
    private final ConcurrentHashMap<String, MetaObject> cache;
    private final MetaDataStore store;
    
    public MetaObject getMetaObject(String name) {
        return cache.computeIfAbsent(name, 
            k -> store.loadMetaObject(k));
    }
    
    public void invalidateCache(String name) {
        cache.remove(name);
        eventBus.publish(new MetaObjectChanged(name));
    }
    
    // Hot-reload support
    @EventListener
    public void onMetaDataChange(MetaDataChangeEvent event) {
        invalidateCache(event.getObjectName());
    }
}

Dynamic Processing

Runtime adaptation without redeployment:

@Component
public class DynamicEntityProcessor {
    
    public void processEntity(String entityType, 
                            Map<String, Object> data) {
        MetaObject meta = registry.getMetaObject(entityType);
        
        // Validate using current metadata
        ValidationResult result = validator.validate(meta, data);
        if (!result.isValid()) {
            throw new ValidationException(result.getErrors());
        }
        
        // Process each field dynamically
        for (MetaField field : meta.getFields()) {
            Object value = data.get(field.getName());
            processField(field, value);
        }
    }
    
    private void processField(MetaField field, Object value) {
        // Handle new fields automatically
        if (field.hasAttribute("newField")) {
            handleNewField(field, value);
        }
        
        // Apply compliance rules
        if (field.isPII()) {
            applyPIIProtection(field, value);
        }
    }
}

Performance & Scalability

Benchmarks and design decisions for enterprise-scale deployments

Performance Benchmarks

Production performance measurements:

Metadata lookup (cached) 0.001ms
Runtime validation per field 0.002ms
Dynamic entity processing 0.1ms
Code generation (full entity) 15ms

Measured on: 8-core Intel Xeon, 32GB RAM, production workloads with 100M+ daily operations

Scalability Design

Architecture patterns for enterprise applications:

  • Horizontal Scaling: Stateless runtime components
  • Caching Strategy: Multi-tier caching with invalidation
  • Event-Driven: Async metadata change propagation
  • Database Sharding: Metadata partitioning support
  • CDN Integration: Generated code distribution
Scaling Pattern

Load Balancer
App Server 1 App Server 2 App Server N
Redis Cache Cluster
Metadata DB Primary Read Replicas

Integration Patterns

Common patterns for integrating MetaObjects with existing enterprise systems

Legacy System Wrapper

Gradual modernization without disruption:

Modern Services
MetaObjects Layer
Adapter Pattern
Legacy COBOL/Mainframe
  • Zero-downtime gradual migration
  • Consistent API surface
  • Legacy system isolation
  • Modern tooling integration

Microservices Architecture

Consistent data models across services:

Shared Metadata Registry
User Service Order Service Payment Service
PostgreSQL MongoDB Redis
  • Guaranteed data model consistency
  • Automatic API contract generation
  • Cross-service validation
  • Event schema management

Technical Specifications

Platform requirements and supported technologies

System Requirements

Minimum Production Requirements:

  • Runtime: Java 11+, Node.js 16+, Python 3.8+
  • Memory: 2GB minimum, 8GB recommended
  • CPU: 2 cores minimum, 4+ recommended
  • Storage: 1GB for metadata, scales with usage
  • Database: PostgreSQL 12+, MySQL 8+, Oracle 12c+
  • Cache: Redis 6+ (optional but recommended)

Supported Technologies

Generation Targets:

Languages: Java, TypeScript, JavaScript, Python, C#, SQL
Frameworks: Spring Boot, React, Express, Django, Flask, .NET Core
Databases: PostgreSQL, MySQL, Oracle, SQL Server, MongoDB
Validation: Bean Validation, Zod, Pydantic, Joi
Build Tools: Maven, Gradle, npm, pip, dotnet

Enterprise Features

Production-Ready Capabilities:

  • High Availability: Active-passive clustering
  • Security: RBAC, audit logging, encryption at rest
  • Monitoring: JMX, Prometheus, custom metrics
  • Backup: Point-in-time recovery, metadata versioning
  • Deployment: Docker, Kubernetes, Helm charts
  • CI/CD: Jenkins, GitLab, GitHub Actions integration

Ready to Dive Deeper?

Explore the technical implementation and see MetaObjects in action