Notes

Part 10 of 10

Data systems, law, and society

Data systems are shaped by human needs. Engineers answer not only to their company but also to society.

  • GDPR, in force since 2018, gives many people in Europe control over their personal data and legal rights to it. Similar laws exist elsewhere, like CCPA in California. Rules on AI, such as the EU AI Act, limit the use of personal data further.
  • Even where no law applies, data systems affect society. Social media shapes what news people see, their politics, and maybe elections. Automated systems decide who gets a loan, insurance, or a job interview, and who is suspected of a crime.
  • Everyone who builds such systems shares responsibility for acting ethically and following the law. Knowing the basics of law and ethics matters as much as knowing the basics of distributed systems.
  • Law affects system design. GDPR gives people a right to erasure (the "right to be forgotten"), which clashes with systems built on logs that are only ever appended to. How do you remove one record from the middle of a file that is never changed? How do you remove data that has already flowed into derived datasets, like the training data of a model? These are new engineering problems.
  • There are no clear rules on which technologies comply with GDPR. The law sets broad principles that people must interpret, instead of naming technologies, which change too fast.
  • We keep data because we think its value is greater than its cost. But the cost is more than the storage bill: a leak brings liability and damage to your name, and breaking the law brings legal costs and fines.
  • Governments or police can force a company to hand over data. Where the data could reveal something that is a crime in some places, such as a person's sexuality or seeking an abortion, storing it puts users in real danger. Even location history or IP address logs can show that someone visited a certain clinic.
  • Data minimization (in German, Datensparsamkeit) means deciding that some data is not worth keeping, and deleting it. It goes against the "big data" habit of storing everything just in case.
  • GDPR supports this with purpose limitation: you may collect personal data only for a purpose you state clearly up front. You may not later use it for some other purpose. And you may keep it only as long as that purpose needs it.
  • Industry standards add their own checks, separate from laws. Companies that process card payments must meet the PCI (Payment Card Industry) standards, with frequent independent audits. Buyers of software services often require vendors to meet SOC 2 (Service Organization Control Type 2), also checked by outside auditors.
  • In the end you must weigh what the business wants with what is fair to the people your data describes. A later chapter goes deeper into issues like bias and discrimination.

Key takeaways

  • Almost every design question in data systems has several answers, each with pros and cons; ask what you gain and what you give up.
  • OLTP serves app users with fast, fixed, small queries; OLAP serves analysts with large, open-ended scans of history.
  • Analytics usually runs on a separate copy, a warehouse or a lake, fed by ETL, and results can flow back through reverse ETL.
  • Know which system is the source of truth and which data is derived and can be rebuilt.
  • Cloud is not always cheaper, and it costs you control; steady, familiar workloads can be cheaper to self-host.
  • Cloud native systems build on other services, split storage from compute, treat local disks as a cache, and share hardware across customers.
  • Distribute only when you have a real reason; network calls are slow and can fail with unknown results, and one machine is often enough.
  • Data you store is a risk as well as an asset, and laws like GDPR shape how you must build.

Go deeper: DDIA, 2nd edition, chapter 1: Trade-Offs in Data Systems Architecture

Based on the ideas in Designing Data-Intensive Applications, 2nd edition, by Martin Kleppmann and Chris Riccomini (O'Reilly). Written in our own words; Recurse is not part of the book or its publisher. Get the book