What are Databases?

Table of contents

  1. Relational and Non-Relational Databases ๐Ÿ—‚
    1. Relational Database ๐Ÿ“Š
    2. Non-Relational Databases ๐ŸŒ€

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 ๐Ÿ”„.

Kitchen Database Analogy

Previous: Servers Next: RESTful