Design Scalable Product Backends
AtlassianSoftware Engineer · OnsiteLast updated
This problem tests your ability to design a high-throughput, distributed task management system, focusing on data modeling, concurrency control, and scalability for collaborative features.
Scenario
Design a backend for a product management platform similar to Jira or Trello. Users should be able to create tasks, update their status, and move them across different workflow columns (e.g., 'To Do', 'In Progress', 'Done').
Requirements
Functional
- Users can create, read, update, and delete (CRUD) tasks within a project.
- Users can transition tasks through a defined workflow.
- Multiple users may view or update the same project simultaneously.
Non-Functional
- High read availability: project boards should load quickly even with thousands of tasks.
- Consistency: task state changes must be atomic and reflected accurately for all users.
- Scalability: the system must support millions of tasks across thousands of projects.
Discussion Points
- Data Model: Design the schema for tasks and projects. How will you store task history and workflow metadata?
- Concurrency: How do you prevent 'lost updates' when two users drag-and-drop the same task simultaneously?
- API Design: Define the primary endpoints for task retrieval and status updates.
- Scale: How would you optimize the dashboard view if a single project contains over 5,000 active tasks? Consider pagination, filtering, or caching strategies.
- Real-time updates: How would you push status changes to other users looking at the same board without overwhelming the client?
Hints
Hint 1
Consider using an Optimistic Locking strategy (e.g., versioning) to handle concurrent modifications to task status.
Hint 2
For the task list view, consider indexing your database by project_id and implementing cursor-based pagination instead of offset-based pagination to ensure performance at scale.
Hint 3
Evaluate the trade-off between using a relational database for strict ACID compliance versus a NoSQL store for horizontal write scalability in high-traffic projects.
Follow-up questions
- How would you integrate a real-time notification system using WebSockets or Server-Sent Events (SSE) while keeping the architecture stateless?
- If a task update triggers a complex workflow automation (e.g., sending emails, updating parent task states), how would you ensure this happens reliably without blocking the user response?
- How would you handle a 'hot' project that experiences a sudden spike in traffic, potentially overwhelming the database partition?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.