company/documentation/engineering/how-to-write-design-doc.mdx
Writing a design document helps you efficiently solve broad, complex engineering problems at Infisical. While planning is important, we are a startup, so speed and urgency should be your top of mind. Keep the process lightweight and time boxed so that we can get the most out of it.
Writing a design will help you:
When to write a design document:
If you are unsure when to create a design doc, chat with @maidul.
Every feature/problem is unique, but your design docs should generally include the following sections. If you need to include additional sections, feel free to do so.
Title
Overview
Context
Solution
Provide a big-picture explanation of the solution, followed by detailed technical architecture.
Use diagrams/charts where needed.
Write clearly so that another engineer could implement the solution in your absence.
Break down the solution into meaningful, logical chunks that can be implemented independently. Consider:
Core infrastructure vs feature-specific implementations
Backend services that can be built and tested in isolation
Data model changes that can be implemented in phases
API endpoints that can be versioned and rolled out gradually
This breakdown will inform your milestones and help reviewers understand the implementation strategy. If you find yourself planning PRs that are 3,000+ lines long, it might be a sign that you need to break down the work further. While PR size isn't the primary factor in determining breakdown, it can be a useful indicator that a chunk of work might be too large to review effectively.
Milestones
FAQ
Before sharing your design docs with others, review your design doc as if you were a teammate seeing it for the first time. Anticipate questions and address them.
Research/Discuss
Before you start writing, take some time to research and get a solid understanding of the problem space. Look into how other well-established companies are tackling similar challenges, if they are. Talk through the problem and your initial solution with other engineers on the team—bounce ideas around and get their feedback. If you have ideas on how the system could if implemented in Infisical, would it effect any downstream features/systems, etc?
Once you've got a general direction, you might need to test a some theories. This is where quick proof of concepts (POCs) come in handy, but don't get too caught up in the details. The goal of a POC is simply to validate a core idea or concept so you can get to the rest of your planning.
Write the Doc
Assign Reviewers
Team Review and Feedback
Sales Approval (When Applicable)