In my small career, I have been very fortunate to have received a lot of opportunities to write an HLD (High-level design) and many other forms of documents (LLD, one-pagers, deployment docs etc). At first, most of the engineers (particularly entry-level) either do not like doing this (it looks like documentation!) or do it just for the sake of it. It turns out to be a big blunder and teams end up wasting a lot of time doing back and forth with the stakeholders or the code reviewers. In this article, I will try to cover whatever (little) I have learned and follow when I write an HLD for our team. Trust me, it is a skill which can be best learnt by doing and getting it reviewed and grilled by senior leaders and engineers. Still, I will try to give a nice crisp overview of the whole thing.
Let's begin with the reason why you need an HLD in the first place? Of course, I am an engineer and I know what we want to build I have built similar things in the past. It will take a lot of time as well. I do not need it! Turns out, you still probably need it for the following reasons :
- It will help you figure out various components you would need in the project and will help you break down your larger problem into smaller subproblems.
- It will help you get an "alignment" between various stakeholders like the product team, internal customers, management, higher engineering leads and your own team. Also, this document will serve as a written record of how the project started and will contain everyone's approvals to avoid problems later.
- It will help you understand the trade-offs (let's accept it, all solutions you propose have to come with trade-offs be it in terms of capabilities, scale or cost) and make the best and the most informed choice.
- It will help you come up with high-level timelines and when a leader asks when it will be completed, you can give better estimates with valid and written backing of what is complete and what is left. You may also agree on the release plan better.
- It helps you streamline your thoughts and your team's thought in a particular direction and the chances of misunderstandings and single points of failure (let's say you fall sick, your document will continue to guide the team) is reduced drastically.
- It helps you call out what is "in the scope" and what is not. It sets the right "expectations" with the stakeholders. This is important as you do not want people coming out later saying they were "expecting" something in this release that they do not see and because of this business is going to suffer.
- Title: It should summarize the whole project in one line. It is generally the same as the project name. Does not need much explanation but it should be one line and conveying the idea of the project.
- Stakeholders List: The list of stakeholders and their PoCs (Point of contact) along with their designations. This section should also include a column for approval. For example :
- References: This should include all the jargon, abbreviations, references, links etc needed for a complete understanding of the doc and the context.
- Background: The background of the project including what is the current scenario and what is the desired scenario. It should also include what is the business necessity and impact of the project in the short, medium and long term.
- Functional Requirements: The list of "direct" requirements which need to be verified before calling the project a success. The requirements should be quantifiable wherever possible and monitorable via some metrics. All the stakeholders should be aligned with these.
- Non-Functional Requirements: The list of "indirect" requirements like latency, availability, consistency etc. These requirements should also be quantifiable via metrics whenever possible like P95, P99 metrics etc.
- Scope: What is not a part of the project should be clearly called out so that we know what we are not aiming for.
- Approaches: Propose various approaches. Each approach should be backed by a proper pros and cons analysis with the tradeoffs clearly mentioned for the approach. Each approach should have an HLD diagram to explain the plan at the component level. Optionally, it can also contain a flow diagram. An example of the component diagram and data flow diagram may be as follows :
- Finalized approach: The approach that was finalized by all the stakeholders after meetings and discussions. This should be a detailed segment and we should add tradeoffs, a detailed HLD diagram, data models, a deployment plan at a high level etc. It should indicate what is the reusability, modularity, security etc of the system. It should also contain database designs and ER models if needed.
- Risk/Dependencies/Assumptions: Note down which all down stream services, teams your work and timelines depend on. Also, list down the assumptions that you have made while designing the document so that people are aware of what all cases need to be resolved before the document can be fully executed.
- T-shirt sizing: Once the approach is finalized, we can come up with a T-shirt size estimate for the various component's delivery. The T-shirt size is usually taken as S (small - Around half a sprint effort), M (Medium - Around a sprint worth of task), L (Large - Around two sprints of task), XL (Extra large - Around 2-3 sprints with many engineers working). An example could be something like this :
- Appendix: This should contain future reads and other things that we were unable to fit anywhere else. This might also include historical data that were considered when the design was created.
- https://cmps-people.ok.ubc.ca/rlawrenc/research/Students/CJ_05_Design.pdf
- https://www.slideshare.net/anoshajamshed/high-level-design-document-template
Comments