Better HN
topnewbestaskshowjobs
Log inSign up

refset

1,514 karma · joined Aug 24, 2015 (11y ago) · 537 submissions

https://github.com/refset

[ my public key: https://keybase.io/refset; my proof: https://keybase.io/refset/sigs/pyTK0thu8g5O4Zs7EA3HrQYKkYZjeEz_TUr8nZV2hlY ] c0ba44896414421c9009bc8a77a86ceb

meet.hn/city/51.0612766,-1.3131692/Winchester

Socials: - github.com/refset

---

Submissions

comment 3y ago · link · parent

"retroactive events" is probably the thing to look for, e.g. https://www.infoq.com/news/2018/02/retroactive-future-event-...

comment 3y ago · link · parent

Exactly, the n+1 problem is really about query optimization, latency just makes it more pronounced.

comment 3y ago · link · parent

I really like Kent Beck's recent re-framing of this overly technical topic in terms of "Eventual Business Consistency": https://tidyfirst.substack.com/p/eventual-business-consisten...

> In a nutshell, we want what’s recorded in the system to match the real world. We know this is impossible (delays, mistakes, changes) but are getting as close as we can. The promise is that if what’s in the system matches the real world as closely as possible, costs go down, customer satisfaction goes up, & we are able to scale further faster.

comment 3y ago · link · parent

A lot of "feature store" systems seem to make the case for time travel these days, e.g. https://docs.featurebase.com/docs/concepts/time-quantums/

comment 3y ago · link · parent

I believe people interested in the latter are almost always interested in the former also, at least in the context of transactional systems (and particularly anything subject to complex regulatory requirements).

Analytical systems are a different world where time seems to often be regarded as "just another dimension", but strong consistency and auditability are increasingly relevant there too, which is also a natural reflection of how a lot of modern OLAP systems operate internally using immutable snapshots of blob storage (see Snowflake, Iceberg, LakeFS etc.).

I know there are definitely lots of potential tricks for making better use of a first-class understanding of time in analytics though, and not just treating it the same as other dimensions, e.g. https://duckdb.org/2023/09/15/asof-joins-fuzzy-temporal-look... and https://materialize.com/blog/temporal-filters/

comment 3y ago · link · parent

Agreed, this is accurate. I work on XTDB and was able to speak with Richard Snodgrass (author of the paper) a couple of years ago. During our conversation we discussed how his research was primarily focused on handling valid-time, with transaction-time (a.k.a. system-time per SQL:2011) as a secondary concern. In contrast XTDB was inspired by the functional programming / immutability / database-as-a-value vision behind Datomic but with a desire for something more powerful than just the transaction-time capabilities. Essentially we arrived at 'bitemporal' from the opposite direction. This blog post covers the perspective somewhat: https://vvvvalvalval.github.io/posts/2017-07-08-Datomic-this...

comment 3y ago · link · parent

The readme mentions a dependency on Bouncy Castle - note that BC already contains several Java-based PQC signature schemes, see https://doc.primekey.com/bouncycastle/interoperability#Inter... and https://github.com/bcgit/bc-java

comment 3y ago · link · parent

> defining the rules of suduko [...] in SQL

Two rather distinct solutions:

https://www.sqlite.org/lang_with.html#outlandish_recursive_q...

http://conway.rutgers.edu/~ccshan/wiki/blog/posts/Sudoku_in_...

comment 3y ago · link · parent

A shame indeed, they were only a few decades too early! The support for "Time Varying Data" gets discussed briefly in this 1995 paper by Stonebraker "The Design of Postgres"

> POSTQUEL allows users to save and query historical data and versions. By default, data in a relation is never deleted or updated. Conventional retrievals always access the current tuples in the relation. Historical data can be accessed by indicating the desired time when defining a tuple variable.

> [...] Finally, POSTGRES provides support for versions. A version can be created from a relation or a snapshot. Updates to a version do not modify the underlying relation and updates to the underlying relation will be visible through the version unless the value has been modified in the version.

https://dsf.berkeley.edu/papers/ERL-M85-95.pdf

comment 3y ago · link · parent

Expanding on the the above,

> The original version of PostgreSQL from the 1980s did not remove dead tuples. The idea was that keeping all the older versions allowed applications to execute “time-travel” queries to examine the database at a particular point in time [via https://ottertune.com/blog/the-part-of-postgresql-we-hate-th...]

Postgres deprecated support for time-travel in ~1997 and the more general notion of "system time" wasn't standardised until SQL:2011. This blog post is a good overview on the SQL:2011 spec + adoption in databases of (bi-)temporal versioning: https://illuminatedcomputing.com/posts/2019/08/sql2011-surve...

Temporal versioning is less sophisticated than git-like versioning (no branching etc.) but is usually more aligned with common end-user requirements. Kent Beck suggests this framing of "eventual business consistency": https://tidyfirst.substack.com/p/eventual-business-consisten...

comment 3y ago · link · parent

> there is an unsolved elephant in the room: It doesn't cover schema changes.

100% agreed. It's remarkable how Datomic also arrived on the scene in the same era (2012) but actually managed to solve a lot of these hard issues of immutable versioning + schema evolution via a clean EAV-based information model and an emphasis on accrete-only schema changes.

I'm a big fan of your work by the way :)

comment 3y ago · link · parent

Thanks for clarifying.

> Compacted topics are typically not used in high-throughput workloads

TIL, but it makes sense. Compaction/retention policies certainly introduce a lot of extra tradeoffs dimensions.

comment 3y ago · link · parent

Temporal tables, most likely. Although even SQL Server only supports system time versioning, not full bitemporal tables (as per the spec).

comment 3y ago · link · parent

This is a really interesting design - kudos.

> Compacting the data may sound expensive, but in practice it's highly efficient since it only needs to happen once

Is there any handling for tombstone records?

comment 3y ago · link · parent

Almost certainly https://prezi.com/

comment 3y ago · link · parent

I'm extremely keen to see what the SQL<->Elm experience might be (assuming something like that is part of the deal too). Simplifying how we interact with databases is arguably even more important/$valuable than simplifying UIs.

comment 3y ago · link · parent

Fwiw my colleague is the author of https://github.com/wotbrew/relic and he started working on Incremental View Maintenance ~purely because he wants to build a simpler rogue-like :)

comment 3y ago · link · parent

Very true, although the digital-ness of computers isn't holding anything back at this point, now that storage is ~infinite and the virtues of immutability are widely recognised.

comment 3y ago · link · parent

I have been reading The Dream Machine by Waldrop recently (great book!) that discusses Bush's pivotal role in the development of computing...which has a remarkable irony:

> Doggedly, and without success, [Bush] kept on trying to come up with a workable analog design for his Memex until his death, in 1973. And until the end, his colleagues could hear him grumbling about the "damn digital computer."

comment 3y ago · link · parent

The linked sibling post on "New Truffle and GraalVM Languages release" feels rather exciting too https://medium.com/graalvm/new-truffle-and-graalvm-languages...

Specifically:

> GraalVM language runtimes (for JavaScript, Python, Ruby, Java on Truffle, WebAssembly, and LLVM) can now be [...] installed as Maven/Gradle dependencies [...] which will work for GraalVM JDK and any other compatible JDK

Polyglot experimentation just got a whole lot easier! Kudos to everyone involved in pushing the JVM ecosystem forwards.

321.

A Primer on Logic Programming(juxt.pro ↗)

117 points · by refset · 3y ago · 7 comments

comment 3y ago · link · parent

Okay so on the Postgres question this mailing list thread is interesting: https://www.postgresql.org/message-id/8181205c-69e5-bde7-15e...

I am no expert on Postgres but the thread seems to suggest the default out-of-the-box JIT performance is actually more efficient than a custom vectorized executor that was built for the PoC. That probably rules out any low-hanging optimizations based purely on vectorization for OLTP specifically, but there are undoubtedly many wider ideas that could in principle be adopted to bring OLTP performance in line with a state-of-the-art research database like Umbra (memory-first design, low-latency query compilation, adaptive execution etc.). As usual with databases though, if the cost estimation is off and your query plan sucks, then worrying about fine-tuning the peak performance is ~irrelevant.

comment 3y ago · link · parent

> Isn't Arrow biased towards analytics workloads? Like sibling commenter brings up, I'm not sure what that brings to the table for OLTP.

That's right, I was thinking more about the network effects, not performance - see my other reply: https://news.ycombinator.com/item?id=37432563

> So "insert quickly then let me analyze later" is becoming a highly polished stone, but I think databases still present a very rough demeanour around transactional workloads and the "hip tools" out there reflect that.

> I'm personally all for supplanting SQL but only if what replaces it has a sound relational basis.

100% agreed. I think the status quo UX is far more rough than the performance. Unfortunately it seems performance is what drives most investment these days unless you are a producer of hip tools.

> As for the Alice book, it's great, but it's quite focused on Datalog

True, although I posted more for the tour of Relational Algebra fundamentals. I guess the SQL section is probably the most out of date part of the book :)

comment 3y ago · link · parent

I agree Arrow by itself doesn't address any novel/fundamental OLTP challenges, but I'm not arguing that the thing which eventually supplants Postgres will succeed because of best-in-class OLTP performance - anyone needing that today is not choosing Postgres anyway (same as ever).

The real proposition is having a modern, general purpose workhorse underpinned by an ecosystem with strong network effects and polyglot APIs. Assuming analytical systems continue to gravitate towards Arrow I believe the OLTP world will be dragged along also.

comment 3y ago · link · parent

> it's a bit difficult to wrap my mind around how Arrow will help in distributed systems

Comparing with the role of Protobuf is perhaps easiest, there's a good FAQ entry [0] which concludes: "Arrow and Protobuf complement each other well. For example, Arrow Flight uses gRPC and Protobuf to serialize its commands, while data is serialized using the binary Arrow IPC protocol".

This will be increasingly significant due to the hardware trends in network & memory (and ultimately storage too) compared with CPUs. I posted about that in a comment a few days ago [1], but it's worth sharing again:

> here’s a chart comparing the throughputs of typical memory, I/O and networking technologies used in servers in 2020 against those technologies in 2023

> Everything got faster, but the relative ratios also completely flipped

> memory located remotely across a network link can now be accessed with no penalty in throughput

The graphs demonstrate it very clearly: https://blog.enfabrica.net/the-next-step-in-high-performance...

> would be great to read a bit more about some optimizations that would help improving Postgres leaving out pure analytical use cases

Unfortunately I don't have a good reference on that to hand but I'll take a look around and reply again soon.

[0] https://arrow.apache.org/faq/#how-does-arrow-relate-to-proto...

[1] https://news.ycombinator.com/item?id=37365816

[2] https://www.singlestore.com/comparisons/postgresql/

comment 3y ago · link · parent

I meant that mostly in jest, but in reality the pace of both database research and commercial development is happening faster than ever, so an explanation of "How Query Engines Work" is a moving target. Join algorithms and join planning are especially hot topics with a lot of excitement based on advances in machine learning.

comment 3y ago · link · parent

Another Postgres-based project in this vein that makes use of Apache Arrow: https://heterodb.github.io/pg-strom/

> PG-Strom is an extension module of PostgreSQL designed for version 11 or later. By utilization of GPU (Graphic Processor Unit) device which has thousands cores per chip, it enables to accelerate SQL workloads for data analytics or batch processing to big data set.

> PG-Strom has two storage options. The first one is the heap storage system of PostgreSQL. It is not always optimal for aggregation / analysis workloads because of its row data format, on the other hands, it has an advantage to run aggregation workloads without data transfer from the transactional database. The other one is Apache Arrow files, that have structured columnar format. Even though it is not suitable for update per row basis, it enables to import large amount of data efficiently, and efficiently search / aggregate the data through foreign data wrapper (FDW).

comment 3y ago · link · parent

Polyglot means not having to fight with marshaling overheads when integrating bespoke compute functions into SQL, or when producing input to / consuming the output from queries. This could radically change the way in which non-expert people construct complex queries and efficiently push more logic into the database layer, and open the door to bypassing SQL as the main interface to the DBMS altogether.

Vector processing means improved mechanical sympathy. Even for OLTP the row-at-a-time execution model of Postgres is leaving a decent chunk of performance on the table because it doesn't align with how CPU & memory architectures have evolved.

comment 3y ago · link · parent

> KQuery does not yet implement the join operator.

Whilst I applaud this book writing initiative, completing it could easily become a lifetime's work! It will be a fascinating journey to follow along with in any case.

Apache Arrow could (and hopefully will) really shake up the database industry in the years ahead. Whatever eventually supplants Postgres is quite likely going to be based on Arrow - polyglot zero-copy vector processing is the future.

Aside: for anyone looking for a more theoretical overview of databases and query languages, this ~free Foundations of Databases book still holds up well http://webdam.inria.fr/Alice/

comment 3y ago · link · parent

> How can I import `tsv` and/or n-triplets file into v2 XTDB so I can run a couple of queries on WatDiv ?

I can't offer easy instructions for that right now as we've not adapted the benchmark for the 2.x branch yet (and I would not expect performance to match 1.x right now anyway), although all the code one might need is in the repo for 1.x already and should be straightforward enough to convert to the new APIs given some familiarity with Clojure: https://github.com/xtdb/xtdb/blob/master/bench/src/xtdb/benc...

> Was it Datomic that played a pioneering role in this shift ?

I know Datomic has inspired a lot of people - certainly our entire team - but I'm not sure how much it's influenced the existence of things like Cozo or the wider database ecosystem. I get the feeling that Datomic's impact on application developer communities and library builders has been far greater (also amplified further by DataScript) than the impact on established database vendors & research communities. It has at least been good to see more systems start treating data immutably and exposing time-travel capabilities, even if Datomic was merely ahead of the curve rather than a direct inspiration.

> They are forcing users to create queries and data models through the cumbersome process of breaking down and building n-ary relations from triplets. I believe that the remedy lies in developing robust transformation functions capable of handling input and output across triplets, tabular, or nested data structures.

Despite originally being attracted to triple-oriented modeling I have come around to agreeing with this point of view. Processing with n-ary relations is unavoidable so the idea of not persisting them also feels inherently limiting. I am also quite drawn to "Object Role Modeling" (though I've not yet applied it in anger) which really demands n-ary tuples, and the RelationalAI folks seem to have reached a similar conclusion: https://docs.relational.ai/rel/concepts/relational-knowledge...

> in my opinion, the ideal solution to the DBMS-database challenge resides at the application level and within the realm of database modeling

I generally agree with this too. All I know for certain is that almost everything in software should be more relational and declarative, and then machine learning stands the best chance of figuring out how to make things fast.

Good discussion :)

1
101112
18