Start here
Database
A Database is a software that is used to store data - basically any piece of information that we may need at a later time. A lot of data that'll be stored in databases are used for data analytics. Organization use these data to predict patterns, find ways to utilize and improve them, and then determine strategies to best serve the customers
There are two main types of databases:
- Relational Databases
- Non-Relational Databases
Relational Databases
These databases store data in tables that are related to each other. Each table has rows (representing records) and columns (representing attributes). The relationships between tables are based on common data (keys).
Common relational databases(SQL):
- MySQL
- SQL Server
- Oracle
- DB2
- PostgreSQL
Non-Relational Databases
Also known as NoSQL databases, these databases store data in a variety of ways that are not table-based, such as key-value pairs, documents, graphs, or wide-column stores. They are often used when dealing with large volumes of varied data types.
Common non-relatonal databases(NoSQL):
- MongoDB
- Cassandra
- SQLite
- Redis
- Couchbase
Basic Concepts
-
Database
- A database is a collection of structured data.
- Think of it as a big box where you store all the information for later retrieval.
-
Database Management System (DBMS)
- A DBMS is the software that interacts with end users, applications, and the database itself to capture and analyze the data.
- Examples include Oracle, SQL Server, MySQL, PostgreSQL, and SQLite.
-
Table
- A table is a structured list of data of a specific type in a database.
- It's comprised of rows and columns. It's similar to a spreadsheet in Excel.
-
Column
- A column (or field) is a set of data values of a particular type.
- For example, a column named "FirstName" in a table "Customers" might be of type "VARCHAR" (variable character length), and hold customers' first names.
-
Row
- A row (or record) in a table represents a single, implicitly structured data item.
- For example, a row in a "Customers" table might represent a single customer, with columns for first name, last name, phone number, etc.
-
Primary Key
- A primary key is a column (or set of columns) whose values uniquely identify every row in a table.
- No two rows can have the same primary key value.
-
Foreign Key
- A foreign key is a set of one or more columns in a table that refers to the primary key in another table.
- It's used to link two tables together.
-
Index
- An index is a data structure that improves the speed of data retrieval operations on a database table.
- It works in a way similar to an index at the back of a book.
-
SQL
- SQL (Structured Query Language) is the standard language for dealing with Relational Databases.
- SQL can be used to insert, search, update, delete database records.
-
Relational Database
- A relational database is a type of database that stores and provides access to data points that are related to one another.
- It organizes data into tables which can be linked—or related—based on data common to each.
Where does the database fit in an application?
An application consist of two main components: the frontend and the backend.
-
Frontend is what the users see when they access a website or open the application in their devices. The user are able to see details through the frontend, as well as input information but they don't have access to the backend, where the database lies.
-
Backend is where the details are received, processed, and stored. This is where the server-side processing occurs.
Databases are part of the backend of an application. They enable the application to "remember" any information by storing and organizing them.
How Data is Obtained
An applications's structure can vary from application to application and different organizations will have different ways of building applications, but in general, this is how data is obtained.
- User opens the application through a browser/device.
- Application reach outs to API or backend server.
- Backend server talks to the data layer, including the database.
- Database receives the request and checks the collection or tables.
- The database then passes the details back to API server, all the way to the application being accessed by the user.