// RULES
Microservice rules
Best practices for microservices, one rule per page: why it matters, how to apply it and an example. They are grouped into checklists you can apply to a service.
6 rules of 70 · Clear filters
Security
- Access is authorized per resource
The design says how the service decides what an authenticated caller may do, down to the individual resource.
HighChecked automatically
- Input is validated at the service boundary
Every request and message is checked against a schema before any logic runs, whoever sent it.
HighChecked by hand
- Personal data handling is documented
For the personal data it holds, the service states what it keeps, why, for how long and how it is erased.
HighChecked by hand
- Personal data stays out of logs and traces
Logs, traces, metrics and error reports carry ids, not names, emails, addresses, tokens or card data.
HighChecked by hand
- Service-to-service calls are authenticated
A call from another service proves who is calling, with mTLS or a signed token. Being inside the network is not proof.
HighChecked by hand
- The gateway states how it authenticates callers
Every API gateway in front of the service names its authentication method, so nobody assumes the other side is doing it.
HighChecked automatically