Skip to content

Architecture

Kevin Cunnane edited this page Nov 23, 2016 · 1 revision

Eagles-eye view of the extension

High Level Architecture

Architecture Breakdown

There are 3 main pieces relevant to contributors

  • SQL Tools Service. This is a common backend service that could support many different front end UIs - VSCode, Sublime, Visual Studio for Mac, or even an interactive commandline wrapper.
    • This is written in C# and runs on .Net Core.
    • The chief benefit of this is that a large amount of existing business logic such as the SMO library can be leveraged
  • MSSQL Extension for VSCode. This is our VSCode extension, written in Typescript and integrated with most of the common VSCode extension points.
  • Results View, our UI layer. This is an AngularJS web application written using Angular2, Typescript with some related libraries.

Communications between the app layers

Source Layer Target Layer Communications Protocol Details
MSSQL Extension SQL Tools Service JSON-RPC over Std Input/Output
  • SQL Tools Service is a child process of the extension.
  • Communication is over the Std I/O channel, with JSON as the communications language.
  • The language server protocol used by many other extensions is the basis for this pattern. It allows us to standardize on a common protocol that is being supported in many IDEs and editors. One key difference is that we add new message types not needed by regular language servers, for example to connect and execute queries
MSSQL Extension Results View (WebView component) Standard Client/Server HTTP protocol
  • The extension acts as the server for the front-end Results View client.
  • Web Sockets are used to support more interactive updates and protocols.

Example flow diagram

For reference, here is the execution flow for a T-SQL query. It covers basic message passing and gives an idea of the basic app layers.

Query Execution Flow Diagram