SQL SERVER – Beginning of SQL Server Architecture – Terminology

SQL SERVER - Beginning of SQL Server Architecture - Terminology sqlserver SQL Server Architecture is a very deep subject. Covering it in a single post is an almost impossible task. However, this subject is very popular topic among beginners and advanced users.  I have requested my friend Anil Kumar, who is expert in SQL Domain to help me write  a simple post about Beginning SQL Server Architecture. As stated earlier, this subject is very deep subject and in this first article series he has covered basic terminologies. In future article he will explore the subject further down.

In this Article we will discuss about MS SQL Server architecture.

The major components of SQL Server are:

  1. Relational Engine
  2. Storage Engine
  3. SQL OS

Now we will discuss and understand each one of them.

1) Relational Engine: Also called as the query processor, Relational Engine includes the components of SQL Server that determine what your query exactly needs to do and the best way to do it. It manages the execution of queries as it requests data from the storage engine and processes the results returned.

Different Tasks of Relational Engine:

  1. Query Processing
  2. Memory Management
  3. Thread and Task Management
  4. Buffer Management
  5. Distributed Query Processing

2) Storage Engine: Storage Engine is responsible for storage and retrieval of the data on to the storage system (Disk, SAN etc.). to understand more, let’s focus on the concepts.

When we talk about any database in SQL server, there are 2 types of files that are created at the disk level – Data file and Log file. Data file physically stores the data in data pages. Log files that are also known as write ahead logs, are used for storing transactions performed on the database.

Let’s understand data file and log file in more details:

Data FileData File stores data in the form of Data Page (8KB) and these data pages are logically organized in extents.

Extents: Extents are logical units in the database. They are a combination of 8 data pages i.e. 64 KB forms an extent. Extents can be of two types, Mixed and Uniform. Mixed extents hold different types of pages like index, system, data etc (multiple objects). On the other hand, Uniform extents are dedicated to only one type (object).

Pages: As we should know what type of data pages can be stored in SQL Server, below mentioned are some of them:

  • Data Page: It holds the data entered by the user but not the data which is of type text, ntext, nvarchar(max), varchar(max), varbinary(max), image and xml data.
  • Index: It stores the index entries.
  • Text/Image: It stores LOB ( Large Object data) like text, ntext, varchar(max), nvarchar(max),  varbinary(max), image and xml data.
  • GAM & SGAM (Global Allocation Map & Shared Global Allocation Map): They are used for saving information related to the allocation of extents.
  • PFS (Page Free Space): Information related to page allocation and unused space available on pages.
  • IAM (Index Allocation Map): Information pertaining to extents that are used by a table or index per allocation unit.
  • BCM (Bulk Changed Map): Keeps information about the extents changed in a Bulk Operation.
  • DCM (Differential Change Map): This is the information of extents that have modified since the last BACKUP DATABASE statement as per allocation unit.

Log File: It also known as write ahead log. It stores modification to the database (DML and DDL).

  • Sufficient information is logged to be able to:
    • Roll back transactions if requested
    • Recover the database in case of failure
    • Write Ahead Logging is used to create log entries
      • Transaction logs are written in chronological order in a circular way
      • Truncation policy for logs is based on the recovery model

SQL OS: This lies between the host machine (Windows OS) and SQL Server. All the activities performed on database engine are taken care of by SQL OS. It is a highly configurable operating system with powerful API (application programming interface), enabling automatic locality and advanced parallelism. SQL OS provides various operating system services, such as memory management deals with buffer pool, log buffer and deadlock detection using the blocking and locking structure. Other services include exception handling, hosting for external components like Common Language Runtime, CLR etc.

I guess this brief article by Anil Kumar gives you an idea about the various terminologies used related to SQL Server Architecture. In future articles we will explore them further.

Reference: Pinal Dave (https://blog.sqlauthority.com)

SQL Server, SQL Server Architecture, SQL Server Security, SQL Training
Previous Post
SQL SERVER – Three Methods to Insert Multiple Rows into Single Table – SQL in Sixty Seconds #024 – Video
Next Post
SQL SERVER – Error: Fix – Msg 208 – Invalid object name ‘dbo.backupset’ – Invalid object name ‘dbo.backupfile’

Related Posts

36 Comments. Leave new

  • Naveen Kuchipudi
    May 14, 2015 12:06 pm

    i need more on architecture can anybody help me on that plz…

    Reply
  • it is very good and nice article to learn sql developer. Thank you so much for your post

    Reply
  • Hi Pinal

    Those Above information is useful for beginner and experience developer. But give information below of the topics,

    >> Query Processing
    >> Memory Management
    >> Thread and Task Management
    >> Buffer Management
    >> Distributed Query Processing.

    Reply
  • Architecture Updates helps us a lot.. But if SQL diagram is there, We will understand the points very quickly. Can you pls post it ?

    Reply
  • Nelson Nokimi
    March 31, 2016 3:53 pm

    Thanks verry much for the Post.

    It is great!

    Reply
  • Why there are 2 architectures in Sqlserver instead of only 1 ? (connected & Disconnected)

    Reply
  • Hi Pinal

    Those Above information is helped me alot to understand the architecture. But please give information below of the topics,

    >> Query Processing
    >> Memory Management
    >> Thread and Task Management
    >> Buffer Management
    >> Distributed Query Processing

    Reply
  • Thanks A Lot Sir , for making our day to day life easy with the most helpful and understandable articles.

    Reply

Leave a Reply