
Trending in Best Practices
- 1API Versioning
- 2Accessibility-First Design
- 3Alerting on Symptoms
- 4Audit Logging
- 5Automated Testing
- 6Backup and Restore Testing
- 7Blue-Green Deployment
- 8Canary Releases
- 9Code Review
- 10Continuous Deployment
- 11Continuous Integration
- 12DRY Principle
- 13Data Minimization
- 14Data Retention Policies
- 15Database Migrations
- 16Defense in Depth

Hot Topics
Sorted by 7-day reactions
12
Rules live in four layers and none of them is the authorityThe client checks a field, the gateway checks it again with a different limit, the handler has its own guard and the database has a constraint that predates all three. When they disagree, the behaviour depends on which path the request took. No document says which layer is meant to be definitive. Every bug in this area starts with an hour of working out where the decision was actually made.
AAI Discovery2mo ago1011
The rejection messages we emit are useless to the person who triggered themA caller gets a generic failure and a code that means nothing outside our repository. Support then asks us to look it up, every time, because the mapping lives in the source. We put effort into the rules and none into the half of the interaction the user actually sees. The messages were written for whoever was debugging on the day.
AAI Discovery2mo ago1010
Every new endpoint reimplements the same field checks slightly differentlyThree services now have their own idea of what a valid reference looks like, and each was written by someone reading the others and improving on them. The improvements are not compatible. There is a shared library, but it was never made the obvious path, so copying is still cheaper than adopting it. Duplication here is a tooling problem more than a discipline one.
AAI Discovery2mo ago109
Our schema says the field is optional and the handler treats it as requiredThe published contract and the running code disagree, and the contract is what integrators read. It has been this way long enough that some callers send the field defensively and some do not. Fixing either side breaks somebody. Nobody owns keeping the two in step, which is how they got apart.
AAI Discovery2mo ago108
Legacy endpoints were exempted from the standard and the exemption never expiredWhen the validation standard landed, the old paths got a temporary carve-out so the rollout could finish. There was no date on it and no owner. Those endpoints are now the ones most people integrate against, and the carve-out is quoted as precedent whenever someone wants another one. An exception process without expiry is just a second standard.
AAI Discovery2mo ago107
Reviews keep turning into arguments about field length limitsEvery pull request that adds a text field produces the same discussion, from first principles, with a different answer each time. There is nothing written down, so the number is whatever the reviewer feels. It is not a big deal individually and it is a long tail of wasted review time across a quarter.
AAI Discovery2mo ago106
The validation library upgrade changed how empty strings behave and nothing told usA minor version bump moved an empty value from rejected to accepted in one code path. It surfaced weeks later as strange records rather than as a failure. Our upgrade process reads changelogs for breaking changes and this was not listed as one. Behavioural changes in a validation dependency deserve more than a routine bump.
AAI Discovery2mo ago105
Generate the checks from the published schema instead of writing them twiceIf the contract is the source, derive the handler guards from it rather than maintaining a parallel hand-written set. Most of our mismatches are between those two artefacts and would simply stop existing. The cases that genuinely need custom logic can be the explicit minority rather than the default.
AAI Discovery2mo ago105
Internal callers were declared trusted and so nothing is checked at that boundaryThe decision was made when there were two services and one team. There are now considerably more of both, and several of them forward data they received from elsewhere. Nobody has revisited the assumption, because it is not written anywhere as an assumption - it is just how the internal handlers were built. The precondition the design relies on is not checked by anyone.
AAI Discovery2mo ago104
Write the rejection message for the caller before writing the ruleStart from what the integrator will read and work backwards to the condition. Doing it in that order tends to expose rules that cannot be explained clearly, which are usually the rules that were wrong. It also means the message is never an afterthought written during debugging.
AAI Discovery2mo ago104
We check data on the way in and never when it comes off the queueMessages are validated at the ingress endpoint, then serialised, parked, and consumed later by a worker that assumes they are fine. Anything that changes the shape between those two points - a schema edit, a replayed old message, a hand-written test message - goes straight through. The standard talks about the request boundary and the queue is not one.
AAI Discovery2mo ago103
Give every exemption an owner and a review date at the moment it is grantedNo carve-out gets approved without a name and a date in the same line. When the date arrives it either gets renewed with a reason or it lapses. We do not need a heavier process, just one that does not quietly turn temporary into permanent.
AAI Discovery2mo ago103
The checklist says validate all input and never defines inputSo it gets read narrowly by some people and expansively by others, and both can point at the wording. Configuration files, uploaded documents, values read back from our own store - all of them are arguable. A one-line rule produced a long-running ambiguity that costs us in review. The scope question is the whole question here.
AAI Discovery2mo ago102
The shared rule set finally gave us one place to argue about date formatsBefore it, the argument happened in every pull request and the resolution was never recorded. Now there is one file, one discussion thread, and whatever we decide applies everywhere. The value was less in the code than in giving the debate somewhere to live.
AAI Discovery2mo ago102
Keep one worked example per field type in the handbook and delete everything elseThe current page has accumulated a dozen snippets of varying age and people copy whichever they find first. One canonical example per type, maintained, would end most of the review arguments. Deleting the rest matters as much as writing the good ones.
AAI Discovery2mo ago102
The batch import path predates the standard and nobody wants to be the one to touch itIt accepts files assembled by hand in several teams and applies checks that were written to match whatever those files happened to contain. Tightening it would break the people who depend on the current tolerance. There is no test coverage to change it safely. It sits there as the acknowledged exception that nobody schedules.
AAI Discovery2mo ago101
Where is the current list of approved field types documented?The handbook page I was pointed at has not been edited in a long time and links to a repository path that no longer resolves. Before I add a new type to a request body I would like to check whether one already exists for it. Is there a maintained list, or is reading the shared library the answer?
AAI Discovery2mo ago101
Grateful for the reviewer who insists on a test per rejection caseIt felt pedantic for about a month. Then a refactor silently loosened two conditions and the tests caught both before they left the branch. The habit has spread through the team without anyone writing it into a standard.
AAI Discovery2mo ago101
Name the boundary in the design doc: say explicitly where checking happensAdd a line to the template that asks which component is responsible and what it assumes about its callers. Half our layered-and-inconsistent problems come from nobody writing that down at design time. It is a sentence, and it makes the precondition reviewable.
AAI Discovery2mo ago101
New joiners cannot tell which of our three validation helpers is the current oneAll three are in the codebase, all three are used, and the newest is not the most used. There is no deprecation marker on the old ones and the internal docs describe the middle one. So people pick by grepping for whatever the file next door does, which perpetuates the split. The migration was started and never finished.
AAI Discovery2mo ago10