SAM
Compiler.
A distributed cloud-native IDE designed for secure, collaborative code execution within ephemeral, kernel-level isolated sandboxes.
The Security-Latency Paradox.
Direct execution of untrusted code in a multi-tenant environment is inherently dangerous. Traditional solutions sacrifice latency for security, or synchronization for simplicity. We needed a system that provided kernel-level isolation without compromising the real-time collaborative experience.
Code Injection Vulnerabilities
Untrusted user input executed at high privileges.
Resource Starvation
Infinite loops or memory leaks crashing the primary engine.
Synchronization Drift
State inconsistencies in real-time collaborative editing.
Orchestrated Isolation.
SAM Compiler solves this through a multi-tier orchestration layer. Every execution request is decoupled from the main thread, queued via BullMQ, and dispatched to a pool of ephemeral Docker workers that exist only for the duration of the task.


System Topology.
Distributed Request Lifecycle Architecture
CRDT-Based Synchronization
Implemented Yjs-inspired CRDTs for real-time collaboration. This ensures that every developer maintains a consistent state without a central 'lock' mechanism, enabling conflict-free editing across distributed nodes.
BullMQ Worker Pool
Execution tasks are managed through a robust Redis-backed queue. This allows for horizontal scaling of workers, dead-letter queue management, and prioritized execution of critical system tasks.
Ephemeral Sandboxing
Each code execution request triggers a fresh, isolated Docker container. Resource limits are strictly enforced at the container level to prevent memory leaks or CPU abuse from affecting the control plane.
Scaling Intelligence.
Horizontal Worker Scaling
The worker pool automatically expands based on the Redis queue depth, ensuring low latency during peak usage.
State De-serialization
Code states are de-serialized into ephemeral storage, allowing any worker to pick up any task without localized dependencies.
Global Fault Tolerance
Isolated workers mean a single container failure doesn't affect the IDE session. The orchestrator automatically retries failed executions.
Building SAM Compiler wasn't about the code;
it was about the infrastructure that supports it.
This project demonstrates my ability to design distributed systems, manage secure execution environments, and architect production-ready cloud platforms from the ground up.