Skip to main content

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.

✓ Right to erasure implementation ✓ Consent management patterns ✓ Data breach 72-hour rule ✓ DPIA checklist ✓ GDPR vs CCPA vs LGPD

GDPR Key Principles for Developers

GDPR is built on six processing principles that should shape your technical design decisions:

Lawful Basis for Processing

Lawful Basis When to Use User Right to Object?
ConsentMarketing, tracking cookies, newslettersYes, withdraw anytime
ContractData needed to deliver the serviceNo (needed for service)
Legal obligationTax records, KYC/AMLNo
Legitimate interestsFraud prevention, security, analyticsYes (balancing test required)
Vital interestsLife-threatening emergenciesRarely 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:

DPIA Checklist

A DPIA is required when your processing is "high risk." Check if your feature requires one:

GDPR vs CCPA vs LGPD

Feature GDPR (EU) CCPA (California) LGPD (Brazil)
Consent requiredYes (many cases)Opt-out modelYes (similar to GDPR)
Right to erasureArticle 17 (strong)Yes (limited)Article 18
Max fine€20M or 4% global revenue$7,500 per intentional violation2% Brazil revenue
Breach notification72 hours to DPAExpedient noticeReasonable timeframe
Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$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.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →