A DSL for My NoSQL Database
summary
Describes a small Scala DSL that models Aerospike NoSQL actions as an algebra plus interpreter: operations are represented as a monadic program that delays effects until interpretation. Implementation uses Cats and Shapeless to build type-safe enums of operations, then translates those operations to an asynchronous Aerospike client by interpreting into Future/IO; a demo shows recording a score and reading it back so persistence happens only when the program is run.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 1:26Referential Transparency
- 2:01Future[A]
- 2:15Monad 10
- 3:43Algebra and Interpreter
- 4:13Algebra (monadic)
- 4:44Operations case class Mark(name: String, value: Int)
- 5:28Interpreter: Natural Transformation
- 6:14Interpreter: Kleisli
- 8:15Run program
- 8:56Thank you!
related talks
36mData pipelines engineering made simple with Scala
30mPrograms as Values Pure Composable Database Access in Scala
44mWriting a Database in Scala.js
48mCompositional, Expressive, Performant Database Queries: Choose 3
32mBuilding a Real-time Ingestion Platform using Kafka and Aerospike
57mAlgebraic Databases
27mBringing SQL to Aerospike and the Enterprise – Tony Li
32mClojure is a Foreign Country: Combining Datomic with Scala
