RFC-018: POC Implementation Strategy
Status: Implemented (POC 1 ✅, POC 2 ✅, POC 3-5 In Progress) Author: Platform Team Created: 2025-10-09 Updated: 2025-10-10
Abstract
This RFC defines the implementation strategy for Prism's first Proof-of-Concept (POC) systems. After extensive architectural design across 17 RFCs, 4 memos, and 50 ADRs, we now have a clear technical vision. This document translates that vision into executable POCs that demonstrate end-to-end functionality and validate our architectural decisions.
Key Principle: "Walking Skeleton" approach - build the thinnest possible end-to-end slice first, then iteratively add complexity.
Goal: Working code that demonstrates proxy → plugin → backend → client integration with minimal scope.
Motivation
Current State
Strong Foundation (Documentation):
- ✅ 17 RFCs defining patterns, protocols, and architecture
- ✅ 50 ADRs documenting decisions and rationale
- ✅ 4 Memos providing implementation guidance
- ✅ Clear understanding of requirements and trade-offs
Gap: No Working Code:
- ❌ No running proxy implementation
- ❌ No backend plugins implemented
- ❌ No client libraries available
- ❌ No end-to-end integration tests
- ❌ No production-ready deployments
The Problem: Analysis Paralysis Risk
With extensive documentation, we risk:
- Over-engineering: Building features not yet needed
- Integration surprises: Assumptions that don't hold when components connect
- Feedback delay: No real-world validation of design decisions
- Team velocity: Hard to estimate without concrete implementation experience
The Solution: POC-Driven Implementation
Benefits of POC Approach:
- Fast feedback: Validate designs with working code
- Risk reduction: Find integration issues early
- Prioritization: Focus on critical path, defer nice-to-haves
- Momentum: Tangible progress builds team confidence
- Estimation: Realistic velocity data for planning
Goals
- Demonstrate viability: Prove core architecture works end-to-end
- Validate decisions: Confirm ADR/RFC choices with implementation
- Identify gaps: Surface missing requirements or design flaws
- Establish patterns: Create reference implementations for future work
- Enable dogfooding: Use Prism internally to validate UX
Non-Goals
- Production readiness: POCs are learning vehicles, not production systems
- Complete feature parity: Focus on critical path, not comprehensive coverage
- Performance optimization: Correctness over speed initially
- Multi-backend support: Start with one backend per pattern
- Operational tooling: Observability/deployment can be manual
RFC Review and Dependency Analysis
Foundational RFCs (Must Implement)
RFC-008: Proxy Plugin Architecture
Status: Foundational - Required for all POCs
What it defines:
- Rust proxy with gRPC plugin interface
- Plugin lifecycle (initialize, execute, health, shutdown)
- Configuration-driven plugin loading
- Backend abstraction layer
POC Requirements:
- Minimal Rust proxy with gRPC server
- Plugin discovery and loading
- Single namespace support
- In-memory configuration
Complexity: Medium (Rust + gRPC + dynamic loading)
RFC-014: Layered Data Access Patterns
Status: Foundational - Required for POC 1-3
What it defines:
- Six client patterns: KeyValue, PubSub, Queue, TimeSeries, Graph, Transactional
- Pattern semantics and guarantees
- Client API shapes
POC Requirements:
- Implement KeyValue pattern first (simplest)
- Then PubSub pattern (messaging)
- Defer TimeSeries, Graph, Transactional
Complexity: Low (clear specifications)
RFC-016: Local Development Infrastructure
Status: Foundational - Required for development
What it defines:
- Signoz for observability
- Dex for OIDC authentication
- Developer identity auto-provisioning
POC Requirements:
- Docker Compose for Signoz (optional initially)
- Dex with dev@local.prism user
- Local backend instances (MemStore, Redis, NATS)
Complexity: Low (Docker Compose + existing tools)
Backend Implementation Guidance
MEMO-004: Backend Plugin Implementation Guide
Status: Implementation guide - Required for backend selection
What it defines:
- 8 backends ranked by implementability
- MemStore (rank 0, score 100/100) - simplest
- Redis, PostgreSQL, NATS, Kafka priorities
POC Requirements:
- Start with MemStore (zero dependencies, instant)
- Then Redis (score 95/100, simple protocol)
- Then NATS (score 90/100, lightweight messaging)
Complexity: Varies (MemStore = trivial, Redis = easy, NATS = medium)
Testing and Quality
RFC-015: Plugin Acceptance Test Framework
Status: Quality assurance - Required for POC validation
What it defines:
- testcontainers integration
- Reusable authentication test suite
- Backend-specific verification tests
POC Requirements:
- Basic test harness for POC 1
- Full framework for POC 2+
- CI integration for automated testing
Complexity: Medium (testcontainers + Go testing)
Authentication and Authorization
RFC-010: Admin Protocol with OIDC
Status: Admin plane - Deferred to POC 4+
What it defines:
- OIDC-based admin API authentication
- Namespace CRUD operations
- Session management
POC Requirements:
- Defer: POCs can use unauthenticated admin API initially
- Implement for POC 4 when demonstrating security
Complexity: Medium (OIDC integration)
RFC-011: Data Proxy Authentication
Status: Data plane - Deferred to POC 4+
What it defines:
- Client authentication for data operations
- JWT validation in proxy
- Per-namespace authorization
POC Requirements:
- Defer: Initial POCs can skip authentication
- Implement when demonstrating multi-tenancy
Complexity: Medium (JWT + policy engine)
Advanced Patterns
RFC-017: Multicast Registry Pattern
Status: Composite pattern - POC 4 candidate
What it defines:
- Register + enumerate + multicast operations
- Schematized backend slots
- Filter expression language
POC Requirements:
- Implement after basic patterns proven
- Demonstrates pattern composition
- Tests backend slot architecture
Complexity: High (combines multiple primitives)
RFC-009: Distributed Reliability Patterns
Status: Advanced - Deferred to post-POC
What it defines:
- Circuit breakers, retries, bulkheads
- Outbox pattern for exactly-once
- Shadow traffic for migrations
POC Requirements:
- Defer: Focus on happy path initially
- Add resilience patterns after core functionality proven
Complexity: High (complex state management)
POC Selection Criteria
Criteria for POC Ordering
- Architectural Coverage: Does it exercise critical components?
- Dependency Chain: What must be built first?
- Risk Reduction: Does it validate high-risk assumptions?
- Complexity: Can it be completed in 1-2 weeks?
- Demonstrability: Can we show it working end-to-end?
RFC Dependency Graph
┌─────────────────────────────────┐
│ RFC-016: Local Dev Infra │
│ (Signoz, Dex, Backends) │
└────────────┬────────────────────┘
│
┌────────────▼────────────────────┐
│ RFC-008: Proxy Plugin Arch │
│ (Foundation for all) │
└────────────┬────────────────────┘
│
┌────────────▼────────────────────┐
│ RFC-014: Client Patterns │
│ (KeyValue, PubSub, etc.) │
└────────────┬────────────────────┘
│
┌───────────────┴───────────────┐
│ │
┌──────────▼──────────┐ ┌────────── ▼──────────┐
│ MEMO-004: Backends │ │ RFC-015: Testing │
│ (MemStore → Redis) │ │ (Acceptance Tests) │
└──────────┬──────────┘ └──────────┬──────────┘
│ │
└───────────────┬───────────────┘
│
┌────────────▼────────────────────┐
│ RFC-017: Multicast Registry │
│ (Composite Pattern) │
└─────────────────────────────────┘
Critical Path: RFC-016 → RFC-008 → RFC-014 + MEMO-004 → RFC-015
POC 1: KeyValue with MemStore (Walking Skeleton) ✅ COMPLETED
Status: ✅ COMPLETED (2025-10-10) Actual Timeline: 1 week (faster than estimated!) Complexity: Medium (as expected)
Objective
Build the thinnest possible end-to-end slice demonstrating:
- Rust proxy spawning and managing pattern processes
- Go pattern communicating via gRPC (PatternLifecycle service)
- MemStore backend (in-memory)
- Full lifecycle orchestration (spawn → connect → initialize → start → health → stop)
Implementation Results
What We Actually Built (differs slightly from original plan):
1. Rust Proxy (proxy/) - ✅ Exceeded Expectations
Built:
- Complete pattern lifecycle manager with 4-phase orchestration (spawn → connect → initialize → start)
- gRPC client for pattern communication using tonic
- gRPC server for KeyValue client requests
- Dynamic port allocation (9000 + hash(pattern_name) % 1000)
- Comprehensive structured logging with tracing crate
- Process spawning and management
- Graceful shutdown with health checks
- 20 passing tests (18 unit + 2 integration)
- Zero compilation warnings
Key Changes from Plan:
- ✅ Pattern invocation via child process + gRPC (not shared libraries)
- ✅ Integration test with direct gRPC (no Python client needed)
- ✅ Implemented full TDD approach (not originally specified)
- ✅ Added Makefile build system (not originally planned)
2. Go Pattern SDK (patterns/core/) - ✅ Better Than Expected
Built:
- Plugin interface (Initialize, Start, Stop, Health)
- Bootstrap infrastructure with lifecycle management
- ControlPlaneServer with gRPC lifecycle service
- LifecycleService bridging Plugin trait to PatternLifecycle gRPC
- Structured JSON logging with slog
- Configuration management with YAML
- Optional config file support (uses defaults if missing)
Key Changes from Plan:
- ✅ Implemented full gRPC PatternLifecycle service (was "load from config")
- ✅ Better separation: core SDK vs pattern implementations
- ✅ Made patterns executable binaries (not shared libraries)
3. MemStore Pattern (patterns/memstore/) - ✅ As Planned + Extras
Built:
- In-memory key-value store using sync.Map
- Full KeyValue pattern operations (Set, Get, Delete, Exists)
- TTL support with automatic cleanup
- Capacity limits with eviction
--grpc-portCLI flag for dynamic port allocation- Optional config file (defaults if missing)
- 5 passing tests with 61.6% coverage
- Health check implementation
Key Changes from Plan:
- ✅ Added TTL support early (was planned for POC 2)
- ✅ Added capacity limits (not originally planned)
- ✅ Better CLI interface with flags
4. Protobuf Definitions (proto/) - ✅ Complete
Built:
prism/pattern/lifecycle.proto- PatternLifecycle serviceprism/pattern/keyvalue.proto- KeyValue data serviceprism/common/types.proto- Shared types- Go code generation with protoc-gen-go
- Rust code generation with tonic-build
Key Changes from Plan:
- ✅ Separated lifecycle from data operations (cleaner design)
5. Build System (Makefile) - ✅ Not Originally Planned!
Built (added beyond original scope):
- 46 make targets organized by category
- Default target builds everything
make testruns all unit testsmake test-integrationruns full lifecycle testmake coveragegenerates coverage reports- Colored output (blue progress, green success)
- PATH setup for multi-language tools
BUILDING.mdcomprehensive guide
Rationale: Essential for multi-language project with Rust + Go
6. Proxy-to-Pattern Architecture - ✅ Exceeded Expectations!
How It Works:
The proxy doesn't load patterns as shared libraries - instead, it spawns them as independent child processes and communicates via gRPC:
┌─────────────────────────────────────────────────────────────┐
│ Rust Proxy Process │
│ ┌────────────────────────────────────────────────────────┐ │
│ │ PatternManager (lifecycle orchestration) │ │
│ │ │ │
│ │ 1. spawn("memstore --grpc-port 9876") │ │
│ │ 2. connect gRPC client to localhost:9876 │ │
│ │ 3. call Initialize(name, version, config) │ │
│ │ 4. call Start() │ │
│ │ 5. poll HealthCheck() periodically │ │
│ │ 6. call Stop() on shutdown │ │
│ └────────────────────────────────────────────────────────┘ │
│ │ │
│ │ gRPC PatternLifecycle │
│ │ (tonic client) │
└──────────────────────────┼───────────────────────────────────┘
│
│ http://localhost:9876
│
┌──────────────────────────▼───────────────────────────────────┐
│ Go Pattern Process (MemStore) │
│ ┌────────────────────────────────────────────────────────┐ │
│ │ PatternLifecycle gRPC Server (port 9876) │ │
│ │ │ │
│ │ Handles: │ │
│ │ - Initialize(req) → setup config, connect backend │ │
│ │ - Start(req) → begin serving, start background tasks │ │
│ │ - HealthCheck(req) → return pool stats, key counts │ │
│ │ - Stop(req) → graceful shutdown, cleanup resources │ │
│ └────────────────────────────────────────────────────────┘ │
│ │ │
│ ┌────────────────────────▼────────────────────────────────┐ │
│ │ Plugin Interface Implementation │ │