- DATE:
- AUTHOR:
- PowerSync Product Team
Announcing SQL Server Backend DB Support (Alpha)
We’re excited to announce the alpha release of SQL Server support - joining Postgres, MongoDB and MySQL as a supported backend database for PowerSync.
PowerSync is intentionally stack-agnostic - designed to work with any popular backend database and client-side framework. Many enterprises run their core systems on Microsoft SQL Server (whether on-prem or in Azure) and over time, SQL Server support became one of the most requested and up-voted items on our roadmap. By adding SQL Server as a supported backend database, we enable those teams to keep their current database while getting PowerSync's real-time sync and a SQLite-backed app experience.
How It Works
We built SQL Server support in PowerSync using the same modular backend-connector architecture that powers our Postgres, MongoDB, and MySQL integrations. In practice this means we added a new module to the PowerSync Service to handle replication from SQL Server databases. PowerSync leverages the SQL Servers's Change Data Capture (CDC) mechanism. When CDC is enabled on a table, SQL Server reads changes from the transaction log asynchronously and writes them into special CDC "change tables". PowerSync continuously polls those change tables (via stored procedures) and replicates any new events.
Supported Editions and Versions
SQL Server 2022+
Editions: Standard, Enterprise, Developer, Evaluation
Version 16.0+
Azure SQL
Editions: Database, Managed instance
Min. service tier: Any service tier on vCore purchasing model. S3 tier and up on DTU purchasing model.
Get Started
Prerequisites
See the Source Database Setup instructions in our docs for the necessary configuration on your SQL Server/Azure SQL database:
Enable CDC on your database and on each table you want to replicate.
Create a
_powersync_checkpointstable, also CDC enabled.Provide a database user with the necessary permissions.
Connect via PowerSync Cloud or Self-Host
Cloud option: Add your connection details via the PowerSync Dashboard. See the docs.
Self-host option: Follow our self-hosting guide (with requirements and environment setup). We have also published a reference demo app for SQL Server connections and a Node.js backend.
Define Sync Rules
Once connected, create Sync Rules / Sync Streams to specify which tables/rows should sync to clients. See our docs for details.
Limitations and Known Issues
Schema change handling is not supported yet.
Spatial data types are returned as JSON objects as supplied by the Tedious
node-mssqlclient. See notes here.Due to limitations in the
node-mssqlclient, temporal data types are returned with a maximum precision level of milliseconds.There is an inherent latency in replicating data from SQL Server to PowerSync. See docs for more details.
Need Help? Have Feedback?
The SQL Server connector is in an alpha release. We don’t yet recommend it for production use, as breaking API changes may still occur and bugs could exist. The PowerSync Service - and other backend database connectors (Postgres, MongoDB) - has been stable for over a year, so much of the functionality is proven. But the SQL Server–specific components still need testing and real-world use to be ready for production-use.
If you need any help, run into issues or have feature requests, please report them on GitHub or in our Discord community.