What are Databases?
Table of contents
Databases are essential for managing and organizing data in a way that makes it easy to access, manage, and update ๐. Think about the restaurant analogy ๐ฝ. Before you can enjoy a meal, the kitchen needs all sorts of things like ingredients ๐ฅฆ, spices ๐ถ, and cooking tools ๐ณ. A database holds all the bits and pieces of data ๐ that a computer program needs to work, all organized so itโs easy to find and use, just like how a kitchen organizes everything to cook your food. In our web development case ๐, a database may store data such as user-specific information ๐ค.
Relational and Non-Relational Databases ๐
There are several kinds of database, but the only two you need to understand for a introductory to databases are relational and non-relational databases.
Relational Database ๐
Relational databases store data in tables, sort of like grids ๐. Each table is for a different category of information. For example, one table for customer info ๐งโ๐ผ and another for orders ๐. These tables can link to each other through shared information, like if a customer places an order, thereโs a way to see that in both the customer and order tables.
Theyโre great when your data is structured and consistent ๐. This means you know exactly what information you need to store ahead of time, like names, addresses, or product orders. Theyโre used a lot in systems that need to keep track of things precisely, such as bank transactions ๐ฐ or school records ๐ซ.
Imagine a well-organized binder with different sections for each subject in school ๐. Each section has pages that follow the same format, making it easy to find and understand information. If you need to see how your math grades relate to your overall GPA, you can easily flip through the binder to find and connect that information ๐.
Non-Relational Databases ๐
Non-relational databases, or NoSQL databases, are more flexible in how they store data. They can handle a mix of structured and unstructured data, like text ๐, social media posts ๐ฌ, or even videos ๐ฅ. They donโt require a fixed table structure and can easily scale to handle huge amounts of data ๐.
These are great for big data applications or services that collect a lot of user-generated content, like social media platforms ๐ฑ or e-commerce sites with customer reviews ๐. They can quickly adapt to changes in the type of data being stored and can handle massive amounts of data ๐.
Think of a big, expandable folder ๐ that you can throw all sorts of notes into, whether theyโre written neatly on lined paper ๐ or quickly jotted on napkins ๐ฝ. You donโt have to organize every piece of information in the same way, and you can keep adding more notes without worrying about running out of space or messing up the order ๐.