7

I installed node.js on my Raspberry Pi. But now I'm wondering what database I should use for it.

I'd like it to be an easy solution. The easier to work with / fast installation / the better.

I saw a lot of people like sqlite, but they mostly use it with Python. Also, I'm a bit iffy on using a SQL database. I'd like something easier to work with especially saving/loading JavaScript objects, perhaps NoSQL. But I noticed that NoSQL solutions like mongodb are a bit hard to use with Raspberry Pi since I need to compile it, etc.

So, what database would you recommend for RaspberryPi + Node.js ?

elixenide
  • 210
  • 1
  • 5
  • 9
foreyez
  • 173
  • 1
  • 1
  • 6

4 Answers4

9

Unless you have a need for many concurrent users or processes writing to the database at the same time I would recommend sqlite. It is file based so you don't need a server running, and each project can use its own database file (unless they need to share data). If you use a database abstraction layer you can move to mysql or postgres without too much trouble in the future.

And, as a bonus, doing a backup is a simple file copy.

Craig
  • 3,014
  • 14
  • 15
2

I'm actually using OrientDB together with node in my raspberry pi. www.orientdb.org

Installation wise, its just a simple wget from the site downloads page and then launching ./bin/server.sh

They even have a useful webadmin tool at yoururl:2480 by default.

It's NOSQL too and so far my experience of it is like having a database of JS objects that are linked together in a graph network. Best thing is I can use good old SQL queries to retrieve all the JS objects I want, those are linked to them, etc etc.

unclelim12
  • 175
  • 5
1

Better late than never, when trying to figure out an answer for the same question myself I found this https://github.com/louischatriot/nedb - pure Node.js database, will run on every Node (I hope) and it's NoSQL.

0

What project are you trying to do? The database should be selected with the project in mind. I've run MySql paired with memcached with great results.

vlad b.
  • 262
  • 2
  • 9