system-design-primer
reference — in the room

Security

in short — written for this site
Encrypt in transit and at rest, sanitize input, and grant the least privilege that works.
in transit and at rest
Encrypt both. Sanitize all user inputs or any input parameters exposed to the user to prevent XSS and SQL injection.
parameterize queries
Use prepared statements rather than string concatenation to prevent SQL injection.
least privilege
Users should only be able to access what they need. Same for processes, services and hosts.
from the primer — full sectionsynced

This section could use some updates. Consider contributing!

Security is a broad topic. Unless you have considerable experience, a security background, or are applying for a position that requires knowledge of security, you probably won't need to know more than the basics:

  • Encrypt in transit and at rest.
  • Sanitize all user inputs or any input parameters exposed to user to prevent XSS and SQL injection.
  • Use parameterized queries to prevent SQL injection.
  • Use the principle of least privilege.

Source(s) and further reading

sourcedonnemartin/system-design-primer / README.mdanchor#securitysyncedsynced from donnemartin/system-design-primer@master · 2026-08-16