Skip to content

upworthy/datomic-peer-svc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Datomic Peer Buildpack

Datomic Peer Buildpack installs Datomic REST service bound to localhost:${DATOMIC_REST_PORT:-8777} running as a daemon on the same dyno as the app. This is useful for non-JVM Heroku apps that wish to use Datomic.

Naturally, the app and the datomic peer (REST service) will compete for resources of a dyno. The buildpack addresses that by restricting memory resources dedicated to Datomic REST service based on Heroku dyno size.

Add this buildpack to your APP like so:

heroku buildpacks:add https://github.com/upworthy/datomic-peer-svc.git -a APP

Ensure your app has Datomic-related configuration, mutatis mutandis:

heroku config:set -a APP \
  DATOMIC_TECH_CONTACT=you@example.com \
  DATOMIC_DOWNLOAD_KEY=secret \
  DATOMIC_VERSION=0.9.5302 \
  DATOMIC_STORAGE_SPECS="alias1 datomic:ddb://<YOUR-AWS-REGION>/<YOUR-STORAGE-TABLE>/"

You may specify more than one Datomic storage using the command line syntax of Datomic's bin/console program: DATOMIC_STORAGE_SPECS="alias1 uri1 alias2 uri2 ..."

For example: DATOMIC_STORAGE_SPECS="db1 datomic:ddb://us-east-1/abc db2 datomic:ddb://us-west-2/xyz"

Datomic Peer Service

Datomic Peer Service allows you to run Datomic Console or REST API as a Heroku app. It consists of two components:

  • oauth2_proxy, a proxy that ensures only authorized Google-authenticated users may access your Datomic infrastructure (aka OA2P).
  • Datomic Console, a graphical UI that makes it easy to work with Datomic databases. It provides tools for exploring schema, building and executing queries, examining transactions and more.

Deploy

Dynamo DB Storage

You must specify AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY credentials of an AWS IAM user with the following statement among its policies:

{
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "dynamodb:GetItem",
                "dynamodb:BatchGetItem",
                "dynamodb:Scan",
                "dynamodb:Query"
            ],
            "Resource": "arn:aws:dynamodb:*:<YOUR-AWS-ACCOUNT>:table/<YOUR-STORAGE-TABLE>"
        }
    ]
}

Limitations

So far only Dynamo DB storage had been tested/used by the author.

About

Datomic Peer Buildpack & Service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages