HLD, DDD, And SLR: Where Each Lives
Klok uses human-readable design artifacts together with generated technical documentation. The purpose is not paperwork. The purpose is traceability from business need to route code and runtime evidence. The names HLD, DDD and SLR are used throughout the Klok documentation; on the platform each of them has one home, and nothing is written twice.
| Artifact | What it is on Klok | Where it lives | Who writes it |
|---|---|---|---|
| HLD, high level design | The solution document | solutions/<SOLUTIONID>_<slug>/README.md in the tenant's integration-solutions repository |
The architect, with the business |
| DDD, detailed design per route | The route's page in its project's documentation, next to the pages generated from the code | The project's klok-docs/, published on docs.klok.dev |
The developer, in the same merge request as the route |
| SLR, service level requirement | Section 9 of the solution document, and serviceLevelRequirements in its solution.meta.json |
The solution's folder | The business states it, the architect checks the design can meet it |
HLD: The Solution Document
The solution document explains why the solution exists and how it is built: the business context, the scope, the systems, what it reuses, the datamodel, the services by kind, the legs, the flows, the service levels, security and tenant isolation, the tactical decisions, the open questions and the related documentation. The registry's README defines the sections, and Reviewing A Solution Document explains what each one answers and what its reviewers check.
It is written before the first route and kept true by every merge request that adds, changes or removes a leg. A leg
that is not built yet is marked planned. It links to each project's documentation for the details of a route, and
never copies them.
DDD: The Route's Documentation
There is no separate detailed design document. What a DDD used to describe for one route is written in the project's
klok-docs/, in the same merge request as the route:
- the route id and its role in the solution;
- the topics it consumes and publishes, with the purpose of each and the project at the other end;
- the input and output datamodels and the transformation between them;
- the decisions behind the design, and what was weighed against what;
- how it is operated: its configuration keys, its error handling and what to do with its dead letters.
The generated pages add what the code says: the base class, the configuration keys, the topics, the datamodels and the
REST API. A route that is designed but not built yet is described in the solution document's legs table, marked
planned, until its project has it.
SLR: Service Level Requirement
The SLR describes what good operation means for the solution. It is written in section 9 of the solution document, which
says for each value whether it is agreed or assumed, and in serviceLevelRequirements of solution.meta.json, which is
null while nothing is agreed.
Common SLR dimensions:
- Availability.
- Latency.
- Throughput.
- Recovery time.
- Replay expectations.
- Data loss tolerance.
- Alerting and support model.
- Vendor rate limits.
- Batch windows.
Generated Documentation
Generated documentation comes from source code, project metadata, CI/CD scans, and context snapshots. It does not replace the solution document or the project's own pages. It shows what was actually implemented, and a difference between it and the solution document is a finding to correct.
Review Principle
The solution document describes intent. The project's klok-docs/ describes the implementation design. Generated docs
describe the observed implementation. Monitoring describes runtime behavior. All four should be consistent, and klok solutions check compares the first with the code.