Vehicle Registration System
Vehicle Title and Registration Records
Design a government-style records system for vehicle titles and registrations: ownership changes exactly once, every change leaves a permanent audit record, and lookups return only what each caller may see.
Overview
A vehicle registry is the legal record of which vehicles exist, who owns each one, who has lent money against it, and whether it may be driven on public roads. A title proves ownership; a registration is the yearly permission to drive, tied to a plate; a lien records a lender's claim until the loan is paid.
This is a records problem, not a scale problem. A few hundred thousand changes a day is light work for one database. What makes it hard is that every change is a legal fact: an ownership transfer must happen exactly once, a lien cannot be silently lost, and years later someone must be able to prove who changed what and why. Meanwhile police, insurers, toll operators and the public look up plates and VINs hundreds of times more often than records change, and each may see only certain fields.
In the United States, two outside rules shape the design and are worth naming. The Driver's Privacy Protection Act (DPPA) limits when personal information from motor vehicle records may be disclosed and lists the permitted uses. The National Motor Vehicle Title Information System (NMVTIS) lets a state check a vehicle's title history, including salvage and junk brands, before issuing a new title. This topic describes a general design, not any particular agency's system.
Questions to ask first
Agree on the scope before designing. Each question comes with the answer this design assumes.
- How many vehicles? About 30 million registered in one jurisdiction.
- How many changes? Renewals come yearly, 15% of vehicles change owners a year, and 2 million are new each year: about 100,000 changes a day.
- Who looks things up? Police, insurers, toll operators and the public, about 50 million lookups a day.
- Which channels? An online portal, branch counters, dealers, and mailed forms keyed in by clerks.
- May a lookup be a few seconds stale? Yes for most fields, but a stolen flag must reach lookups within seconds.
- How long is history kept? Permanently for titles; lookup logs for a period the law sets.
The design at a glance
The portal, branch counters and dealers send every change to a workflow service as an application. The workflow service runs the outside checks (insurance, NMVTIS), then writes to the records primary of titles, liens and plates, which confirms each commit with a synchronous standby and feeds a change stream into the lookup read model by VIN and plate; flag changes take a separate fast path. Police, insurers, toll operators and the public call a lookup API that filters by role and purpose and writes every answer to the lookup log, about 10 GB a day. The Visual Explanation below draws it, and the chapter starts with the rules the database itself enforces.
What you will be able to do
- Model titles, liens and plates so the database itself rejects impossible states.
- Transfer ownership exactly once, even when two channels submit the same sale.
- Make every workflow safe to retry with an application ID.
- Keep an append-only, tamper-evident audit trail.
- Serve high-volume lookups from a filtered read model that shows each caller only permitted fields.
Key concepts
- System of record
- One current title per VIN
- Row locks
- Idempotent applications
- Append-only audit log
- Hash chain
- Purpose-based access
- Read model
- VIN check digit
Functional requirements
- Title a new vehicle, assign a plate and record the owner
- Transfer ownership, carrying brands (salvage, rebuilt) forward
- Record a lien, and release it when the lender reports payoff
- Renew a registration after insurance, emissions and payment checks
- Flag a vehicle stolen, salvage or junked, and clear a stolen flag
- Look up by plate or VIN, returning only fields the caller may see for the stated purpose
- Show the full history of a vehicle to authorized staff
Non-functional requirements
- Strong consistency for ownership: two transfers of one vehicle can never both succeed
- Every change is recorded in an append-only log with who, when, why and the evidence
- Every request is safe to retry; a retried transfer or payment never happens twice
- Lookups answer in under 100 ms at p99 and stay up 99.95% of the time (targets we chose)
- A stolen flag reaches lookups within seconds; other fields may lag a few seconds
- Every lookup is logged with the caller and the stated purpose
Interview questions
- How do you guarantee that ownership changes exactly once?
- Why not use a microservice per entity and a saga?
- How do you build the audit trail?
- How do you serve 50 million lookups a day?
- How do you keep personal information from leaking through lookups?
- How do renewals work when the insurance check is slow?
- How do you stop title washing?
- What about disaster recovery?
Sign up free to read the full topic
More System Design topics
Start free on Cariara · Coding problems · System design studio