Databases
A Database is an organized collection of data, so that it can be easily accessed and managed.
SQL (Relational Databases)
Section titled “SQL (Relational Databases)”SQL (Structured Query Language) databases store data in tables (like Excel sheets) with rows and columns. They are good for structured data and complex queries.
PostgreSQL
Section titled “PostgreSQL”PostgreSQL (or Postgres) is an advanced, open-source object-relational database system.
- Reliable: Known for data integrity and correctness.
- Features: Supports JSON, complex queries, and custom types.
- ACID Compliant: Ensures transactions are processed reliably (Atomicity, Consistency, Isolation, Durability).
For a deeper, practical guide with raw SQL examples (constraints, indexes, joins, transactions, JSONB), see:
Other SQL Databases
Section titled “Other SQL Databases”- MySQL: Very popular, powers WordPress.
- MariaDB: A popular MySQL-compatible fork.
- SQLite: A file-based database. Good for small apps or mobile.
- Oracle: Enterprise database (often used in large organizations).
- Microsoft SQL Server: Enterprise database (common in Windows/.NET environments).
NoSQL (Non-Relational)
Section titled “NoSQL (Non-Relational)”NoSQL databases do not use tables. They might use documents (JSON), key-value pairs, or graphs.
- MongoDb: Stores data like JSON documents. Flexible schema.
- Redis: In-memory key-value store. Very fast. Often used for Caching.
Concepts
Section titled “Concepts”- Normalization: Organizing data to reduce redundancy (duplicates).
- Transactions: A group of operations that either all succeed or all fail.
- Indexing: A way to speed up searching in a database (like the index at the back of a book).
Replication (Mention)
Section titled “Replication (Mention)”Replication means keeping copies of your data across multiple machines.
- Improves availability (if one node goes down, another can serve reads).
- Can improve read performance.
Sharding (Mention)
Section titled “Sharding (Mention)”Sharding splits a large dataset into smaller parts (shards) across multiple databases/servers.
- Improves horizontal scalability.
- Adds complexity (routing queries, rebalancing shards).