Your own query language

Person.name.age.Address.street

Your Data Model =>
Your Query Language

Molecule is a Scala eco-system to define your domain Data Model and use that as your query language.

Use your Data Model attributes to build molecules of data structures that you can transact and query against the powerful Datomic® database.

Model

trait Person {
  val name    = oneString
  val age     = oneInt
  val address = one[Address]
}
trait Address {
  val street = oneString
}

Transact

Person.name.age.Address.street insert
  List(
    ("Lisa", 20, "Broadway"),
    ("John", 24, "5th Avenue")
  )

Query

Person.name.age.Address.street.get ===
  List(
    ("Lisa", 20, "Broadway"),
    ("John", 24, "5th Avenue")
  )

Same molecules for multiple dbs

Transact and query your molecules uniformly against any of the three Datomic database systems: Peer, Peer-Server and Cloud.

Your molecules

Datomic
Peer

On-prem

Peer in application process

Datomic
Peer-Server

Remote Peer via http

Like traditional db server

Datomic
Cloud

Distributed AWS Cloud system

Testable with dev-Local

Molecule

  • Typesafe Scala meta-DSL for Datomic
  • 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
  • Automatic Query optimization
  • (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

Try demo

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

Read more