Alright, let's move on to 2.c Databases.
- Definition: A database is an organized collection of structured information, or data, typically stored electronically in a computer system. A database is usually controlled by a database management system (DBMS). Together, the data and the DBMS, along with the applications that are associated with them, are referred to as a database system, often shortened to just database.
Advertisement
- Types of Databases: This is a high-level overview; we'll go into much more detail in Phase 2.
- Relational Databases (SQL):
- Data is organized into tables with rows (records) and columns (fields).
- Relationships between tables are defined using foreign keys.
- Use SQL (Structured Query Language) for querying and manipulating data.
- Enforce ACID properties (Atomicity, Consistency, Isolation, Durability).
- Examples: MySQL, PostgreSQL, Oracle, SQL Server, SQLite.
- NoSQL Databases:
- A broad category of databases that don't follow the traditional relational model.
- Often designed for scalability, performance, and flexibility.
- Different types of NoSQL databases:
- Key-Value Stores: Store data as key-value pairs (e.g., Redis, Memcached, Amazon DynamoDB). Very fast for simple lookups.
- Document Stores: Store data in documents (e.g., JSON or XML) (e.g., MongoDB, Couchbase). Good for storing semi-structured data.
- Columnar Databases: Store data in columns instead of rows, optimized for analytical queries (e.g., Cassandra, HBase).
- Graph Databases: Store data as nodes and edges, representing relationships between entities (e.g., Neo4j, Amazon Neptune). Good for social networks, recommendation engines, etc.
- Often use BASE properties (Basically Available, Soft state, Eventually consistent).
- Relational Databases (SQL):
Advertisement
-
Key Considerations:
- Data Model: Choosing the right data model (relational, document, key-value, etc.) is crucial for performance and scalability.
- Consistency vs. Availability: The CAP theorem applies to databases. You need to choose a database that provides the right balance of consistency and availability for your application's needs.
- Scalability: How will the database handle increasing amounts of data and traffic?
- Security: Protecting data from unauthorized access and modification.
- Backup and Recovery: Ensuring that data can be recovered in case of failures.
-
Example: An e-commerce website might use a relational database (like MySQL) to store customer information, product details, and orders. A social media platform might use a NoSQL database (like Cassandra) to store user posts and social connections, prioritizing scalability and availability.
Advertisement