r/SQLServer • u/LeftoverMonkeyParts • Jun 01 '26
Question Replication to a writable database on a non-domain joined SQL Server
Howdy Everyone,
I have a bit of an odd requirement to meet. I'm no DBA but I have to play on on TV sometimes, so I want to ask here
SQL Server Versions: 2022 Standard
Database Size: ~500GB
Background: My organization legally required to both:
- Make a subset of our data publicly available via the web
- Ensure that any data accessed by the public is replicated, not live data
Our software vendor has a web client that is capable of exposing data to the public. They decided the best way to comply with the legal replication requirements was to design the web client in such a way that it supports simultaneous SQL connections to both Live and Replicated databases. A user browsing publicly has their queries directed to the replicated database, and their access is restricted (via the webapp) to a subset of data. Authenticated users have their queries directed to the live database. This is obviously batsh*t for many reasons and ticks the legal requirements for replication in name only while ignoring any security benefits. At best, assuming their ASP.NET trash isn't swiss cheese, it results in credentials for live data sitting out in our DMZ.
The previous DBAs solution was to set up transactional replication between the live/production SQL server and a second AD domain-joined replication server. We then run two web clients. One publicly accessible pointed only to replicated data, and one only accessible internally pointed to live data.
The public webapp is currently hosted on our internal network. It's being moved to the DMZ. I would like to set up a new, hardened, replication server that is a non-domain joined member server. I believe this is possible with Transactional Replication, but it requires local Windows service accounts with the same passwords on both the publisher/subscriber. I'd like to avoid a service account setup like that if possible.
We looked into Log Shipping, but the web client requires (for some godforsaken reason) that *both* databases are *writable*.
We're currently experimenting with a nightly drop/reload using Veeam Powershell and the DBATools Powershell modules.
Can anyone suggest any other strategies I'm overlooking for pushing a writable SQL database to a non-domain joined member server without having to create matching service accounts between the two? Up to a 24 hour delay is no issue.
Also am I being insane?
1
u/jshine13371 6 Jun 01 '26
Do you have a maintenance window and how long is it for? How big is the subset of data being replicated? How frequently does it change for what percentage of rows (roughly)?
1
u/mqaiser Jun 02 '26
SQL Server Merge Replication is a replication type that allows both the Publisher and Subscribers to make changes independently and later synchronize those changes.
How it works
A Publisher sends an initial snapshot to subscribers.
Users can insert, update, and delete data at both Publisher and Subscriber databases.
During synchronization, SQL Server exchanges changes between both sides.
If the same row was modified in multiple locations, SQL Server applies a conflict resolution policy.
1
u/muaddba 1 Jun 03 '26
SQL Server Transactional Replication doesn't HAVE to use windows-based service accounts for its connections, it can use SQL Authentication, though I do prefer to use Windows accounts when possible, but having one outside the domain makes it harder to do that. I'd just use SQL Authentication and really strong passwords.
I'm something of a replication guru, and I offer consulting services. If you'd like to, I would be happy to set up a 30m call (free) to talk about possible strategies to solve your problem. Copying the whole DB if you don't need to -- unless it's really small -- seems like a lot of extra work and potentially exposes data you don't want exposed. Allowing the application to determine and restrict which data is visible also seems like something I would not trust, I would filter it in the replication publication unless the filtering is incredibly complex, because I don't want data out there publicly exposed relying on the competence of a developer I have never met.
2
u/Zahninator Jun 01 '26
SSIS allows per server service accounts and connections. I hate it with a passion, but it works for us and "should" work for that use case of requiring different credentials.
We do a similar thing in reverse where data is pushed to a server in the DMZ from outside and then replicated to our main server inside the LAN.
1
u/PathTooLong Jun 01 '26
You could try https://debezium.io/
1
u/mqaiser Jun 02 '26
Merge replication
1
u/WurztSalartoDeMango Jun 07 '26
SQL Server Replikation, ist old school aber das funktioniert erste Sahne.
1
u/rdeheld69 Jun 08 '26
transactional push replication, sql acount on the subscriber, distribution in the domain
1
u/CPDRAGMEISH Jun 08 '26
IT'SG OK
Log shipping and local replication