Understanding the core data concepts
To start, let’s understand the terminologies used in the data world so that all the following concepts are easily interpreted to be applied to technologies.
What is data?
Data is a record, also called a fact, which can be a number, text, or description used to make decisions. Data only generates intelligence when processed and then this data is called information or insights.
Data is classified into three basic formats: structured, semi-structured, and unstructured data. We will learn about them all in the following sections.
Structured data
Structured data is formatted and typically stored in a table represented by columns and rows. This data is found in relational databases, which organize their table structures in a way that creates relationships between these tables.
The following figure shows an example of a simple table with structured data:
Figure 1.1 – Example of structured data in a database
In this example, the table called CUSTOMER
has seven columns and six records (rows) with different values.
The CUSTOMER
table could be part of a customer relationship management (CRM) database, for example, financial and enterprise resource planning (ERP), among other types of business applications.
Semi-structured data
Semi-structured data is a structure in which records have attributes such as columns but are not organized in a tabular way like structured data. One of the most used formats for semi-structured data is JavaScript Object Notation (JSON) files. The following example demonstrates the structure of a JSON file containing the registration of one customer:
## JSON FILE - Document 1 ##
{
"CUSTOMER_ID": "10302",
"NAME":
{
"FIRST_NAME": "Leo",
"LAST_NAME": "Boucher"
},
"ADDRESS":
{
"STREET": "54, rue Royale",
"CITY": "Nantes",
"ZIP_CODE": "44000",
"COUNTRY": "France"
}
}
In this example, we can see that each JSON file contains a record, like the rows of the structured data table, but there are other formats of JSON and similar files that contain multiple records in the same file.
In addition to the JSON format, there is data in key-value and graph databases, which are considered semi-structured data, too.
The key-value database stores data in a related array format. These arrays have a unique identification key per record. Values written to a record can have a variety of formats, including numbers, text, and even full JSON files.
The following is an example of a key-value database:
Figure 1.2 – Example of a key-value database
As you can see in the preceding figure, each record can contain different attributes. They are stored in a single collection, with no predefined schema, tables, or columns, and no relationships between the entities; this differentiates the key-value database from the relational database.
The graph database is used to store data that requires complex relationships. A graph database contains nodes (object information) and edges (object relationship information). It means that the graph database predetermines what objects are and the relationships they will have with each other, but the records can contain different formats. The following is a representation of nodes and edges in a graph database of sales and deliveries:
Figure 1.3 – Example of a graph database
The diagram demonstrates how the relations around the ORDER entity are created in a graph database, considering the CUSTOMER, LOCATION, SUPPLIER, and PRODUCT nodes in the process. It represents an interesting acceleration in terms of query processing in the database because the graph is already structured to deliver the relations faster.
Unstructured data
In addition to structured and semi-structured data, there is also unstructured data, such as audio, videos, images, or binary records without a defined organization.
This data can also be processed to generate information, but the type of storage and processing for this is different from that of structured and semi-structured data. It is common, for example, for unstructured data such as audio to be transcribed using artificial intelligence, generating a mass of semi-structured data for processing.
Now that you understand the basics of data types, let’s look at how that data is stored in a cloud environment.
How is data stored in a modern cloud environment?
Depending on the data format, structured, semi-structured, and unstructured cloud platforms have different solutions. In Azure, we can count on Azure SQL Database, Azure SQL Database for PostgreSQL, Azure Database for MySQL, and database servers installed on virtual machines, such as SQL Server on a virtual machine in Azure, to store structured data. These are called relational databases.
Semi-structured data can be stored in Azure Cosmos DB and unstructured data (such as videos and images) can be stored in Azure Blob storage in a platform called Azure Data Lake Storage, optimized for queries and processing.
These services are delivered by Azure in the following formats:
- Infrastructure as a service (IaaS) – Databases deployed on virtual machines
- Platform as a service (PaaS) – Managed database services, where the responsibility for managing the virtual machine and the operating system lies with Azure
For these database services to be used, they must be provisioned and configured to receive the data properly.
One of the most important aspects after provisioning a service is the access control configuration. Azure allows you to create custom access role control, but in general, we maintain at least three profiles:
- Read-only – Users can read existing data on that service, but they cannot add new records or edit or delete them
- Read/Write – Users can read, create, delete, and edit records
- Owner – Higher access privilege, including the ability to manage permission for other users to use this data
With these configured profiles, you will be able to add users to the profiles to access the data storage/databases.
Let’s look at an example. You are an administrator of a CUSTOMER
database, and you have the Owner
profile. So, you configure access to this database for the leader of the commercial area to Read/Write
, and for salespeople to Read-only
.
In addition to the permissions configuration, it is important to review all network configurations, data retention, and backup patterns, among other administrative activities. These management tasks will be covered in Chapter 7, Provisioning and Configuring Relational Database Services in Azure.
In all database scenarios, we will have different access requirements, and it is important (as in the example) to accurately delimit the access level needs of each profile.