Using Datahike's Java API To Build a Web Application
There are good reasons for using a Datalog database like Datahike. First, it is simple. It is a very small, well-factored core codebase (< 5000 lines of code) of a few core concepts. This allows it to be flexibly recomposed and integrated with existing data sources in novel ways. Furthermore, it is more declarative than SQL by its roots in logic programming languages like Prolog, which provide first-class support for implicit binding by logic variables. Because of its support for recursion, it is also strictly more expressive than pure relational algebras such as those described by SQL. Compared to non-functional databases, Datahike provides coordination-free read scaling by automatically snapshotting all write operations. These snapshots can be read in parallel in each JVM runtime context of an arbitrary number of reading processes. It can also be audited at any point in time like git. Datahike requires only Java dependencies and can be used in-memory, with a simple file-based backend, with Redis for high throughput, with auto-scaling cloud infrastructure like AWS S3 and DynamoDB, or with all of these backends combined in one query context.