As I said earlier, I'd be posting some articles on how SQL Server Engine works.
I'll do it in English, brother Tareq could translate it to Arabic if you want.
My first article would be about SQL Server Arcitecture
SQL Server Architecture
Below is a diagram showing all the components of SQL Server, we’ll dig into each of these components and have some idea about what does it do, after that we are going to dig more into how the query is getting executed.

SQL Server Protocols:
Below are the communication protocols that SQL Server supports:
- Shared Memory: Good for connecting to instance on the same machine.
- Named Pipes: Good for connection to an instance which exists on the LAN
- TCP/IP: The most widely used protocol over the internet. This protocol can be used to communicate across interconnected networks of different hardware and OSs
- Virtual Interface Adaptor (VIA): a protocol to be used with VIA hardware. It’s a specialized protocol for VIA hardware only
Query Processor:
Below are the build components of the Query Processor which is responsible of taking the user’s query in its textual format, parsing it and executing it, and then producing the results back
- Command Parser: generates a query tree out of the supplied T-SQL code to be consumed by the Query Optimizer
- Query Optimizer: transform the query tree into what’s known by a Query Plan which is an optimized plan on how the execution will be happening taking into consideration many variables like system IO, CPU usage, etc
- SQL Manager: responsible for anything related to stored procedures and managing their query plans, in addition to the new SQL Server 2005 feature Autoparamererization in which some ad hoc queries as if they are parameterized stored procs and query plans are generated and saved for them
- Database Manager: is access and retrieve all the metadata needed to query compilation and optimization (i.e. datatypes, indexes, etc)
- Query Executor: the final phase of the relational engine in which the query executor takes the query plan (Aka execution plan) and communicate with the storage engine (if needed) to execute the query plan’s iterators
Storage Engine:
The storage engine is the part of SQL Server that is responsible for anything related to storage, it maintains the indexes, the data and all operations on the data. It works with the Query Processor to locate and generate data, so it’s the next step after the query is ready to be executed.
It mainly does these operations:
- Access Methods
- Row & Index Operations
- Page Allocation Operations
- Versioning Operations
- Transaction Services
- Locking Operations
In the next article (which could be today or tomorrow), we'll be talking about the Storage Engine's Operation which are listed above, so stay tuned











