Markdown Editor

Technical Design Document Template

In-depth design doc – context, goals and non-goals, APIs, data, flows, alternatives matrix, cross-cutting concerns, testing, rollout, cost

사용법: Significant features, services or migrations that need cross-team review; use the lean Design Doc for small proposals. Circulate context and goals before the detailed design. The main pitfall is skipping alternatives considered – reviewers will ask for them.

미리보기

Technical Design Document: [Feature or system name]

In-depth technical design document for a significant feature, service or migration, in the style of engineering design docs used at large software companies: context, goals and non-goals, detailed design, alternatives, cross-cutting concerns, testing, rollout and cost. For a short proposal, use the lean Design Doc template instead. Replace every [bracketed] value and every row marked Example.

Document control

FieldValue
Document ID[TDD-YYYY-NNN]
Title[Feature or system name]
Author(s)[@author]
Reviewers[@reviewer1, @reviewer2, @security-reviewer]
Status[Draft / In review / Approved / Implemented / Abandoned]
Target release[vX.Y / quarter]
Tracking issue[link]
Classification[Internal / Confidential]
Created / last updatedYYYY-MM-DD / YYYY-MM-DD

Approvals

RoleNameDecisionDate
Tech lead[@name][Approved / Approved with comments / Rejected]YYYY-MM-DD
Staff / principal engineer[@name][Decision]YYYY-MM-DD
Security reviewer[@name][Decision]YYYY-MM-DD
Product manager[@name][Decision]YYYY-MM-DD

Revision history

VersionDateAuthorChange summary
0.1YYYY-MM-DD[@name]Context, goals and overview for early feedback
0.2YYYY-MM-DD[@name]Example: Detailed design and alternatives after first review
1.0YYYY-MM-DD[@name]Example: Approved; rollout plan finalised

Contents

1. Context and scope

1.1 Background

[Describe the current system and how it behaves today. Example: "Search on the catalogue uses SQL LIKE queries against the product table. With 1.2 million products, p95 search latency is 2.8 s and full-text relevance is poor: 31% of searches end without a click."]

1.2 Problem statement

[The specific problem this design solves, with evidence: metrics, incidents, customer feedback, upcoming load.]

1.3 Scope

In scopeOut of scope
Example: Product search API and indexing pipelineSearch UI redesign (separate project)
Example: Migration of existing search trafficPersonalised ranking
[Item][Item]

2. Goals and non-goals

2.1 Goals

IDGoalMeasureTarget
G-01Example: Fast searchp95 latency of GET /searchUnder 200 ms at 300 requests/s
G-02Example: Relevant resultsSearches ending without clickBelow 15%
G-03Example: Fresh indexDelay from product update to searchableUnder 60 s at p99
[G-nn][Goal][Metric][Target]

2.2 Non-goals

  • [Example: Supporting search across marketplace partner catalogues.]
  • [Example: Replacing the product database as the source of truth.]
  • [Example: Multi-language stemming beyond English and German in this phase.]

3. Overview of the design

[Summary. Example: "We introduce a search index (OpenSearch) populated by change events from the product database through an indexer service. The search API queries the index and falls back to the existing SQL search if the index is unavailable."]

4. Detailed design

4.1 APIs

Method and pathRequestResponseErrorsNotes
Example: GET /v2/searchq, filters, page, pageSize (max 100)results[], facets, total, nextCursor400 invalid filter, 429, 503Cursor-based paging; v1 kept for 6 months
[Endpoint][Request][Response][Errors][Notes]
{
  "q": "trail running shoes",
  "filters": {"brand": ["Acme"], "size": ["42"]},
  "pageSize": 24
}

Compatibility: [how existing clients are affected; versioning approach; deprecation timeline].

4.2 Data storage

StoreDataSchema / mappingSizeRetentionOwner
Example: Search index products_v1Denormalised product documentsText fields with English and German analysers; keyword fields for facets1.2 M docs, about 6 GBRebuilt on mapping changeSearch team
Example: Product databaseSource of truth, unchangedExisting schema40 GBExisting policyCatalogue team
[Store][Data][Schema][Size][Retention][Team]

Consistency model: [for example "the index is eventually consistent with the database; G-03 bounds the delay; reads that require exact stock levels still go to the database"].

4.3 Code and module changes

ComponentChangeOwnerSize estimate
Example: search-api (new)Query parsing, index client, fallbackSearch team3 weeks
Example: indexer (new)Consume change events, transform, bulk indexSearch team2 weeks
Example: catalogue-serviceEmit change events via outboxCatalogue team1 week
[Component][Change][Team][Estimate]

4.4 Key flows

The indexing flow and its failure handling:

4.5 Failure modes and degradation

FailureImpactDetectionBehaviour
Example: Index cluster unavailableSearch failsHealth check, error rateSearch API falls back to SQL search with reduced features; banner not shown to users
Example: Indexer lagStale resultsLag metric above 60 sAlert; autoscale indexer
Example: Bad mapping deployedWrong resultsRelevance canary queriesSwitch alias back to previous index
[Failure][Impact][Signal][Behaviour]

4.6 Capacity

Index throughput needed during a full rebuild:

trebuild=Ndocsrbulk=1 200 0002 000 docs/s=600 st_{rebuild} = \frac{N_{docs}}{r_{bulk}} = \frac{1\,200\,000}{2\,000\ \text{docs/s}} = 600\ \text{s}

[State load assumptions, node sizing and headroom. Example: "3 data nodes with 8 vCPU and 32 GB each handle 300 queries/s at 35% CPU in the load test; we provision for 2x peak."]

