Ask HN: Are there any openly available software architecture documents?

407 points by passenger ↗ HN
I'm about to leave my job for another and i'm tasked with documenting the existing architecture and flow of the app.

I'd also have to document why certain decisions were taken. I'm looking for any openly available similar documents for guidance mostly around how to structure the document.

52 comments

[ 3.4 ms ] story [ 122 ms ] thread
The book `Documenting Software Architectures ...` [1] can help.

[2] and [3] list a few example documents for Software Architectures, you can google further and find some more.

I think reading through a few sample documents and based on the expectations at your current job, you can derive the necessary doc.

[1] https://www.amazon.com/Documenting-Software-Architectures-Be...

[2] https://projects.cecs.pdx.edu/attachments/download/3146/Soft...

[3] https://www.voa.va.gov/DocumentView.aspx?DocumentID=188

Yikes, if you haven't been doing this as you go you've severely messed it up.
(comment deleted)
Don’t do it like me and overthink it. Just write down all your thoughts informally. Make diagrams by hand. Only once you have most content then think about formatting and structure. A lot of people produce nicely looking docs without much content. I much prefer a bunch of simple notes that describe the thought process
So much this. Working for Enterprise I saw so many 20 page architectural documents that were borderline impossible to parse and were about as illuminating as a 30 second conversation.
But then it is all .. vague. I do hope something better than can be done.. hand drawn diagrams can't represent details at different levels of magnitude, like for example why statecharts are very expressive compared to other diagrams is it's ability to have arbitrary levels of nesting, which is not possible with handdrawn or even printed diagrams.

I feel like resorting to simple hand drawn diagrams, is in a way declaring failure on being able to describe complex software requirements and structure/ behavior in a systematic graphical manner.

Just make sure your stuff really expresses something and isn’t just pretty as I see quite a bit.
The details will always have to be looked at by the inheritors - it's more important to not say something wrong or contradictory IMO. When I've had to do something like this in the past I circle through it, documenting the high-level ops before details anywhere. Tricky or especially complicated details next, then the operational details for as much as I've time for.

I'm doing this now for a couple of things I've inherited because my predecessors either never documented it or it's been lost to time. High-level flow, tricky and/or problematic bits with operational & recovery info, then the mundane as I have time. That means the mundane or some of the less-tricky tricky bits will be "vague" for a while.

What works for me is to do things by hand, until all the possible information I might want to share is present. I call it my inventory.

Then work on refining, editing, deleting, modifying.

Separate the creation from the editing/communication.

I agree. I used to work on a project where everyone involved in the initial design had left the company, and documentation was spotty. The major issues I had working with the code were all related to not understanding the underlying design choices, e.g. why a certain model was chosen over another or how a certain abstraction was intended to be extended with new functionality.

Stuff that can be formalized in a systematic manner is usually stuff you can figure out on your own in a text editor or IDE.

You're absolutely right about not overthinking. Any architecture doc is better than none. Even if the thinking it describes is incoherent or if it describes coherent thinking sloppily. And even during editing, there's only one thing I want my principal engineer to keep in mind. Inside the technical vision, tell me a little about implementation details. Either pulled in from below or, if the principal is risen from my ranks, written from experience.
If you only have a few weeks then there might not be any good results: you have to spend time learning the framework and also provide the relevant/ required info.

It is an opportunity to learn and apply it forward to your new job.

(comment deleted)
I would also look at "The Architecture Of Open Source Applications", although it might be more detail than you're looking for.
Archi software to draw Archimate diagrams.
There is the excellent Architecture of Open Source Applications book, which is available online for free at http://aosabook.org/en/index.html

It contains architecture overviews of many open source projects.

I agonized over the best way to do this stuff for a while also and the best framework I've used so far is the C4 model (as mentioned elsewhere).

For documenting decisions on architecture this should be done as you go really but better late than never :). Using adr ( architecture decision records ) text / md files would be my approach. They will typically be kept alongside the code and source controlled

