比较和对比变更数据捕获和数据库变更通知

发布于 2024-07-07 23:16:49 字数 88 浏览 6 评论 0原文

甲骨文拥有两种看似相互竞争的技术。 CDC 和 DCN。

各自的优势是什么?

你什么时候会使用其中一种而不使用另一种?

Oracle has two seemingly competing technologies. CDC and DCN.

What are the strengths of each?

When would you use one and not the other?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

天煞孤星 2024-07-14 23:16:50

通常,您将使用 DCN 通知客户端应用程序客户端应用程序需要清除/更新应用程序的缓存。 您将使用 CDC 进行 ETL 处理。

当您的 OLTP 应用程序需要立即收到有关数据库中的数据更改的通知时,DCN 通常更适合。 由于此处的目标是最大限度地减少网络往返次数和数据库命中次数,因此您通常希望应用程序使用 DCN 来进行大部分静态的查询。 如果查询的很大一部分定期更改,则最好按设定的频率刷新应用程序的缓存,而不是不断运行查询来获取更改的数据(DCN 不包含更改的数据,只包含行的 ROWID) (s) 已更改)。 如果应用程序出现故障,我相信 DCN 允许更改丢失。

当您的 DSS 应用程序需要定期提取多个表中更改的所有数据时,CDC 通常会更好。 CDC 可以保证订阅者已收到对基础表的每个更改,如果您尝试将更改复制到不同的数据库,这一点可能很重要。 CDC 允许订阅者在方便时拉取更改,而不是尝试通知订阅者有更改,因此如果您希望订阅者每小时或每天处理新数据而不是近乎实时,那么您肯定需要 CDC 。 (注意:DCN 也有保证交付模式,请参阅下面的评论。--Mark Harrison)

In general, you would use DCN to notify a client application that the client application needs to clear/ update the application's cache. You would use CDC for ETL processing.

DCN would generally be preferable when you have an OLTP application that needs to be notified immediately about data changes in the database. Since the goal here is to minimize the number of network round-trips and the number of database hits, you'd generally want the application to use DCN for queries which either are mostly static. If a large fraction of the query is changing regularly, you may be better off just refreshing the application's cache on a set frequency rather than running queries constantly to get the changed data (DCN does not contain the changed data, just the ROWID of the row(s) that changed). If the application goes down, I believe DCN allows changes to be lost.

CDC would generally be preferable when you have a DSS application that needs to periodically pull over all the data that changed in a number of tables. CDC can guarantee that the subscriber has received every change to the underlying table(s) which can be important if you are trying to replicate changes to a different database . CDC allows the subscriber to pull the changes at its convenience rather than trying to notify the subscriber that there are changes, so you'd definitely want CDC if you wanted the subscriber to process new data every hour or every day rather than in near real time. (note: DCN also has a guaranteed delivery mode, see comments below. --Mark Harrison)

对你的占有欲 2024-07-14 23:16:50

CDC 的设置似乎比 DCN 复杂得多。

我的意思是要设置 DCN,我将选择包装在开始和结束 DCN 块中,然后编写一个要通过一组更改来调用的过程。 就是这样。

CDC 需要发布者和订阅者,无论如何,这似乎是更多的工作。

CDC seems to be much more complex to set up than DCN.

I mean to setup DCN I wrap a select in a start and end DCN block and then write a procedure to be called with a collect of changes. That's it.

CDC requires publishers and subscribers and anyways, seems like more work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文