ariaDB is a persistent key-value store written in Haskell. This work is done as a project in Functional Programming course.
- Abhilash Kumar (12014)
- Proneet Verma (12520)
- Saurav Kumar (12641)
- Key-Value store as a service exposing REST API
- Client library (for Haskell) to interact with the API
- Simple interface :
get
,put
anddelete
- B+ Tree indexing for fast access
- Caching layer to enhance look up of frequently accessed Key-Value pairs
- Type Safety (entire code in Haskell)
- Stores object of any type
- Concurrent access to the store (Warp)
import AriaDB
data Person = Person {
firstName :: String,
lastName :: String
} deriving (Show, Read, Eq)
foo = Person "John" "Doe"
main = do
let testKey = "k1"
put testKey foo
bar <- get testKey
case bar of
Just v -> print (v::Person) -- Type Assigned
Nothing -> print "Nothing"
baz <- get testKey
case baz of
Just v -> print $ v == foo -- Type Inferred
Nothing -> print "Value not found"
delete testKey
qux <- get testKey
case qux of
Just v -> print (v::Person) -- Type Assigned
Nothing -> print "Nothing"
To build and run AriaDB service (from project root):
$ cabal run
$ cabal run &
$ cd src/Test
$ runhaskell -i../Library GetPutDelete.hs
In order to benchmark, comment the non-relevant parts in src/Test/Benchmark.hs
$ ghc -O3 --make -isrc/Service src/Test/Benchmark.hs
$ ./src/Test/Benchmark