GDPR Developer Guide: Technical Requirements & Implementation Checklist
GDPR compliance is not just a legal checkbox — it requires specific technical implementations in your API design, database schema, and data pipeline. This guide focuses on what developers actually need to build: erasure endpoints, consent tracking, breach notification procedures, and privacy-by-design patterns.
GDPR Key Principles for Developers
GDPR is built on six processing principles that should shape your technical design decisions:
- Lawfulness, fairness, transparency — Have a documented lawful basis; tell users what you collect
- Purpose limitation — Collect data for a specific purpose; don't repurpose it
- Data minimization — Only collect what you need; avoid "just in case" fields
- Accuracy — Keep data up to date; provide user correction mechanisms
- Storage limitation — Delete data when no longer needed; implement retention policies
- Integrity and confidentiality — Encrypt in transit and at rest; access controls
Lawful Basis for Processing
| Lawful Basis | When to Use | User Right to Object? |
|---|---|---|
| Consent | Marketing, tracking cookies, newsletters | Yes, withdraw anytime |
| Contract | Data needed to deliver the service | No (needed for service) |
| Legal obligation | Tax records, KYC/AML | No |
| Legitimate interests | Fraud prevention, security, analytics | Yes (balancing test required) |
| Vital interests | Life-threatening emergencies | Rarely applicable |
Right to Erasure: Soft Delete Pattern
-- Database schema for privacy-safe soft deletion
ALTER TABLE users ADD COLUMN deleted_at TIMESTAMP;
ALTER TABLE users ADD COLUMN erasure_requested_at TIMESTAMP;
-- Erasure procedure: anonymize PII fields
UPDATE users SET
email = CONCAT('deleted-', id, '@erased.invalid'),
name = '[Deleted User]',
phone = NULL,
address = NULL,
date_of_birth = NULL,
ip_address = NULL,
deleted_at = NOW(),
erasure_requested_at = NOW()
WHERE id = $1; // Express route: DELETE /api/users/me (authenticated)
app.delete('/api/users/me', authenticate, async (req, res) => {
const userId = req.user.id;
// 1. Queue erasure job (async — respects 30-day backup rotation)
await db.erasureQueue.create({
userId,
requestedAt: new Date(),
status: 'pending',
});
// 2. Immediately anonymize active record
await db.users.anonymize(userId);
// 3. Revoke active sessions
await db.sessions.deleteByUserId(userId);
// 4. Notify downstream services (analytics, CRM)
await erasureEvent.emit('user.erased', { userId });
res.json({ message: 'Your data has been scheduled for deletion.' });
}); Data Minimization in API Design
// Bad: returning all user fields including PII not needed by client
app.get('/api/users/:id', async (req, res) => {
const user = await db.users.findById(req.params.id);
res.json(user); // Leaks DOB, phone, full address
});
// Good: return only fields the client actually needs
app.get('/api/users/:id', async (req, res) => {
const user = await db.users.findById(req.params.id, {
select: ['id', 'displayName', 'avatarUrl', 'createdAt'],
});
res.json(user);
});
// Good: use GraphQL field selection to prevent over-fetching
// clients can only request explicitly allowed fields Consent Management (CMP Integration)
// Store consent with audit trail
const consentRecord = {
userId: user.id,
consentVersion: '2024-01-15', // tie to your privacy policy version
purposes: {
analytics: true,
marketing: false,
functional: true,
},
collectedAt: new Date(),
ipAddress: req.ip, // evidence of consent timing
userAgent: req.headers['user-agent'],
};
// Never rely on a boolean — store the full consent record
await db.consentLog.create(consentRecord);
// Check consent before sending marketing
async function canSendMarketing(userId) {
const latest = await db.consentLog.findLatest(userId);
return latest?.purposes?.marketing === true;
} Data Breach Notification: 72-Hour Rule
When a breach is discovered, the clock starts immediately. Build a runbook with these steps:
- 0-4 hours: Contain breach (revoke compromised tokens, block attacker IP, isolate affected systems)
- 4-24 hours: Assess scope (what data, how many users, what type of data)
- 24-48 hours: Draft supervisory authority notification with known facts; engage DPO
- 48-72 hours: File notification with your lead supervisory authority (even if incomplete — update later)
- If high-risk: Also notify affected users directly within same window
DPIA Checklist
A DPIA is required when your processing is "high risk." Check if your feature requires one:
- Systematic profiling or automated decision-making with legal/significant effects
- Large-scale processing of special category data (health, biometric, financial)
- Systematic monitoring of publicly accessible areas
- Combining datasets from different sources to identify individuals
- Processing data of vulnerable subjects (children, patients)
- Using new technologies (AI models, biometric matching)
GDPR vs CCPA vs LGPD
| Feature | GDPR (EU) | CCPA (California) | LGPD (Brazil) |
|---|---|---|---|
| Consent required | Yes (many cases) | Opt-out model | Yes (similar to GDPR) |
| Right to erasure | Article 17 (strong) | Yes (limited) | Article 18 |
| Max fine | €20M or 4% global revenue | $7,500 per intentional violation | 2% Brazil revenue |
| Breach notification | 72 hours to DPA | Expedient notice | Reasonable timeframe |
Related Products
on GumroadDeveloper Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →AI Prompt Engineering Toolkit
58 structured prompt templates for Claude, ChatGPT, and Gemini — organized by use case. Code Review, Debugging, Documentation, Architecture, and 10 model-specific tips. Stop writing prompts from scratch.
Buy on Gumroad →Developer Cheat Sheet Bundle
10 print-ready cheat sheets for the tools developers use every day: Git, Docker, Linux CLI, SQL, Regex, HTTP Status codes, VS Code shortcuts, Bash scripting, jq/JSON, and Markdown.
Buy on Gumroad →You Might Also Need
JSON Formatter & Validator
Format, beautify, and validate JSON online. Paste your JSON to instantly pretty-print it with 2-space, 4-space, or tab indentation. Minify JSON too. Free, runs in your browser.
Open free tool →
Regex Tester
Free regex tester. Test regular expressions against multiple strings with expected match/no-match assertions — see instant pass/fail results. Built-in presets for email, URL, IPv4, and phone. Pro: unl
Open free tool →
Base64 Encoder & Decoder
Free Base64 Encoder & Decoder. Convert text, images, and any file to Base64 and back. Supports URL-safe Base64, image data URIs, and file download from Base64. Runs 100% in your browser — no data sent
Open free tool →
More Free Tools
Related Articles
curl 深度使用手冊:API 測試從入門到進階
curl 是每位開發者必備的 CLI 工具。本文涵蓋 GET/POST/PUT/DELETE 請求、認證、header 設定、檔案上傳、除錯技巧,以及 REST API 測試的完整實戰範例。
Best AI Code Review Tools 2026: CodeRabbit, Sourcery, DeepCode & Bito Compared
Compare top AI code review tools for 2026: CodeRabbit, Sourcery, DeepCode, and Bito. Features, pricing, GitHub/GitLab integration, and choosing the right tool for your team.
AI Code Review Tools 2026: GitHub Copilot, CodeRabbit, Qodo Merge Ranked
Compare AI code review tools for 2026: GitHub Copilot code review, CodeRabbit, Qodo Merge, Sourcery, and PR-Agent. Pricing, accuracy, and GitHub integration.
AI Coding Tools Comparison 2026: GitHub Copilot vs Cursor vs Windsurf vs Cline
Comprehensive comparison of the best AI coding tools in 2026: GitHub Copilot, Cursor, Windsurf, and Cline. Pricing, features, model support, and real-world benchmarks.
AI Pair Programming in 2026: GitHub Copilot vs Cursor vs Claude Code
Master AI pair programming in 2026. Compare GitHub Copilot, Cursor, and Claude Code for autocomplete, chat, and agentic workflows. Includes setup guides and productivity tips.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →