Architecture Flexibility
Don't Lock Yourself In
Every architecture choice has a cost. The wrong one just hides it longer.
The Problem: Decisions That Age Badlyβ
βοΈ Microservices Too Soonβ
The Decision: "We'll need to scale, so let's start with microservices."
The Wall:
- Coordination overhead kills velocity
- Operational complexity from day 1
- More infrastructure than features
Result: Slow to ship and expensive to run β paying the price for premature complexity. Your team spends more on DevOps overhead (orchestration, monitoring, deployments) than you've saved in theoretical scalability gains.
π§± Monolith Scaling Wallβ
The Decision: "Keep it simple, build a monolith."
The Wall:
- Can't scale parts independently
- Deploy everything or nothing
- One bottleneck affects all features
Result: A costly migration project that diverts your team from building business value. Engineering effort gets redirected from features to infrastructure refactoring.
The Pikku Wayβ
Instead of betting on one architecture upfront, Pikku lets you adapt:
- Start simple to save time and money early on (monolith, serverlessβwhatever fits your current needs)
- Switch runtimes as economics or requirements change (scale, cost, compliance) without code rewrites
- Same code, same types, near-zero switching costs β deploy the same logic to any runtime
Pikku lets you defer big architectural commitments without incurring technical debt or surprise costs later. Infrastructure becomes an addon, not a core feature.
Real-World Scenario: Adapting Without Rewritesβ
How one company adapted infrastructure as economics changedβwithout a single rewrite:
// Day 1: Start serverless β zero ops overhead
import { corsHTTP } from '@pikku/lambda/http'
export const handler = async (event: APIGatewayProxyEvent) => {
return await corsHTTP(event, services, createSession)
}
// β
No servers to manage, instant auto-scaling
// β
Pay only for requests, perfect for early stage
// π° Focus 100% on product, not infrastructure
// Year 1: Enterprise client requires on-premise deployment
import { PikkuExpressServer } from '@pikku/express'
const enterpriseServer = new PikkuExpressServer(config, services, createSession)
await enterpriseServer.start()
// β
Same code, deployed on-premise for compliance
// β
Meets data residency requirements
// π Landed enterprise deal worth 10x the infrastructure cost
// Year 2: Lambda gets slow and expensive at scale
// Switch to Kubernetes cluster (or ECS, or VMs)
import { PikkuFastifyServer } from '@pikku/fastify'
const server = new PikkuFastifyServer(config, services, createSession)
await server.start()
// β
Predictable costs, better performance
// β
Deploy to Kubernetes, ECS, or any container platform
// π° Cut infrastructure costs by 60% with dedicated resources
Same code, different economics at each stage.
Pikku's Philosophyβ
- Write portable code by default β No runtime-specific imports in your functions
- Choose your runtime at deploy time β Not at write time
- Switch without rewrites β Change config, not code
- Mix and match β HTTP on Lambda, WebSockets on a server, queues on BullMQ
The Benefitsβ
β Start Simpleβ
Begin with the simplest architecture that works. No premature optimization, no unnecessary complexity.
Deploy as a monolith on a single server or go serverless for instant auto-scaling.
β Scale Smartβ
When requirements change, adapt your architecture without rewriting code.
Move specific functions to different runtimes based on their needs.
β Mix & Matchβ
Run different parts of your application on different platforms simultaneously.
HTTP APIs on Lambda, WebSockets on a dedicated server, queues on BullMQ.
β Zero Rewritesβ
Infrastructure changes are configuration changes, not code changes.
Your team builds features instead of managing migrations.
Next Stepsβ
- Learn about vendor lock-in β See the research on why flexibility matters
- Get started β Build your first portable backend
Get Started
Ready to try Pikku? Get up and running in 5 minutes.
Learn More
Dive deeper into why Pikku gives you the flexibility to succeed.
Questions or Feedback?
- π» GitHub
- π¬ Discussions
- π Documentation
- π¦ Twitter/X
- π¬ Discord