Showing posts with label NoSql. Show all posts
Showing posts with label NoSql. Show all posts

Monday, March 14, 2016

TypeError: require(...).connect is not a function

I recently had  a hard time trying to fix this issue.
I initially wrote these lines below to establish my connection:

var databaseUrl = "localhost/school";
var collections = ["student", "professor"]
var db = require("mongojs").connect(databaseUrl, collections);
var http = require("http");


Now it seems that since 1.x , mongojs no longer support the connect function,
instead we should replace the third line with:


var db = require("mongojs")(databaseUrl, collections);


Source: https://github.com/mafintosh/mongojs/issues/286


 

the default storage engine 'wiredtiger' is not available issue solved

I have created my data/db in the bin folder, for more about the installation watch this tutorial

Now to start mongod, instead of :

mongod --dbpath ./data/db

Do this instead:

mongod --storageEngine=mmapv1 --dbpath ./data/db

Hope it helps:



mongodb unclean shutdown detected

Are you having this error message : mongodb unclean shutdown detected ?
In my system I have my data/db under the bin folder
if you are using linux :

sudo rm /data/db/mongod.lock
sudo mongod --dbpath /data/db --repair
sudo mongod --storageEngine=mmapv1 --dbpath ./data/db
 
 
if you are using windows:
 
Go to your data/db directory:
1. delelte mongod.lock file
2. mongod --dbpath ./data/db --repair
3. mongod --storageEngine=mmapv1 --dbpath ./data/db 
 
More about the issue here 
 
 
 
 
 

Saturday, March 15, 2014

What is NoSql ?

No matter who you are I am sure that is has already happened one day you ask yourself this question: What is nosql ?  Asking many people out there  what they know about nosql, many of them will mention mostly one of the following terms: cassandra, mongoDb, couchDb, Hbase , something related to big data , to name only these few.
   In fact nosql does not mean that SQL is forbidden or that we should never use it rather nosql raises our attention to the fact that for certain problems other storage solutions are well suited. Therefore finish the era of one fit all, where for any problem at hand we had to automatically use a given version of sql database (mysql, oracle, sql server, etc...). In order to simplify our understanding some key points are going to  guide us and they are:

--Basic definitions:
 NOSQL is NOT ONLY SQL 
 NOSQL is not NO SQL
 NOSQL = next generation of databases
 NOSQL = modern web-scales databases
A NoSQL database provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases

-- Why NOSQL is used today ?
 -Size: unprecedented data growth
-Connectedness
-Semi-structure
-Architecture

-- Four (04) emerging NOSQL categories:
-Key-value
-Graph DB
-BigTable
-Document

a) Key-value:
   e.g: -Dynamo
          -Voldemort
          -Riak
         
b) Big Table:
  e.g: -HBase
         -Hyper Table
         -Cassandra
c) Document database:
   e.g: -CouchDB
          -MongoDB
          -IBM lotus

d) Graph database:
   e.g: -Neo4j
          -AllegroGraph
          -Sones graphDB
          -InfoGrid

--NoSQL is not  traditional database, how do I query it ?
  
1. RESTful interfaces using HTTP as an access API
2. Query languages other than SQL:
   - GQL: Google table
   -SPARQL: Semantic web
   -Gremlin: graph traversal language
3.Query APIs
  -Google BigTable datastore API
  -The Noo4j traversal API

--Who is successfully using NoSql ?
  -Facebook
  -Google
  -Yahoo
  -Twitter
  -GitHub
  -Linkedin
  - Maybe you who is reading this post right now (LOL !)

Coming to the end of this post, let me reaffirm again that I am not an expert on nosql but throughout this post I personally wanted to share with you my humble understanding of this promising technology that within a very short period has shown us what it is up to. In a case you have something too to share with us, please don't hesitate to drop a comment. If you are planning to get started with using Nosql I am sure that after reading this post nothing will be like before anymore and that you will confidently move on with your investigations on NoSql.

references:
1. http://www.slideshare.net/thobe/nosql-for-dummies
2. http://en.wikipedia.org/wiki/NoSQL