SQL Server之间传输数据库数据的策略
我想要一些有关将数据库数据从一台 SQL 服务器传输到另一台 SQL 服务器的最佳方法的建议。
这是我的场景:
客户可以通过我们的网站(托管前端)或通过我们的办公室呼叫中心(后端)订购产品
客户登录后,网站上会显示 $$ 余额。这个余额是从后端sql中检索到的。该余额也可以通过呼叫中心获得。可以订购的产品取决于此 $$ 余额。
从呼叫中心发出的订单将保存到后端 SQL 数据库。从网站发出的订单将保存到前端 SQL 数据库,但需要尽快传输到与呼叫中心订单相同的后端 SQL 数据库,以便订单履行团队可以开始处理它。订单履行团队无法访问前端。
网站上显示的$$余额需要考虑尚未转入后端的订单。目前,我们在订单记录上有一个位标志“HasBeenTransferred”,指示订单是否已被转移。
将这些订单从前端传输到后端 SQL Db 的最佳方法是什么?
我研究过 SQL 复制 - 但我遇到的问题是我无法使用此方法可靠地设置“HasBeenTransferred”位标志,这对于系统工作至关重要
任何帮助都会很大赞赏。
I would like some advice on the best approach for transferring DB data from one SQL server to another.
This is my scenario:
Customers can make orders for products either through our website (hosted front end) or through our in-office call center (back end)
Customers, once logged in, have a $$ balance that is displayed on the website. This balance is retrieved from the back-end sql. This balance is also available via the call center. Products that can be ordered is determined by this $$ balance.
Orders made from the call center get saved to a back-end sql DB. Orders made from the website get saved to a front-end sql DB but needs to be transferred to the same back-end sql DB as call center order asap so that the order fulfillment team can start working on it. The order fulfillment team don’t have access to the front-end.
The $$ balance displayed on the website needs to take into account orders that have not been transferred to the back-end yet. Currently we have a bit flag "HasBeenTransferred" on the order record indicating if it has been transferred or not.
What would be the best method for transferring these orders from our front end to our back end SQL Db?
I’ve looked into SQL replication - but the problem I’ve come across is that I won’t be able to set the "HasBeenTransferred” bit flag reliably using this method and this is critical for the system to work
Any help would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能仍然应该考虑为此进行复制。除了设置标志之外,您的场景听起来非常适合复制。并且,您可以自定义复制以便设置标志。不过,如果您使用事务复制,则信息可能会在任何人评估“HasBeenTransferred”标志之前传输。
You should probably still consider replication for this. Other than setting the flag, your scenario sound perfect for replication. And, you can customize the replication so that the flag can be set. Although, if you use transactional replication, the information could transfer before anyone can evaluate the "HasBeenTransferred" flag.
如果需要立即传输数据,请使用 SQL Server 连续复制或执行 SPROC 的触发器,SPROC 通过链接服务器调用将数据填充到其他服务器中。
如果您不需要立即需要它,请使用 SQL Server 作业,它会按照给定的时间间隔同步数据。
If you need to data transferred immediately, use either SQL Server Continuous Replication, or a trigger which executes a SPROC, which does populates the data in the other server via a linked server call.
If you don't need it immediately, use a SQL Server Job, which synchronizes the data at a given time interval.