---
description: >-
  A beginning friendly space for getting started with datahike and datascript
  from clojure.
---

# Welcome to Datahike Tuts

> **Disclaimer**\
> This guide is not going to be very formal and is being written as I learn so might not all have the best flow. I may circle back at some point and fix the flow. No promises though.

### Why?

I've wanted to use an immutable database powered by datalog for ages. Eventually I decided to do something about [it](https://twitter.com/alekcz/status/1285111415955697664).&#x20;

![How it all began](https://1725846247-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCl1SVElOPyxva9PltW%2F-MCl8vw-ax6m2YqARoho%2F-MCl9hbBgYCL3HOwjfyI%2Forigins.png?alt=media\&token=2bbf6452-19b8-4694-88bc-a4c8d41f190b)

### What we'll be using

* Clojure through [leiningen](https://leiningen.org/)&#x20;
* [Datahike](https://github.com/replikativ/datahike) by wonderful folks at [replikativ](https://replikativ.io/)
* The REPL

You can get started by cloning this [repo](https://github.com/alekcz/datahike-starter) I put together. It's nothing special. It just has all the dependencies, nothing special.

The most popular open source datalog engine for clojure is [tonksy/datascript](https://github.com/replikativ/datahike). It's been built from the ground up and is use quite extensively in [datahike](https://github.com/replikativ/datahike).&#x20;

### Understanding datalog

[@pithyless](https://twitter.com/pithyless) has a great video introducing datalog.&#x20;

{% embed url="https://www.youtube.com/watch?v=oo-7mN9WXTw" %}

### Now let's add the magic.&#x20;

Datahike is an immutable database powered by an efficient datalog query engine. It started out as as a port of [DataScript](https://github.com/tonsky/DataScript) to the [hitchhiker-tree](https://github.com/datacrypt-project/hitchhiker-tree).  But what is a hitchhiker tree?&#x20;

{% embed url="https://www.youtube.com/watch?v=jdn617M3-P4" %}

### Cheers

I think that's enough for today. I'll catch you on the morrow.&#x20;
