Introduction to Datalog

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • logica

    Logica is a logic programming language that compiles to SQL. It runs on Google BigQuery, PostgreSQL and SQLite.

  • > I guess the intention is to be better than SQL but then I was left with "under which circumstances?"

    Excellent question.

    Two of the most common use cases for databases are "transactional processing" (manipulating small numbers of rows in real time) and "analytical processing" (querying enormous numbers of rows, typically in a read-only fashion).

    SQL is generally fine for transactional workloads.

    But analytical queries sometimes involve multi-page queries, with lots of JOINs and CTEs. And these queries are often automatically generated.

    And once you start writing actual multi-page "programs" in SQL, you may decide that it's a fairly clunky and miserable programming language. What Datalog typically buys you is a way to cleanly decompose large queries into "subroutines." And it offers a simpler syntax for many kinds of complex JOINs.

    Unfortunately, there isn't really a standard dialect of Datalog, or even a particular dialect with mainstream traction. So choosing Datalog is a bit of a tradeoff: does it buy you enough, for your use case, that it's worth being a bit outside the mainstream? Maybe! But I'd love to see something like Logica gain more traction: https://logica.dev/

  • souffle

    Soufflé is a variant of Datalog for tool designers crafting analyses in Horn clauses. Soufflé synthesizes a native parallel C++ program from a logic specification.

  • It's true that this SPARQL-inspired view of Datalog as a triplestore query language is quite a narrow interpretation compared to something closer to the academic Prolog roots like https://souffle-lang.github.io/ - what do you feel are the most important differences?

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • datascript

    Immutable database and Datalog query engine for Clojure, ClojureScript and JS

  • xtdb

    An immutable database for application development and time-travel data compliance, with SQL and XTQL. Developed by @juxt

  • pyDatalog

    a datalog implementation in Python

  • https://github.com/pcarbonn/pyDatalog ; and it is apparently superseded by IDP-Z3: https://gitlab.com/krr/IDP-Z3/

    From https://twitter.com/westurner/status/1000516851984723968 :

    > A feature comparison of SQL w/ EAV, SPARQL/SPARUL, Gremlin, GraphQL, and Datalog would be a useful resource for evaluating graph query languages.

    > I'd probably use unstructured text search to identify the relevant resources first.

  • IDP-Z3

  • https://github.com/pcarbonn/pyDatalog ; and it is apparently superseded by IDP-Z3: https://gitlab.com/krr/IDP-Z3/

    From https://twitter.com/westurner/status/1000516851984723968 :

    > A feature comparison of SQL w/ EAV, SPARQL/SPARUL, Gremlin, GraphQL, and Datalog would be a useful resource for evaluating graph query languages.

    > I'd probably use unstructured text search to identify the relevant resources first.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts