Backend-Driven Architecture
Scheduled workflows + durable artifacts
What is it?
The backend runs on a schedule, produces artifacts, and stores them in a database. The frontend simply reads and displays these pre-generated results. This is the "AI factory" model.
Instead of triggering expensive AI processing on every user interaction, you batch the work, run it periodically, and serve cached results. This makes costs predictable, results reproducible, and scaling straightforward.
💡 Key Insight
"More predictable, more reproducible, and easier to scale than triggering expensive AI work on every user interaction. The 'factory' pattern separates production from consumption."
Tradeoffs
Advantages
- Predictable costs - know exactly what you'll spend
- Reproducible results - same input, same output
- Easy caching - serve pre-generated content fast
- Scheduled processing - run during off-peak hours
- Multi-agent pipelines - complex workflows work well
Tradeoffs
- Less immediate - content updates on schedule
- Requires infrastructure - servers, databases, cron
- Storage overhead - need to persist artifacts
- Not interactive - users can't customize on demand
Technical Deep Dive
Architecture
The backend-driven pattern separates AI "production" from "consumption." Scheduled jobs run workflows, multiple agents collaborate to create artifacts, and results are stored in SQL/NoSQL databases for fast retrieval.
- •Scheduler: Cron jobs or cloud functions on schedule
- •AI Pipeline: Multi-agent workflows (search → analyze → write → store)
- •Storage: PostgreSQL, MongoDB, or similar for artifacts
- •Frontend: Simple read-only interface serving cached data
Example Workflow: News with Otto
- 1.Scheduled Trigger: Every 6 hours, a cron job fires
- 2.Search Agent: Searches for news per topic
- 3.Analysis Agent: Filters and ranks sources
- 4.Writing Agent: Crafts summaries and stories
- 5.Storage: Stores articles in SQL database
- 6.Frontend: Users browse pre-generated content instantly
When to Use This Pattern
- ✓Content generation (news, reports, summaries)
- ✓Batch data processing and analysis
- ✓When cost predictability is critical
- ✓Multi-step AI workflows that don't need real-time
- ✓Apps serving many users the same content
When NOT to Use This Pattern
- ✗When users need immediate, personalized responses
- ✗Interactive, conversational experiences
- ✗When every user needs different output
- ✗Time-sensitive applications requiring instant updates
Apps Using This Pattern
Want to explore other architecture patterns?
View All Patterns