This article highlights common pitfalls when using AI for system design, focusing on how AI often suggests overly complex solutions that don't align with actual project constraints or team capabilities. It provides actionable advice by demonstrating how to craft better prompts that guide AI towards pragmatic, appropriate architectural decisions, emphasizing simplicity and leveraging existing infrastructure.
Read original on Dev.to #architectureWhen leveraging AI for system design, it's crucial to understand its limitations. AI models, trained on vast datasets, tend to propose complex, enterprise-grade architectures that may lead to over-engineering if not properly guided. This can result in unnecessary complexity, increased cognitive load, higher maintenance costs, and inefficient resource utilization.
The key to getting valuable architectural advice from AI lies in providing detailed and constrained prompts. Instead of vague requests, incorporate specific requirements related to scale, performance, team skills, existing technology stack, budget, and consistency models. This helps AI generate solutions that are practical and context-aware.
Example: User Preferences Storage
Instead of "Design user preferences storage system", a better prompt is: "Design user preferences storage for SaaS app with 10K users. Constraints: Reads: 10 req/min, Writes: 1 req/min. Simple JSON structure. Existing PostgreSQL database. No budget for additional infrastructure. Prefer simple solution: JSONB column in users table with partial indexing for queries. If this needs to scale to 1M users, then consider caching."
By adding constraints like user count, read/write volume, existing tech, budget, and desired simplicity, the AI is guided towards a more appropriate solution (e.g., a JSONB column in PostgreSQL) rather than a complex distributed system.