Database Fundamentals
Database fundamentals covers how structured data is stored, organized, queried, and protected. It introduces relational and non-relational models, SQL, transactions, indexing, normalization, and the design decisions that determine a database's correctness and performance.
itDatabases and data storage | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — Database Fundamentals
A database is the organized information that needs to remain useful after more than one person or program has had ideas about it. A DBMS, the software that manages that information, supplies the rules, storage, concurrency control, permissions, and recovery work. A shared file can keep records; it is much less cheerful when two changes collide or one half-finished change needs to be unwound.
The key move is to model durable facts before modeling screens. In a relational database, tables hold rows, columns name typed attributes, and a primary key gives each row an identity. A foreign key connects a row to an existing row elsewhere. This arrangement lets customers and orders remain separate facts while still answering questions about them together. A many-to-many relationship gets its own connecting table, because hiding a list inside one column is how a tidy model acquires a small, private swamp.
Rules belong where every writer must obey them. Constraints reject missing values, duplicates, broken references, and values outside stated conditions. Application validation still helps people fix mistakes, but it cannot protect data written by an import or an administration tool. The surprising part is that a query result is not inherently ordered. If order matters, ask for it with ORDER BY; otherwise the database has made no promise, however orderly it looked on Tuesday.
Transactions group changes that must stand or fall together. Moving credit between two accounts is one unit, not two optimistic sentences separated by a network problem. Commit keeps the complete unit. Rollback discards it. Isolation then decides what concurrent work can observe, which is why stronger protection can also mean waiting or retries. An index offers another way to find selected rows, but it costs storage and write maintenance; the plan, not the column's impressive name, decides whether it helps.
The database also has to survive its own biography. Give roles only the privileges they need, version schema changes, watch latency and locks, and test restores. Replication can improve availability, but it copies unwanted changes with commendable efficiency. A completed backup job is therefore evidence of a completed backup job, which is a smaller claim than recovery.
Read the intro when you need the full map from schema through operations. Use the slides to keep the relationships and choices in view. Keep the cheatsheet nearby while designing tables or reading a plan. Then use the practice reference and exercise to create related tables, prove constraints, and watch a transaction commit or disappear. That is where the vocabulary stops being decorative and starts doing useful work.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://www.postgresql.org/docs/current/tutorial.html
Supports
- PostgreSQL's official tutorial introduces relational concepts and SQL
- The tutorial covers tables, rows, queries, joins, aggregates, updates, foreign keys, and transactions
- https://www.postgresql.org/docs/current/tutorial-arch.html
Supports
- A database server manages database files, accepts client connections, and performs database actions for clients
- Client and server responsibilities can run on different hosts
- https://www.postgresql.org/docs/current/tutorial-concepts.html
Supports
- A relational database stores data in relations represented as tables
- Tables contain rows with the same named, typed columns
- SQL does not guarantee table row order without explicit sorting
- https://www.postgresql.org/docs/current/tutorial-sql.html
Supports
- SQL supports table creation, row insertion, queries, joins, aggregates, updates, and deletion
- https://www.postgresql.org/docs/current/tutorial-join.html
Supports
- A join combines rows from multiple tables through a matching condition
- Inner and outer joins retain different sets of matched and unmatched rows
- https://www.postgresql.org/docs/current/ddl-constraints.html
Supports
- Check, not-null, unique, primary-key, and foreign-key constraints reject invalid table states
- A primary key is unique and not null
- A foreign key preserves referential integrity between related tables
- A junction table with overlapping foreign keys can implement a many-to-many relationship
- https://learn.microsoft.com/en-us/previous-versions/troubleshoot/microsoft-365/microsoft-365-apps/access/database-normalization-description
Supports
- Normalization organizes tables and relationships to reduce redundancy and inconsistent dependencies
- The first three normal forms separate repeating groups and facts that depend on different keys
- Deliberate departures from normalization require attention to redundancy and consistency
- https://www.postgresql.org/docs/current/functions-comparison.html
Supports
- Ordinary comparisons produce null when an input is null
- SQL provides IS NULL and IS NOT NULL predicates
- https://www.postgresql.org/docs/current/tutorial-transactions.html
Supports
- Transactions bundle multiple steps into an all-or-nothing operation
- Commit makes changes visible and durable while rollback discards them
- Savepoints allow partial rollback within a transaction
- https://www.postgresql.org/docs/current/transaction-iso.html
Supports
- Isolation levels define which concurrency phenomena can occur
- Serializable transactions can require retries after serialization failures
- https://www.postgresql.org/docs/current/mvcc-intro.html
Supports
- Multiversion concurrency control gives each statement a snapshot of data
- Concurrent reading and writing can proceed with reduced lock contention
- https://www.postgresql.org/docs/current/indexes-intro.html
Supports
- Indexes can locate selected rows without scanning an entire table
- Indexes add storage and data-modification overhead
- The planner decides whether an index is useful for a query
- https://dev.mysql.com/doc/refman/8.4/en/optimization-indexes.html
Supports
- Indexes can improve selected queries by locating matching rows
- Unnecessary indexes consume space and add insert, update, and delete cost
- https://www.postgresql.org/docs/current/ddl-priv.html
Supports
- Database objects have owners and configurable privileges
- Grant and revoke control privileges for roles
- https://www.postgresql.org/docs/current/backup.html
Supports
- PostgreSQL documents SQL dumps, file-system backups, and continuous archiving as backup approaches
- Recovery planning must select and operate an appropriate backup approach
- https://www.postgresql.org/docs/current/continuous-archiving.html
Supports
- A base backup plus archived write-ahead log supports point-in-time recovery
- Administrators should test recovery procedures and protect archived data
- https://www.mongodb.com/docs/manual/data-modeling/
Supports
- MongoDB documents can vary in fields and field types within a collection
- Document schemas can embed or reference related data according to access patterns
- https://redis.io/docs/latest/develop/data-types/
Supports
- Redis stores values by key and provides multiple value data types
- Redis data types support different access and update operations
- https://neo4j.com/docs/getting-started/appendix/graphdb-concepts/
Supports
- A property graph represents data with nodes, relationships, labels, and properties
- Relationships connect nodes and carry direction, type, and properties
- https://www.seas.upenn.edu/~zives/03f/cis550/codd.pdf
Supports
- E. F. Codd proposed the relational model in 1970.
- https://research.ibm.com/publications/system-r-relational-approach-to-database-management
Supports
- IBM System R documented an early relational DBMS implementation and SQL language work.
- https://www.postgresql.org/docs/current/history.html
Supports
- POSTGRES implementation began in 1986; its first demonstration was in 1987, Version 1 reached external users in 1989, Postgres95 added SQL in 1994, and PostgreSQL was named in 1996.
- https://neo4j.com/open-source-project/
Supports
- Neo4j documents the property graph model in 2000, an open-source and commercial 1.0 release in 2007, and Cypher in 2011.
- https://about.gitlab.com/blog/postmortem-of-database-outage-of-january-31/
Supports
- GitLab’s 2017 database outage showed that replication and untested backups did not provide a recoverable independent copy.
- The postmortem describes an accidental primary data-directory removal, replication failure, and a failed backup procedure.
- https://about.gitlab.com/blog/why-we-spent-the-last-month-eliminating-postgresql-subtransactions/
Supports
- GitLab traced sudden query stalls to subtransaction behavior and used waits, timeouts, backlog growth, and database activity sampling to investigate.
- https://about.gitlab.com/blog/path-to-decomposing-gitlab-database-part1/
Supports
- GitLab decomposed its monolithic PostgreSQL database through phased work, staging validation, metrics, logging, and a small final cutover.
- https://www.postgresql.org/
Supports
- PostgreSQL is available as an open-source relational database option.
- https://www.mysql.com/
Supports
- MySQL is available as a relational database option with community and commercial offerings.
- https://www.oracle.com/database/
Supports
- Oracle Database is a commercial relational database option.
- https://www.microsoft.com/en-us/sql-server/
Supports
- Microsoft SQL Server is a commercial relational database option.
- https://www.mongodb.com/
Supports
- MongoDB is a document database option.
- https://redis.io/
Supports
- Redis is a key-value data platform option.
- https://neo4j.com/
Supports
- Neo4j is a graph database option.
