dot Stop testing, start deploying your AI apps. See how with MIT Technology Review’s latest research.

Download now

Databases

Back to Glossary

Today, data is a speed game. You’ve probably heard the stat that 90% of all data created since the dawn of time has been created within the last two years. As data has exploded, sprawled, and eaten the world, we’ve moved from talking about Big Data (“Wow, there’s so much of it!”) to talking about how we can better make use of that data (“What does it all mean?”). 

How we make use of that data depends on how quickly and easily we can store, access, and query it. This is where databases come in. 

But what exactly is a database, and why has this technology become so indispensable in today’s software-led business environment? Let’s dive into the dizzying world of databases, exploring their origins, the key types, and how they can be used to push the frontiers of what is possible.

What is a database?

A database is a structured collection of information that is stored electronically. You can think of a database as a digital library, where instead of books, you have data. This data can range from a simple list of customer names and contact information to complex transactional records for multinational corporations to vector databases that store unstructured data for AI applications.

Related content: Redis as a Cache vs Redis as a Primary Database

Evolution of databases

The concept of databases isn’t new. Long before the advent of computerized databases, people used physical filing systems—cabinets filled with folders, ledgers, and records. However, as businesses grew and technology advanced, the need for (and benefits of) a more efficient, electronic method to store and manage vast amounts of data became evident.

The 1960s and 1970s saw the birth of the first electronic database models, which were primarily hierarchical and navigational. The real revolution came with the introduction of the relational database management system (RDBMS) in the late 1970s, championed by Dr. Edgar F. Codd. RDBMS introduced the concept of tables (relations) where data could be stored and efficiently queried using a database access language called structured query language (SQL).

Database prevalence

In today’s digital age, databases are everywhere. Every time you make an online purchase, book a flight, or even like a post on social media, you’re interacting with a database. They ensure that the digital services we rely on daily run smoothly, storing vast amounts of data that can be quickly retrieved and analyzed. Databases play a pivotal role in:

Why are databases important?

In the digital realm, data can be likened to oil—a valuable resource that powers modern businesses, technologies, and innovations. Database management systems (DBMS), as structured repositories of this data, play a pivotal role in harnessing its potential. But why exactly are databases so crucial?

How a database works

The magic of databases lies in their ability to store, organize, and retrieve vast amounts of structured data with remarkable efficiency. But what mechanisms and processes underpin these capabilities? In this section, we’ll peel back the layers of an RDBMS to understand the inner workings of databases.

Basic architecture and components:

Databases are more than just storage bins for data. For example, an RDBMS is a complex system with multiple components working in tandem:

Data storage, retrieval, and manipulation:

The essence of a database’s functionality revolves around these three operations:

Query processing:

Databases use a specific language for data operations, most commonly SQL. When a SQL query is submitted:

Concurrency and transactions:

Databases often cater to multiple users or applications simultaneously. To manage this, they have:

Backup and recovery

Databases are equipped with backup and recovery mechanisms to safeguard against data loss.

Different types of databases

The world of databases is vast and varied, with different types designed to cater to specific needs, from handling structured business data to managing vast amounts of unstructured information. In this section, we’ll explore the diverse landscape of database types and understand their unique characteristics and use cases.

Relational databases:

The most common type of database, relational databases, store data in structured tables with rows and columns. They use SQL for querying and are known for being sturdy and reliable.

NoSQL databases

Non-relational databases, also called NoSQL databases, emerged to address the limitations of relational databases, especially when dealing with large volumes of unstructured data or real-time applications. Types of NoSQL databases include: 

Cloud databases

Databases hosted on cloud platforms, offering scalability, flexibility, and cost-effectiveness.

Event store databases

Designed to store sequences of events or transactions, useful for systems based on event sourcing.

Multi-model databases

These databases combine features of multiple database types, offering flexibility in data storage and querying.

Database management systems (DBMS)

Behind every effective database lies a powerful system responsible for its management, organization, and security. This system, known as the DBMS, plays a pivotal role in ensuring that databases operate optimally. In this section, we’ll delve into the world of DBMS, exploring its functions, types, and significance in the realm of databases.

What is a DBMS?

A DBMS is specialized software designed to interact with the user, applications, and the database itself to capture, store, and analyze structured data. It provides a systematic way to manage large amounts of data using a clear and structured framework.

Core functions of a DBMS

Types of DBMS

Choosing the right DBMS

The choice of a DBMS depends on several factors:

Database security

In an era where data breaches and cyberattacks are increasingly common, the security of databases has never been more important. Database security encompasses a range of measures, protocols, and tools designed to protect databases from unauthorized access, threats, and malicious attacks. In this section, we’ll explore the importance of database security, the potential threats faced, and the strategies employed to safeguard data.

Why is database security crucial?

Databases often house sensitive and critical information, from personal user details to confidential business data. A security breach can lead to:

Common database security threats

Database security best practices

Here are some best practices to help secure your databases: 

Data integrity and consistency

Data integrity and consistency are foundational principles in the realm of databases. They ensure that data remains accurate, reliable, and valid throughout its lifecycle.

Understanding data integrity

Data integrity refers to the accuracy and consistency of data stored in a database. It ensures that data remains unchanged and uncorrupted from its source and is delivered in its original form without any unintended alterations.

Why is data integrity crucial?

Challenges to Data Integrity

Maintaining Data Integrity

What is the CAP theorem? 

In researching database options, you might come across the CAP theorem. The CAP theorem posits that with a modern database system, it’s impossible to maintain all three of the following properties at once: 

At most, the theorem holds, it’s possible to maintain two of these properties. Often, database systems are classified by which two properties they maintain: 

The CAP theorem is important because it helps companies think through what properties are most important for their business applications and select a database that fits those requirements.

It’s also important to note that while AP and CP systems are most common, most database systems today do their best to balance these properties depending on different situations and requirements. 

In the context of the CAP theorem, what kind of system is Redis? 

In general, Redis is considered a CP system, where consistency and partition tolerance are prioritized over availability. The biggest risk with a CP system is that data won’t be available in certain scenarios. 

However, Redis does have high availability when not using Redis Cluster. For example, Redis Sentinel provides high availability, as well as other collateral tasks such as monitoring and notifying, as well as acting as a configuration provider for clients.

Using SQL vs NoSQL databases 

Traditionally, relational and non-relational databases are the two most common types of databases that a company will need to choose between. Which database type you pick will depend on factors such as your specific application requirements, data characteristics, scalability needs, and more. 

When should you use a SQL database? 

As we mentioned earlier, a relational or SQL database is the most common choice. You should use a SQL database when:

When should you use a NoSQL database? 

Certain NoSQL databases are optimized for particular scenarios, like graph databases for relationship-heavy data or key-value stores for caching. A NoSQL database might be a good fit your your business in the case of the following: 

Redis is an in-memory datastore best known for caching. You can deploy different caching patterns—such as cache prefetching or cache-aside pattern—to speed up database queries while keeping costs low. 

Learn more about how to use Redis for query caching

Powering past, present, and future innovation 

From physical filing systems to on-premise servers and today’s innovative hybrid cloud models, database solutions have evolved considerably in recent decades to power many of today’s most advanced technologies. This progress allows companies to choose from a wide array of database services and solutions to power their critical applications.

Try Redis for free to see the power of our data platform in your tech stack.