I'm designing a system where questions like "what was the sum of all records matching certain criteria, at a certain time" are important.
我正在设计一个系统,其中诸如“在某个时间符合某些标准的所有记录的总和是什么”这样的问题很重要。
Multi-value concurrency control (MVCC) seems like the way to go here, since it keeps an audit trail forever.
多值并发控制(MVCC)似乎是这里的方式,因为它永远保持审计跟踪。
However, it would be nice if the data storage could handle this for me, rather than cobbling it together out of other database features. Now, Oracle and CouchDB other database engines use MVCC, but only behind the scenes. They use it to resolve conflicts or to decide what to do when a long-running query encounters recently updated data. But I don't know of any systems that allow you to explicitly say "in the system state of 17:00 January 20 2009, what does this query return". So are there such systems out there? Ideally, open source?
但是,如果数据存储可以为我处理这个问题,而不是将其与其他数据库功能拼凑在一起,那就太好了。现在,Oracle和CouchDB等数据库引擎都使用MVCC,但仅限于幕后。他们使用它来解决冲突或决定在长时间运行的查询遇到最近更新的数据时该怎么做。但我不知道任何系统允许您明确说“在2009年1月20日17:00的系统状态下,此查询返回什么”。那么有这样的系统吗?理想情况下,开源?
2 个解决方案
#1
1
Take a look at flashback queries with Oracle.
看一下使用Oracle的闪回查询。
#2
1
As far as I know, MVCC doesn't guarantee the duration of earlier versions of rows. Its target is concurrency control for transactions; when all transactions for row 'x' have been committed, there's no real need for MVCC to keep earlier versions of that row.
据我所知,MVCC不保证早期版本行的持续时间。它的目标是对事务进行并发控制;当'x'行的所有事务都已提交时,MVCC不需要保留该行的早期版本。
You're thinking of Temporal Databases. Snodgrass's old book Developing Time-Oriented Database Applications in SQL is worth skimming, especially now that it's available as a PDF. If I had to do a temporal database from scratch again, I'd also read Temporal Data & the Relational Model, and anything else dealing with 6NF. (Where '6NF' <> 'DKNF'.)
你在想时间数据库。 Snodgrass的旧书在SQL中开发面向时间的数据库应用程序是值得略读的,特别是现在它可以作为PDF获得。如果我不得不再次从头开始编写临时数据库,我还会阅读时态数据和关系模型,以及处理6NF的任何其他内容。 ('6NF'<>'DKNF'。)
#1
1
Take a look at flashback queries with Oracle.
看一下使用Oracle的闪回查询。
#2
1
As far as I know, MVCC doesn't guarantee the duration of earlier versions of rows. Its target is concurrency control for transactions; when all transactions for row 'x' have been committed, there's no real need for MVCC to keep earlier versions of that row.
据我所知,MVCC不保证早期版本行的持续时间。它的目标是对事务进行并发控制;当'x'行的所有事务都已提交时,MVCC不需要保留该行的早期版本。
You're thinking of Temporal Databases. Snodgrass's old book Developing Time-Oriented Database Applications in SQL is worth skimming, especially now that it's available as a PDF. If I had to do a temporal database from scratch again, I'd also read Temporal Data & the Relational Model, and anything else dealing with 6NF. (Where '6NF' <> 'DKNF'.)
你在想时间数据库。 Snodgrass的旧书在SQL中开发面向时间的数据库应用程序是值得略读的,特别是现在它可以作为PDF获得。如果我不得不再次从头开始编写临时数据库,我还会阅读时态数据和关系模型,以及处理6NF的任何其他内容。 ('6NF'<>'DKNF'。)