11

There is a lot of databases, but I feel something different needed for Haskell. Like Erlang has it's own DB, Mnesia. Please recommend some good DBs for Haskell.

4 Answers 4

11

There are various frameworks for Haskell available, HDBC being the most popular.

HDBC is the database abstraction library, which allows you to use many popular databases, even Oracle or DB2. See Chapter 21. Using Databases in Real World Haskell.

2
7

I would advise you to choose the database depending on the type of data you want to store in it, rather than the language your system is implemented in.

Of course, this presupposes that bindings for the database exist in the language.

1
  • 2
    ...or you have the time to write bindings
    – Tim Perry
    Feb 14, 2011 at 18:41
7

Since the question mentions Mnesia, I'll mention Haskell's equivalent: AcidState. It's a fast and flexible nosql database written in Haskell that has support for representation of native and user-defined Haskell types (that link shows you some quick how-tos, including implementing a hello-world blog).

There's more recent documentation on their wiki, and I've personally used it here in the implementation of a small web app.

0

If you're using Postgres I would recommend Opaleye. Disclaimer: I'm biased because I wrote it!

2
  • This is not a DataBase but a DataBase library Mar 15, 2021 at 12:15
  • True, though most answers seem to have interpreted OP as asking for a library recommendation.
    – Tom Ellis
    Mar 21, 2021 at 8:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.