# brentozarultd/sql-server-first-responder-kit architecture

> Architecture diagram of the GitHub repository brentozarultd/sql-server-first-responder-kit, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/brentozarultd/sql-server-first-responder-kit
- Repository: https://github.com/brentozarultd/sql-server-first-responder-kit

## Overview

##### Main Components

a. Core Components:
- Diagnostic Stored Procedures
- Data Collection & Storage
- Output Generation System
- Integration Points

b. Supporting Components:
- Installation System
- Documentation System
- Testing Framework

**┌─────────────────────────────────────────────────────────┐**
- Client Applications                     │
- (SSMS, Azure Data Studio, or any SQL client)            │
- ┘
- ↕
**┌─────────────────────────────────────────────────────────┐**
- Interface Layer                          │
- Stored Procedure Entry Points                         │
- Parameter Handling                                    │
- ┘
- ↕
**┌─────────────────────────────────────────────────────────┐**
- Core Analysis Engine                     │
- ┬─────────────────┬───────────────────┤
- Health Check   │ Performance     │    Diagnostic     │
- (sp_Blitz)     │ (sp_BlitzCache) │    Tools         │
- ┴─────────────────┴───────────────────┘
- ↕
**┌─────────────────────────────────────────────────────────┐**
- Data Collection Layer                    │
- DMV Interaction                                       │
- System Table Access                                   │
- Extended Events                                       │
- ┘
- ↕
**┌─────────────────────────────────────────────────────────┐**
- Storage Layer                           │
- Output Tables                                         │
- Historical Data                                       │
- ┘

##### Component Details

For each major stored procedure, show:
- Input parameters
- Output formats
- Dependencies
- Data flow direction
- Integration points with SQL Server components

##### Interaction Flows

Data flows between:
- Stored procedures and SQL Server DMVs
- Output generation and storage
- Cross-procedure communication
- External system integration

##### Implementation Notes

- Use standard UML or database notation
- Version information
- Optional components
- Deprecated features

##### Integration Points

Connections with:
- SQL Server system databases
- Extended Events sessions
- Backup systems
- Monitoring tools
- Logging infrastructure

##### Deployment View

A separate section showing:
- Installation requirements
- Database context
- Permissions needed
- Cross-database dependencies

##### Monitoring & Maintenance

Components for:
- Historical data collection
- Performance tracking
- Self-diagnostics
- Cleanup processes

This system design should be created using a professional diagramming tool that supports:
- Multiple layers
- Connectors with different styles
- Export to common formats
- Collaboration features

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Client Layer"
        Client["Client Applications"]:::client
    end

    subgraph "Interface Layer"
        SP["Stored Procedure Entry Points"]:::interface
        PH["Parameter Handling"]:::interface
    end

    subgraph "Core Analysis Engine"
        HC["Health Check (sp_Blitz)"]:::core
        PA["Performance Analysis (sp_BlitzCache)"]:::core
        RD["Real-time Diagnostics (sp_BlitzFirst)"]:::core
        IA["Index Analysis (sp_BlitzIndex)"]:::core
        LA["Lock Analysis (sp_BlitzLock)"]:::core
        AM["Activity Monitor (sp_BlitzWho)"]:::core
    end

    subgraph "Data Collection Layer"
        DMV["DMV Interaction"]:::data
        STA["System Table Access"]:::data
        EE["Extended Events"]:::data
    end

    subgraph "Storage Layer"
        OT["Output Tables"]:::storage
        HD["Historical Data"]:::storage
    end

    subgraph "Supporting Infrastructure"
        Doc["Documentation"]:::support
        Test["Testing Framework"]:::support
        Install["Installation System"]:::support
        ST["Supporting Tools"]:::support
        Dep["Deprecated Components"]:::support
    end

    Client --> SP
    SP --> PH
    PH --> HC & PA & RD & IA & LA & AM
    HC & PA & RD & IA & LA & AM --> DMV & STA & EE
    DMV & STA & EE --> OT
    OT --> HD

    %% Supporting connections
    Install --> SP
    Test --> HC & PA & LA
    Doc --> HC & PA & IA

    %% Click events
    click HC "https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/blob/dev/sp_Blitz.sql"
    click PA "https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/blob/dev/sp_BlitzCache.sql"
    click RD "https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/blob/dev/sp_BlitzFirst.sql"
    click IA "https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/blob/dev/sp_BlitzIndex.sql"
    click LA "https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/blob/dev/sp_BlitzLock.sql"
    click AM "https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/blob/dev/sp_BlitzWho.sql"
    click Doc "https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/tree/dev/Documentation/"
    click Test "https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/tree/dev/tests/"
    click Install "https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/blob/dev/Install-All-Scripts.sql"
    click Dep "https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/tree/dev/Deprecated/"
    click ST "https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/blob/dev/sp_DatabaseRestore.sql"

    %% Styling
    classDef client fill:#f9f,stroke:#333,stroke-width:2px
    classDef interface fill:#bbf,stroke:#333,stroke-width:2px
    classDef core fill:#0074D9,stroke:#333,stroke-width:2px,color:#fff
    classDef data fill:#2ECC40,stroke:#333,stroke-width:2px
    classDef storage fill:#FF851B,stroke:#333,stroke-width:2px
    classDef support fill:#AAAAAA,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1["Client Layer"]:::client
        L2["Interface Layer"]:::interface
        L3["Core Components"]:::core
        L4["Data Collection"]:::data
        L5["Storage"]:::storage
        L6["Supporting Systems"]:::support
    end
```
