Popularity
1.1
Declining
Activity
4.9
-
2
1
0
Monthly Downloads: 14
Programming language: Haskell
License: BSD 3-clause "New" or "Revised" License
Latest version: v0.1.0
streamly-lmdb alternatives and similar packages
Based on the "Database" category.
Alternatively, view streamly-lmdb alternatives based on common mentions on social networks and blogs.
-
erd
Translates a plain text description of a relational database schema to a graphical entity-relationship diagram. -
persistent-redis
Persistence interface for Haskell allowing multiple storage methods. -
HDBC-session
This repository includes a joined query generator based on typefull relational algebra, and mapping tools between SQL values list and Haskell record type. -
acid-state
Add ACID guarantees to any serializable Haskell data structure -
squeal-postgresql
Squeal, a deep embedding of SQL in Haskell -
postgresql-simple
Mid-level client library for accessing PostgreSQL from Haskell -
esqueleto
Bare bones, type-safe EDSL for SQL queries on persistent backends. -
groundhog
This library maps datatypes to a relational model, in a way similar to what ORM libraries do in OOP. See the tutorial https://www.schoolofhaskell.com/user/lykahb/groundhog for introduction -
hw-kafka-client
Kafka client for Haskell, including auto-rebalancing consumers -
postgresql-simple-migration
PostgreSQL Schema Migrations for Haskell -
mysql-simple
A mid-level client library for the MySQL database, intended to be fast and easy to use. -
vcache-trie
large, persistent, memcached values and structure sharing for Haskell -
direct-sqlite
Low-level binding to SQLite3. Includes UTF8 and BLOB support. -
vcache
large, persistent, memcached values and structure sharing for Haskell -
haskelldb
A library for building re-usable and composable SQL queries. -
dbmigrations
A library for the creation, management, and installation of schema updates for relational databases. -
postgresql-tx
[Moved to: https://github.com/Simspace/postgresql-tx] -
postgresql-orm
An Haskell ORM (Object Relational Mapping) and migrations DSL for PostgreSQL. -
postgresql-typed
Haskell PostgreSQL library with compile-time type inference -
persistent-database-url
Parse DATABASE_URL into configuration types for Persistent -
ampersand
Build database applications faster than anyone else, and keep your data pollution free as a bonus.
Deliver Cleaner and Safer Code - Right in Your IDE of Choice!
SonarLint is a free and open source IDE extension that identifies and catches bugs and vulnerabilities as you code, directly in the IDE. Install from your favorite IDE marketplace today.
Promo
www.sonarlint.org
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of streamly-lmdb or a related project?
README
streamly-lmdb
Stream data to or from LMDB databases using the Haskell streamly library.
Requirements
Install LMDB on your system:
- Debian Linux:
sudo apt-get install liblmdb-dev
. - macOS:
brew install lmdb
.
Quick start
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Streamly.External.LMDB
(Limits (mapSize), WriteOptions (writeTransactionSize), defaultLimits,
defaultWriteOptions, getDatabase, openEnvironment, readLMDB,
tebibyte, writeLMDB)
import qualified Streamly.Prelude as S
main :: IO ()
main = do
-- Open an environment. There should already exist a file or
-- directory at the given path. (Empty for a new environment.)
env <- openEnvironment "/path/to/lmdb-database" $
defaultLimits { mapSize = tebibyte }
-- Get the main database.
-- Note: It is common practice with LMDB to create the database
-- once and reuse it for the remainder of the program’s execution.
db <- getDatabase env Nothing
-- Stream key-value pairs into the database.
let fold' = writeLMDB db defaultWriteOptions { writeTransactionSize = 1 }
let writeStream = S.fromList [("baz", "a"), ("foo", "b"), ("bar", "c")]
_ <- S.fold fold' writeStream
-- Stream key-value pairs out of the
-- database, printing them along the way.
-- Output:
-- ("bar","c")
-- ("baz","a")
-- ("foo","b")
let unfold' = readLMDB db
let readStream = S.unfold unfold' undefined
S.mapM_ print readStream
Benchmarks
See bench/README.md
. Summary (with rough figures from our machine†):
- Reading. For reading a fully cached LMDB database, this library (when
unsafeReadLMDB
is used instead ofreadLMDB
) has a 10 ns/pair overhead compared to plain HaskellIO
code, which has another 10 ns/pair overhead compared to C. (The first two being similar fulfills the promise of streamly and stream fusion.) We deduce that if your total workload per pair takes longer than 20 ns, your bottleneck will not be your usage of this library as opposed to C. - Writing. Writing with plain Haskell
IO
code and with this library is, respectively, 10% and 20% slower than writing with C. We have not dug further into these differences because this write performance is currently good enough for our purposes.
† Linode; Debian 10, Dedicated 32GB: 16 CPU, 640GB Storage, 32GB RAM.