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 ?

  • 1
    What are you going to store in the database. – Craig Jun 21 '13 at 22:19
  • 1
    I'm going to be using this for multiple projects. I'm looking for a general solution. – foreyez Jun 21 '13 at 23:27
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.

  • thanks, I ended up going with sqlite since it appeared to be the easiest solution. note: sqlite3 nodejs drivers require node0.8.x so make sure you download these specific binaries for pi. – foreyez Jun 22 '13 at 4:28
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.

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.

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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