5. Alternatives considered

CriterionWeightA: Dedicated search index (chosen)B: PostgreSQL full-text searchC: Hosted search SaaSD: Do nothing
Meets latency goal G-01HighYesPartly (p95 about 600 ms in test)YesNo
Relevance tuningHighFull controlLimitedGoodNone
Operational effortMediumNew cluster to runNone newLowNone
Data leaves our infrastructureHighNoNoYesNo
Cost per monthMedium[USD 2,100][USD 300][USD 4,500]0

Reasons for the choice: [Example: "B fails the latency goal at our data volume; C is excluded by the data residency policy; A meets all goals at acceptable operational cost."]

6. Cross-cutting concerns

6.1 Security

[Authentication and authorisation of new endpoints, input validation and query injection risk, secrets handling, network exposure, dependency review. Example: "The index is reachable only from the search API and indexer subnets; queries are built with the client library, never by string concatenation."]

6.2 Privacy

[Personal data processed or stored, lawful basis, retention, deletion propagation. Example: "No personal data is indexed. Seller names are public business data."]

6.3 Observability

SignalMetric / log / traceAlert thresholdDashboard
Example: Search latencysearch_request_duration_seconds histogramp95 above 300 ms for 10 minSearch overview
Example: Indexer lagindexer_lag_secondsAbove 120 s for 5 minIndexing
[Signal][Instrument][Threshold][Dashboard]

6.4 Accessibility

[Impact on user-facing surfaces. Example: "API only. Client teams keep announcing result counts to screen readers when results change."]

6.5 Internationalisation

[Languages, analysers, collation, number and date formats. Example: "English and German analysers in phase 1; queries in other languages fall back to the standard analyser."]

6.6 Reliability and data integrity

[Idempotency, ordering, versioning of documents, reconciliation job that compares database and index counts daily.]

7. Testing strategy

LevelWhat is testedToolingExit criterion
UnitQuery parsing, document mapping[Test framework]90% branch coverage on new code
IntegrationIndexer against a real index container[Testcontainers]All flows in 4.4 pass
ContractGET /v2/search against client expectations[Contract testing tool]No breaking changes
Performance300 requests/s for 1 hour[Load tool]G-01 met
Relevance500 judged queriesOffline evaluationNDCG at 10 at least 0.05 above current
ResilienceKill index node, stop indexerChaos testFallback and recovery as in 4.5

8. Rollout and migration

8.1 Rollout plan

PhaseAudienceDurationSuccess criteriaRollback
1. Shadow100% traffic mirrored, results discarded1 weekError rate under 0.1%, latency within goalDisable mirroring
2. Canary5% of users via feature flag1 weekClick-through not lower than controlFlag off
3. Ramp25%, 50%, 100%2 weeksSame as phase 2Flag off
4. Clean-upRemove old path and v1 APIAfter 6 monthsNo v1 traffic for 30 daysn/a

8.2 Data migration

[Initial backfill procedure, duration, verification (counts and sampled document comparison), and how changes during backfill are captured.]

StepActionVerificationReversible
1Example: Start change data capture and buffer eventsConnector lag visible on dashboardYes
2Example: Bulk-load all products into products_v1Document count equals database count within 0.01%Yes, drop index
3Example: Replay buffered eventsLag returns to under 60 sYes
4Example: Point alias products to products_v1Canary queries return expected top resultsYes, switch alias

8.3 Launch checklist

ItemOwnerDone
Security review completed and findings closed[@security][Yes / No]
Privacy review (if personal data is affected)[@privacy][Yes / No / Not applicable]
Dashboards and alerts from 6.3 live and tested[@owner][Yes / No]
Runbooks written and rehearsed by on-call[@owner][Yes / No]
Load test at 2x expected peak passed[@owner][Yes / No]
Rollback rehearsed in staging[@owner][Yes / No]
Client teams and support informed of the change and timeline[@pm][Yes / No]

9. Operations and support

ItemDetail
Owning team and on-call[Search team, primary rotation]
Runbooks[Links: index recovery, alias switch, reindex]
Service level objective[99.9% of searches succeed in under 300 ms over 28 days]
Dependencies added[Search cluster, change data capture connector]
Support impact[None expected / FAQ for support agents]

10. Cost

ItemOne-offMonthlyAssumption
Example: Search cluster (3 nodes)0USD 1,800On-demand pricing, region [x]
Example: Change data capture0USD 300Managed connector
Example: Engineering8 engineer-weeks0.1 FTE operationsSection 4.3 estimates
[Item][Amount][Amount][Assumption]

11. Open questions

IDQuestionOwnerDueAnswer
OQ-01Example: Do we need synonyms per market at launch?@pmYYYY-MM-DD[Open / answer]
OQ-02Example: Can the catalogue team ship outbox events before sprint [n]?@catalogue-leadYYYY-MM-DD[Open / answer]
[OQ-nn][Question][@owner]YYYY-MM-DD[Answer]

12. References and glossary

ReferenceLink
[Previous design or ADR][link]
[Load test results][link]
[Incident report motivating this work][link]
TermMeaning
Example: AliasA stable index name pointing to a versioned physical index, switched atomically
Example: NDCGNormalised discounted cumulative gain, a ranking quality measure
[Term][Meaning]

Standard and licence note

Based on common industry practice for engineering design documents, as used by large software organisations: context, goals and non-goals, design, alternatives, cross-cutting concerns and rollout. Template licence: MIT.

관련 템플릿