Implement Logical Data Structures – The Storage of Data


Unlike physical data storage structures, you cannot actually touch logical storage structures. That is because logical storage structures are arrangements like blocks, extents, segments, and tablespaces that reside on the physical disk. The exact details and definitions of these terms and their implementation are closely related to the datastore or DBMS where your data is stored. Figure 4.30 and the following descriptions represent a general illustration for learning purposes.

The smallest structure is a block that stores the data. The maximum value for data stored in a block, in this example, is 8 KB. An extent is a set of contiguous blocks that store a specific type of information. Consider the fact that you may want to store a piece of data that is over 8 KB; in this case, it would require more than a single block but gets represented by an extent. A segment is a set of extents that represents a given type of data structure. A table’s data, for example, is stored in a single segment, which could span multiple datafiles, where a datafile is the means for storing the data onto a physical disk. Finally, a tablespace is a logical structure that resides within the database and is where the data is stored. A database can have multiple tablespaces that span multiple datafiles that have segments spanning across them.

FIGURE 4.30 Logical data structure

Generally, logical data structures do not include datasets. Instead, the purpose of a logical data structure is to improve the ease of locating data and to improve performance by having an efficient retrieval process. This book is a good example of the difference between physical and logical data storage structures. The content printed onto the pages of this book is physically stored there. The way the book is structured is logical. For example, Parts, Chapters, Sections, and Pages help you navigate and quickly find the information you are looking for. The logical components are contextual information that exist in the book, but they are not part of the provided learnings contained within the book itself. Also consider the index at the end of the book and how looking through it helps you quickly find exactly what you want. An index in the database sense performs the same function with very similar benefits.

Build a Temporal Data Solution

Chapter 3 discussed the design and details of a temporal table (refer to Figure 3.20). In summary, a temporal table is one that keeps a history of CRUD operations performed on the rows contained within it. Begin with Exercise 4.9, where you will build and implement a temporal data solution. As of this writing, temporal tables are not supported in Azure Synapse Analytics. Therefore, the exercise is performed on the Azure SQL database you provisioned in Exercise 2.1.

Leave a Reply

Your email address will not be published. Required fields are marked *