Node.js module for MongoDB [closed] - mongodb

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
There are several MongoDB modules available for Node.js in the following link -
https://github.com/joyent/node/wiki/modules#wiki-db-nosql-mongo
Please, suggest me one (I'd like to know why you choose that one?).

It depends on what level of abstraction you want from your data. If you want something similar to an ORM, then Mongoose is the obvious choice and is popular.
However, the node-mongodb-native driver gives you clean duplication of almost the entire MongoDB API and since BSON is translated to JSON and JavaScript is a flexible dynamic language, there's really no need for an ORM. The latter does have benefits such a defining a schema which helps with validation and other tasks, but it also limits your flexibility.
Mongoskin is built atop node-mongodb-native but gives you the ability to have additional JavaScript method bindings and deal with connections and cursors easier. It's pretty lightweight, so you can stick with the basics or do more. This library is my personal preference and our team has built our own tooling and validation system around it.

Mongoose is a popular choice. But the documentation is just as bad (if not worse) than the MongoDB docs.

I personally prefer Mongolian, it's the closest thing you get to the Mongo shell and it's straight forward to use.
My fork adds very simple collection initialization.

Mongoose doesn't support bulk insert and it is schema-based. When you try to create different schemas for same collection, it throws exception. Consider carefully its suitability to your case before start with it.

Related

Which Scala framework for building a REST API with a Cassandra back-end would you suggest? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I want to build a REST API with a Cassandra backend in Scala but since there are many frameworks available and some have limitations for NoSQL databases, I'd like to know what would the better framework choices be.
You shouldn't use a framework for a simple REST API. Simply too large, too much overhead. But the most frameworks exported their JSON libraries:
Spray: https://github.com/spray/spray-json
Lift: https://github.com/lift/lift/tree/master/framework/lift-base/lift-json/
Play: https://www.playframework.com/documentation/2.0/ScalaJson
And lightweight http server:
spray: http://spray.io/documentation/1.2.3/spray-http/
scalatra: http://www.scalatra.org/
some have limitations for NoSQL databases
There are no limitations. You can simply use phantom in your framework or server: https://github.com/outworkers/phantom
The documentation is a bit "clean", but you can find here a nice example: https://github.com/iamthiago/cassandra-phantom
Do you need the API for internal use or as external API? If you use this API only as internal API, it's better to use another protocol like protobuf or Thrift instead of HTTP with JSON. Less overhead.
I like Lift as a flexible and powerful framework for web related stuff. There are a few nice helper tools for building HTTP api: http://simply.liftweb.net/index-Chapter-11.html
Lift comes with some ORM built-in, but you can skip them and use whatever database solution you wish. I personally used Lift both with MongoDB and the casbah driver, and PostgreSQL with Slick.

Is combining MongoDB with Neo4J a good practice? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I already have a .Net Web project running on MongoDB where I store some news/feed data.
After a while I needed a faster way to track "who shared what" and "how to find relationships depending on these information".
Then I came up with an idea to use graphDB to track related feeds and users.
Since the system is already running on MongoDB, I am thinking of leaving the data in Mongo and creating the graph representation in Neo4J for applying a graph search.
I do not want to migrate all my data to Neo4J because many people telling me MongoDB's I/O performance is way better than Neo4J and they also pointed out Sharding feature.
What would you suggest in this situation?
And If I follow my idea, will it be a good practice?
Personnally I think there are no unique answer and best practices. It is common usage to use polyglot persistence systems.
Now everything is based on your context and there are points we can't just reply for you :
How much time do you have (learning a new technology is not a matter of days until you can use it in production and sleep good )
How much money you can invest in the project , sharding is, AFAIK, a neo4j enterprise feature and licenses have a cost if you're not opensource or commercial company. Also hosting costs for Neo4j in cluster mode.
How much data ? As long as your graph can fit in memory, you'll not run I/O issues.
Now, away from these points, yes you can in a first instance trying to map neo4j on top of mongoDB.
Maybe try to do incremental migrations, and at then end of the process, maybe ask you the following questions, WHY do you need MongoDB to handle graph structures ?

are there cases where MongoDB is really not suited? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am sorry if this is not a constructive enough question.. Coming from the SQL world I'm just trying to wrap my head around this. After reading a lot about MongoDB, I've become very enthusiastic about it and consider using it for an upcoming application (in combination with Meteor).
However, I came across this blog post, which describes the troubles Diaspora ran into when using it and states "you should never use MongoDB". The examples she's giving sound pretty convincing.
Are these true problems with MongoDB, or were they using it wrong? Is this article now outdated and are there better ways for doing what they're doing (duplicate data for instance, like users being linked to each other, to posts and to comments, is a very common use case)?
Yes, there is a plenty of cases when mongodb not feet good, some of them are
When data perfectly described with 'table' metaphor (better using
SQL)
When you need ACID and transactions out of the box
When your workflow extremely oriented to write operation
When you need to generate complex cross-data reports
Data model have strongly relational view (a lot of connected
instances)
There is a lot of others, but this is just something which comes to my head fast.

Time to learn Cassandra/ MongoDB [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am going to start learning NOSQL databases (in practices, already done my researches and understood the concepts and modeling approaches).
I am working with time series data and both cassandra and mongodb are recommended for this use case.
I would like to know which one takes less time to learn? (Unfortunately, I don't have much time to spend on learning)
PS: I noticed that there are more tutorials and documentations with mongoDB (am I correct?)
Thank you!
Having used them both extensively, I can say that the learning curve isn't as bad as you might think. But as different people learn and absorb information at different rates, it is difficult to say which you will find easier or how quickly you will pick them up. I will mention that MongoDB has a reputation of being very developer-friendly, due to the fact that you can write code and store data without having to define a schema.
Cassandra has a little steeper learning curve (IMO). However that has been lessened due to the CQL table-based column families in recent versions, which help to bridge the understanding gap between Cassandra and a relational database. Since tutorials for MongoDB have been mentioned, I will post a link to DataStax's Academy, which offers a free online course you can take to introduce yourself to Cassandra. Specifically, the course DS220 deals with modeling your data.
With both, a key concept to understand is that you must break yourself of the relational database idea where you want to build your tables/collections to store your data most-efficiently. In non-relational data modeling you will want to model your tables/collections to reflect how you want to query your data, and this might mean using redundant data in some places.
qMongoFront is a qt based mongodb gui application under linux. It's free and opensouce. If you want to learn mongodb, qMongoFront is a good choice.
http://sourceforge.net/projects/qmongofront/

A good tool for building admin / content management interface over MongoDB? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I'm looking for a good tool (or library or a framework) that I could use to easily build basic content management functionalities over MongoDB.
I am very well aware of the Admin UIs listed in Mongo's website, and I'm already using RockMongo for query and some db admin tasks. The problem is that while I as a software developer can happily use these tools, they are too powerful and complex for the people who are responsible for managing the content in the database.
So I'm specifically looking for a MongoDB content-management tool with:
Ability to easily build (scaffold) user interface around collections (generated create, read, update and delete forms / views)
Ability to add data validation and some template or schema for objects, especially when new objects are created and added into a collection
Support for fine-grained access control (user groups, per collection and per object read/write/admin access)
I've been considering using django-nonrel for building one, but would like to get more opinions before going any further.
Since you're looking for a solution beyond a straight Admin UI, I expect you will have to roll your own. I went through a similar exercise a few months ago and ended up using Yii Framework (PHP).
The attributes you're looking for (scaffolding, validation, RBAC, ..) are common to many frameworks. Are there specific languages you would prefer/consider using? There are frameworks/libraries for Ruby, PHP, Python, etc. Many of these go to lengths to coerce MongoDB into an ActiveRecord/ORM pattern to enable use of CRUD and scaffolding. An emerging approach for working with NoSQL data sources is the DataMapper/ODM pattern, which is a much more comfortable fit compared to ORM.
Have a look at penguin: a module that automatically generates administration pages based on your Mongoose models.