A Scala meta-DSL to use the Datomic® database

Molecule

  • Typesafe Scala meta-DSL for Datomic On-Prem
  • Intuitively use your domain terms as query tokens
  • Sync/Async APIs
  • Model any RDBMS, Graph, Document, KV-store etc.
  • Datalog queries for Datomic built at compile time
  • (Molecule is not affiliated with Datomic)
  • Read more...

Datomic®

  • Datomic official website
  • Fully transactional, cloud-ready, distributed database
  • Elastic scaling
  • Built-in caching - extremely low latency
  • Built-in auditing - query entire history of data
  • ACID-compliant transactions
  • Flexible and sound data model

Setup

Define and compile your domain schema
trait Person {
  val name    = oneString
  val age     = oneInt
  val address = one[Address]
}
trait Address {
  val street = oneString
}
> cd yourProjectRoot
> sbt compile
Read more...

Application code

Transact data
Person.name.age.Address.street insert
  List(
    ("Lisa", 20, "Broadway"),
    ("John", 22, "Fifth Avenue")
  )
Query data
Person.name.age.Address.street.get ===
  List(
    ("Lisa", 20, "Broadway"),
    ("John", 22, "Fifth Avenue")
  )

Molecule ⟷ Datomic

Molecule talks to Datomic
Tx statements
    
    
    
    


  Datomic






Tx report
Datalog
Typed data

Write powerful Datomic queries in Scala with the words of your domain:

Try demo

  1. git clone https://github.com/scalamolecule/molecule-demo.git
  2. cd molecule-demo
  3. sbt compile
  4. Open in your IDE
  5. Run app - and build new molecules…

Read more