This might initially look to be be a little too specific for military / aerospace, but it can act as a good guideline for a table of contents and examples of what might go in each section.

https://github.com/VCTLabs/MIL-STD-498/raw/master/MIL-STD-49...

The US Military came up with their own standard for systems and software development (MIL-STD-498), which as evolved into IEEE and ISO standards. The nice thing about the US Military's standards is that they came with Data Item Descriptions (DIDs) that specify exactly what goes in each document.

Plantuml for drawing pictures together with the C4 Plantuml Plugin is helpful. i.e. you make high level overviews of your architecture and then „zoom in“

For decisions a table with some explainatory comments why you have decided to use this one thing and which alternatives you have considered and why those did not make it, helps. You can look up ADRs. (Decision Records)

Our design decision documents have essentially four sections: Problem description, solution options, comparison of the options, and decision. I find it helpful to clearly distinguish what is part of the problem and what part of the solution. The size of the sections varies a lot.

Meta information could be: Status, stakeholders, decision-makers, and rollout description. It also often has links to meeting protocols and tickets.

These are not architecture documents but change management documents. Roll out of such decisions should, among other things, result in an update to architecture docs.
There are dozens at the Architecture of Open Source Applications ebook/site: http://aosabook.org/en/index.html

As someone who only really gets exposure to web tech, it was fascinating how other types of software is architected, too.

Wow, what a great resource. Thanks for sharing.
The best book/pair of books about software that I have ever read.

Perhaps Effective C++ comes in second, but that's just b/c C++ is a nightmare.

Effective C++ is mostly just a book about C++ pitfalls to avoid. It says nothing about high level concepts.
(comment deleted)
ADR is made for this

https://github.com/joelparkerhenderson/architecture_decision...

There are multiple variants. Simple or detailed.

ADRs are great, and don't need to be overly formal or use tooling. We've been hand-writing Markdown-based ADRs (https://github.com/adr/madr) checked in with our code in a docs/adr directory.

You don't put every little decision in of course, but most projects have at least 1-2 areas where even the people involved with the decision have a hard time recollecting all the context for the decision.

The downside, at least for OP, is that they're usually something you capture at the time the decision is made - not when you're leaving a project.

Most important thing to convey is the conceptual framework used and assumptions made to simplify things. e.g. "We will fix problems only by altering the base image, not the build system." "We will not change to 64-bit build as a part of this change." The sort of thing so that if someone really internalizes the perspective, they will be able to decide all the details on their own. Also a basic picture is always very popular. The details should be in git someway or another, but being able to use the details quickly is the job of the overview. I find it useful to document common change workflows ('To add another type of processor, add the class name to this map in this file, provide a jar implementing that class here, and add a new ID to the enum here.')
GitLab has all of their docs online..I guess you can dig into them for inspiration
Do you have a specific link one can start digging through?
There are bunch of them, really.

But for general structure, using your end-user's user experience path (from start to end) as a guide and avoiding buzzwords as much as you can usually help. Think of Stripe's documentation, you want something as easily digestible as that.

- Software Design Patterns: https://en.wikipedia.org/wiki/Software_design_pattern

- Azure Application Architecture Guide: https://docs.microsoft.com/en-us/azure/architecture/guide/

- Azure Cloud Design Patterns: https://docs.microsoft.com/en-us/azure/architecture/patterns...

- Azure Architecture Framework: https://docs.microsoft.com/en-us/azure/architecture/framewor...

- Azure Cloud Adoption Framework: https://docs.microsoft.com/en-us/azure/cloud-adoption-framew...

- Cloud Computing Patterns: https://www.cloudcomputingpatterns.org/

- Microservice Architecture Patterns: https://microservices.io/patterns/index.html

- Amazon's Builders Library: https://aws.amazon.com/builders-library/

Making use of colors in architectural diagrams really add depth to the information. Often applications involve internal and external (out of scope) components. Using common colors for each group of components really helps in the readability.
Tell them the code is so good it documents itself.