Thursday, September 6, 2012

REST API

I'm pleased to announce that, starting with version 0.8.3488, Datomic now offers a REST API.

There are a number of reasons to do this, first and foremost is that it will now be possible to access Datomic from non-JVM languages.

How does it work?

The command bin/rest will start up a peer which runs as a stand-alone HTTP server. You can access that service from any application using any language and any HTTP library. That's it!


This greatly enhances your architectural options:


Q&A


So, does this make Datomic client-server? 

Yes and no. First off, the 'servers' are themselves peers, so you still get elastic, configuration-free horizontal query scalability by simply starting/stopping more peers. Second, the Datomic model, which substantially mitigates the problems of client-server databases, is faithfully replicated for clients:

  • A peer service can serve more than one database, against more than one storage (Pro)
  • Clients get the same kind of data-driven API as do peers
  • Clients can get repeatable queries, and multiple queries with the same basis
  • Clients get the time-travel as-of and since capabilities, raw access to indexes and ranges
  • Clients can issue multi-datasource queries, and pass data to query
  • Clients can get a push feed of transaction events, via a Server-Sent Events source

Basically, it's just more options. Build full peers in a JVM language or lightweight clients in any language, or any combination.

Do these clients count towards my peer count? 

No. The clients do not run the Datomic peer library, and thus do not count. Each REST service process counts as a peer.

Does this work with Datomic Free? 

Yes it does.

What's the status of the API? 

It's still alpha, as we want to incorporate your feedback.

Are there client libraries for language _______?

Not yet. This is something we hope each language community will help us build.

Where can I get more details?

Check out the REST API docs


We hope you enjoy this new API and the capabilities it affords. As always, we welcome your feedback and input. If you've been on the sidelines waiting for Datomic to come to your favorite language - welcome!

4 comments :

  1. Awesome. I can't wait to try it from .NET. I've been hoping for something like datomic to come along ever since I started trying to track time varying facts in SQL server. But until now, there was no way we could use it at work...

    ReplyDelete
  2. Great to see a HTTP-based API, but would Roy Fielding call this RESTful? I think not. Does it matter? Probably not.

    ReplyDelete
  3. As Unknown said, this API has pretty much nothing to do with REST. Please call it "HTTP API" instead to avoid confusion. Words and their meaning matter!

    ReplyDelete
  4. Interesting thread here "Datomic and CQRS+ES" with some critique https://groups.google.com/forum/?fromgroups=#!topic/dddcqrs/qu4GHUpsFZI

    ReplyDelete