TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

MariaDB Temporal Data Tables

124 点作者 alecbenzer将近 5 年前

11 条评论

sjwright将近 5 年前
I&#x27;ve been begging for exactly this for quite some time. Because of the way I use databases, I&#x27;ve always been bewildered why this wasn&#x27;t a core part of SQL from the very beginning.<p>From what I&#x27;m reading there&#x27;s still a lot to be fleshed out to be maximally useful to me, but even in its current state I could imagine using this.<p>— I&#x27;d like to have a field property that limits stored values to a single version and thus is automatically cleared whenever the row is updated. This would be useful for inlining change annotations, and for associating a user_id to specific changes.<p>— I&#x27;d like to be able to arbitrarily select the n-1 value of fields regardless of their time period. E.g.<p><pre><code> select username, previous(username) from users </code></pre> — When viewing a specific version, I&#x27;d like to know whether a field&#x27;s value was supplied in that revision. That&#x27;s distinct from if the field was changed. I want to know if the value was supplied—even if it was identical to the previous value.<p>— This might be possible already (it&#x27;s hard to tell) but I&#x27;d like to be able to query&#x2F;join on any revision. For example I might want to ask the question &quot;show me all products that james has ever modified&quot;. That could then get more specific, e.g. &quot;show me all products where james changed the price&quot;.
评论 #23810758 未加载
评论 #23810956 未加载
docsapp_io将近 5 年前
I really hope Postgres can support temporal table out of the box. Temporal table can simplify development for the feature that need audits.
评论 #23810543 未加载
评论 #23810570 未加载
评论 #23812302 未加载
评论 #23810532 未加载
alecbenzer将近 5 年前
Had no idea until recently that MariaDB supported this out of the box. Does anyone have experience using this? How does it compare to <a href="https:&#x2F;&#x2F;github.com&#x2F;scalegenius&#x2F;pg_bitemporal" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;scalegenius&#x2F;pg_bitemporal</a> ?
amluto将近 5 年前
&gt; mysqldump does not read historical rows from versioned tables, and so historical data will not be backed up. Also, a restore of the timestamps would not be possible as they cannot be defined by an insert&#x2F;a user.<p>Given this caveat, this seems unusable for production systems.
评论 #23811862 未加载
评论 #23813552 未加载
shivekkhurana将近 5 年前
I’m very happy to see an open source dB which can do something similar to Datomic&#x2F;Crux, but is not tied to Clojure. It doesn’t seem as sophisticated but I hope this project grows.<p>For anyone wondering why temporality matters and how this is different from adding a “create_time” to each row, I would highly recommend watching Rich Hickey’s talk title, “Value of Values”
TekMol将近 5 年前
Is there a diff tool? Like show me all differences between now and 5 minutes ago?<p>Could be nice to see what magic goes on behind the scene in some applications.<p>For example when you do some clicks in the backend of WordPress and wonder what it actually did to the data.
crazygringo将近 5 年前
This is fascinating. I&#x27;ve got two basic questions, however:<p>1) Is this always going to be performant with indices? It seems like &quot;time&quot; is kind of like another index here, and when designing queries which indices are used and in which order can be the difference between taking milliseconds and taking an hour. It&#x27;s not obvious to me whether this will have hidden gotchas or query execution complexities, or if it&#x27;s designed in a way that&#x27;s so restricted and integrated into indices themselves that query performance will always remain within the same order of magnitude<p>2) What is the advantage of building this into the database, instead of adding your own timestamp columns e.g. &#x27;created_timestamp&#x27; and &#x27;expunged_timestamp&#x27;? Not only does that seem relatively simple, but it gives you the flexibility of creating indices across multiple columns (including them) for desired performance, the ability to work with tools like mysqldump, and it&#x27;s just conceptually simpler to understand the database. And if the question is data security, is there a real difference between a &quot;security layer&quot; that is built around the database, versus one built into it? It would be fairly simple to write a command-line tool to change the MariaDB data files directly, no?
评论 #23812038 未加载
评论 #23812572 未加载
评论 #23814494 未加载
polskibus将近 5 年前
How does this feature compare to MS SQL&#x27;s Temporal Tables <a href="https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;sql&#x2F;relational-databases&#x2F;tables&#x2F;temporal-tables?view=sql-server-ver15" rel="nofollow">https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;sql&#x2F;relational-databases&#x2F;ta...</a>?<p>This feature seems to be well fitted to support some of the cases where event sourcing is introduced, I wonder if someone successfully applied event sourcing with use of temporal tables to reduce the amount of work that has to be done in the application code (Akka, etc.).
评论 #23811830 未加载
Drdrdrq将近 5 年前
I understand the benefits of this feature for audits, but how does one deal with GDPR requirements? Is there some way to alter historic data to remove PII, or should the affected columns be excluded?
评论 #23810767 未加载
评论 #23812274 未加载
评论 #23811374 未加载
beckingz将近 5 年前
MariaDB continues to be great.<p>Now all they need is materialized views and they&#x27;ll be close to postgres.
Xlurker将近 5 年前
TimescaleDB competitor?
评论 #23812931 未加载