Database
What is Database (DB) ?
Any collection of related information
- Phone Book
- Shopping list
- Todo list
- Your 5 best friends
- Facebook's User Base
Databases can be stored in different ways
- On paper
- In your mind
- On a computer
- This powerpoint
- Comments Section
Database Management Systems (DBMS)
A special software program/application that helps users create and maintain a database
- Makes it easy to manage large amounts of information
- Handles Security
- Backups
- Importing/exporting data
- Concurrency
- Interacts with software applications for example - Java using JDBC etc., Website using JS and all.
The main operation in database are Create, Read, Update and Delete (CRUD)
Types of Database
There are two types of database -
Relational Database (SQL) | Non Relational Database (No-SQL) |
---|---|
Organize data into one or more table | Organize data is anything but a traditional database |
Each table has columns and rows | Key value store in form of documents (JSON, XML etc) |
A unique key identifies each row | Flexible table |
Example - MariaDB, MySQL etc. | Example - MongoDB, DynamoDB, etc. |
Relational Databases (SQL)
Relational Database Management Systems (RDBMS)
Help users create and maintain a relational database. For example - mySQL, Oracle, postgreSQL, mariaDB, etc.
Structured Query Language (SQL)
- Standardized language for interacting with RDBMS
- Used to to perform C.R.U.D operations, as well as other administrative tasks (user management, security, backup, etc).
- Used to define tables and structures
- SQL code used on one RDBMS is not always portable to another without modification.
Non-Relational Databases (noSQL / not just SQL)
Non-Relational Database Management Systems (NRDBMS)
- Help users create and maintain a non-relational database. Exmaple - mongoDB, dynamoDB, apache cassandra, firebase, etc
- Implementation Specific
- Any non-relational database falls under this category, so there's no set language standard.
- Most NRDBMS will implement their own language for performing C.R.U.D and administrative operations on the database.
Database Queries
- Queries are requests made to the database management system for specific information.
- As the database's structure become more and more complex, it becomes more difficult to get the specific pieces of information we want.
Example - A google search is a query
Summary
- Database is any collection of related information
- Computer are great for storing databases
- Database Management Systems (DBMS) make it easy to create, maintain and secure a database.
- DBMS allow you to perform the C.R.U.D operations and other administrative tasks
- Two types of Databases, Relational & Non-Relational
- Relational databases use SQL and store data in tables with rows and columns
- Non-Relational data store data using other data structures