この投稿はクラウド・コンピューティング基礎シリーズの一部です。 クラウドコンピューティング入門認定コースを受講して、さらにスキルを 高めましょう。
You might remember databases from our article on cloud resource types.
Let’s review just in case.
A database is a collection of structured information that can be stored on a server and accessed easily when needed, similar to a library. Cloud databases are hosted by third-party cloud providers and offer scalability and disaster recovery features and are usually controlled by a database management system (DBMS). Databases are used by anyone who needs to retrieve data, especially those dealing with large amounts of data.
It’s important to note that having a collection of data and having an interface for that data are two different things. For example, a dog-walking app might collect and store data, but a DBMS functions as the system that can communicate to the database and any other service that needs the data, acting as the interface.
While there are several varieties of database management systems, there are two common types: relational (SQL) and nonrelational (NoSQL).
A relational database is structured, and the data included is organized in tables. The data is related to one another. NoSQL (Non-relational databases) are document-oriented, and the data is not necessarily related.
Let’s take a look at these two types of databases.
Structured Query Language (SQL) is a programming language used for manipulating data in a relational database management system (RDBMS). The RDBMS is the software we use to manage, store, query, and retrieve data from the database.
A relational database refers to the fact that various relationships can be created between different pieces of data across multiple tables (where data is stored).
Take a look at the table above. Let’s say a social media web application has a single table within a database that stores a user’s ID, name, and date of birth. Since each user ID is unique, it can be used to connect user data in one table to another table that has user message history. This type of relationship is called a one-to-many relationship since one user can have multiple messages associated with their profile ID. However, messages cannot be sent from more than one profile ID.
SQL helps manage and manipulate data in a relational database. It allows us to create, modify, and retrieve data from tables within the database, as well as manage the relationships between different tables.
You may have heard of PostgreSQL and MySQL. These are two popular RDBMS that both use SQL. Let’s quickly take a look at what they do and how they differ.
PostgreSQL (often just called Postgres) is known for its scalability and accuracy and because it can handle complex queries and large datasets. PostgreSQL is also known for its advanced features, such as support for advanced indexing and full-text search, which make it a popular choice for applications that require advanced data analysis.
On the other hand, MySQL is known for its speed, flexibility, scalability, and ease of use. It’s often used for web applications that require fast read/write access to data, such as content management systems or eCommerce platforms.
A key difference between the two systems is that they differ in their approaches to data integrity. PostgreSQL is known for being strict about enforcing data integrity. It places a greater emphasis on ensuring that data is consistent and accurate. MySQL, on the other hand, is known for being more lenient and allowing for more flexibility in data handling. This also speaks to the speed that MySQL is known for. Each system has its strengths and limitations, as most tools do.
Let’s dive into NoSQL databases.
NoSQL databases use a non-relational data model to store and retrieve data. Unlike relational databases, which use tables with fixed columns and rows, NoSQL databases can store data in various formats, including key-value, document, column-family, and graph formats.
One of the primary benefits of NoSQL databases is that they are more flexible than SQL databases. It’s easy to add or modify data without having to make significant changes to the database structure. This makes NoSQL databases ideal for storing large, unstructured data sets.
NoSQL databases are scalable and can handle large volumes of data and high-traffic lords. Many
Let’s go through the common types of NoSQL databases.
Key-value stores are often used when data needs to be accessed quickly and efficiently. Because of their simple structure, they can be very fast and scale easily, making them a good choice for applications with high-performance requirements.
Document stores allow for flexible data modeling, making them ideal for content management systems, social media platforms, and eCommerce sites.
These databases store data in columns rather than rows, allowing for efficient storage and retrieval of large data sets. Column-family stores are often used for analytics and data warehousing.
In graph databases, data is stored as nodes and edges, making them ideal for storing and analyzing complex, interconnected data sets. Graph databases are often used for social networks, recommendation engines, and fraud detection.
Now that we’ve walked through the different types of databases, let’s look a how databases are used in the real world.
How Are Databases Used?
Databases allow us to store large volumes of data in one place. With most companies having an online presence, databases are used in almost every vertical imaginable.
Let’s say we have an eCommerce website. We can store customers’ order histories, product details, and customer data in one place. Or let’s look at our cell phones. They use databases to store our list of contacts. Databases are searchable and sortable, so the data we need can be found quickly and easily. For example, when we search for an email in an inbox, we are querying a database to find the message we want.