AlgoViz

SQL databases

easy 25 min

A SQL (relational) database keeps data in tables with declared columns, joins those tables by key when you ask a question, and enforces rules such as unique emails and valid references.

Where it shows up

The same pattern appears across everyday software.

  • Facebook and MySQL

    Its engineers wrote in 2021 that MySQL powers some of Facebook's most important workloads, while describing a move to version 8.0.

  • Stack Overflow

    Its 2016 architecture article lists four Microsoft SQL Server machines behind the question sites, with Redis and Elasticsearch beside them.

  • SQLite in your pocket

    The SQLite project lists every Android device, every iPhone, and the Firefox, Chrome and Safari browsers among its users.

  • Bank transfers

    Debit and credit in one transaction, with a check that the balance never goes below zero.

  • Seat and room booking

    A unique constraint on seat and show makes double booking impossible, however many servers try.

  • Internal tools and back offices

    Staff invent new questions every week. Ad hoc SQL answers them without a new data model.