spiral/framework
Spiral Framework is a high-performance, long-running full-stack PHP framework built for RoadRunner. PSR-compliant components, resident memory kernel, and native support for queues, GRPC, WebSockets, and background workers.
Build vs. Buy Decision:
Roadmap Alignment:
Use Cases:
"Spiral Framework lets us build high-performance, scalable PHP systems without sacrificing developer velocity. Here’s why it’s a game-changer for [Product Name]:
- Speed: Outperforms competitors in latency-sensitive workloads (e.g., APIs, real-time features). RoadRunner’s resident memory model eliminates cold starts, critical for [use case: e.g., ‘our trading platform’].
- Cost Efficiency: Reduces cloud costs by consolidating workers (e.g., queues, WebSockets) into long-lived PHP processes, cutting infrastructure spend by ~30% vs. per-request servers.
- Reliability: Built-in queue supervision, retry policies, and Temporal workflows ensure mission-critical processes (e.g., order fulfillment) never fail silently.
- Security: PCI DSS compliance and encrypted sessions/cookies meet [compliance requirements], while RBAC aligns with our [internal governance] needs.
- Future-Proof: Spiral’s modular architecture (HMVC, CQRS) lets us decouple services as we scale, avoiding the ‘big ball of mud’ pitfall.
Competitors like Laravel/Symfony require more glue code for these features. Spiral bakes them in, accelerating time-to-market for [key initiative: e.g., ‘our real-time analytics dashboard’] by 40%."
"Spiral is a high-performance PHP framework that solves our biggest pain points:
Performance:
- RoadRunner + resident memory = No cold starts for WebSockets/GRPC.
- Cycle ORM is 25-year future-proof (unlike Eloquent’s evolving API).
- HTTP/2, FastCGI, and async queues (AMQP/SQS/Kafka) for high-throughput systems.
Architecture:
- HMVC/CQRS/RPC support for clean separation of concerns.
- Temporal.io bridge for reliable workflows (e.g., approval chains, retries).
- Isolated IoC scopes for safe multi-tenancy or microservices.
Productivity:
- Scaffolding writes boilerplate code (controllers, jobs, bootloaders) in seconds.
- Static analysis (tokenizer) finds unused classes/enums and interfaces automatically.
- PSR-compliant components mean no vendor lock-in (e.g., swap Monolog for Humbug if needed).
Reliability:
- Queue supervision and retry policies handle job failures gracefully.
- Anti-memory-leak tools keep long-running processes stable.
- PCI DSS compliance out of the box for [e-commerce/payments].
Migration path: Start with RoadRunner for queues/WebSockets, then adopt Cycle ORM and Temporal as needed. Laravel devs will feel at home with Spiral’s attribute-based routing and console commands."*
"Spiral’s hybrid runtime (PHP + Go via RoadRunner) and modular design address [specific technical debt]:
- Problem: [Current system’s] per-request PHP processes cause high latency and spiky CPU usage.
- Solution: RoadRunner’s resident memory model keeps PHP workers warm, reducing p99 latency by ~60% (vs. traditional PHP-FPM).
- Problem: [Legacy monolith] is hard to scale horizontally due to shared state.
- Solution: Spiral’s isolated IoC scopes and CQRS enable stateless services for easier microservice decomposition.
- Problem: [Queue system] lacks supervision and retry logic.
- Solution: Built-in queue interceptors and retry policies (e.g., exponential backoff) reduce manual error handling.
- Problem: [Workflow system] is brittle with manual retries and timeouts.
- Solution: Temporal.io bridge provides exactly-once execution, sagas, and human approvals out of the box.
Key trade-offs:
- Pros: Faster than Laravel/Symfony for high-load systems, batteries included (no need for 20+ Composer packages).
- Cons: Steeper learning curve for RoadRunner’s worker model and Cycle ORM’s query builder. Not ideal for simple CRUD apps.
Recommendation: Pilot with a high-traffic module (e.g., WebSocket gateway or order processing) to validate performance gains before full adoption."*
How can I help you explore Laravel packages today?