mongodb

How to mix mongodb and a traditional db in Rails?

I am considering using MongoDB (mongo-mapper) for a portion of my rails application. I am not ready to go whole hog MongoDB because there are too many useful gems that depend on a traditional DB. That being said there are parts of my application that would be great to leverage a document database. Has anyone had success mixing the two...

What can slow down CRUD in MongoDB?

What makes a bad schema design? What are the other DONT's? ...

MongoDB, after redefining the class, Mongo ignores the insert or any action against that class

Guys, Have you ever been in this situation? Say, you define a class Student, and use it to store data into MongoDB Later, you modify the class Student and want to store data into MongoDB and then notice Mongo doesn’t actually insert the data. Has anyone know the reason why? It is not a radical change to the class, instead only adding ...

Is an ORM redundant with a NoSQL API?

Hello, with MongoDB (and I assume other NoSQL database APIs worth their salt) the ways of querying the database are much more simplistic than SQL. There is no tedious SQL queries to generate and such. For instance take this from mongodb-csharp: using MongoDB.Driver; Mongo db = new Mongo(); db.Connect(); //Connect to localhost on the d...

Dynamic attributes with Rails and Mongoid

Hello, I'm learning MongoDB through the Mongoid Ruby gem with Rails (Rails 3 beta 3), and I'm trying to come up with a way to create dynamic attributes on a model based on fields from another model, which I thought a schema-less database would be a good choice for. So for example, I'd have the models: class Account include Mongoid::...

Using a '.' in your key name in MongoDB (PyMongo)

When I try saving a dict with a '.' in the key PyMongo throws an error (InvaildName) however I do see (on the Mongodb website) that keys can have '.''s in them. Why is it that pymongo won't let me save these docs? Is there an issue with them and Mongo? James ...

Squid logs on mongodb

Hi, I'm planning to log my squid instances to a mongodb, but the actual problem is that we have a huge traffic to be logged, every access authenticated with user/pass. Eventually we have to make some reports based on logs. I was thinking to insert the logs distributed by months and by users, so my collection will look like this: {month:...

Two Phase Commit with MongoDB

Heres what Im thinking. Do you see any issues with this workaround to emulate 2 phase commit when using something like MongoDB where each operation is atomic and there is no support for transactions outside of that? transaction_scope: read message from servicebus - UpdateCustomerAddress get customer aggregate from docdb, repl...

How do you store keys in Mongodb with a '.' in them.

I need to have key fields with a '.' in them. Is there a way to do it? (I am unable to encode them) ...

How can I use mongodb with linq for store large binary objects(files)?

I know two most popular C# drivers for mongodb, this are mongodb-csharp and NoRM. Both of them have some problems. For example, with mongodb-csharp I can't use full functional linq and with NoRM I can't store large file in mongodb. In my project, I need to use linq with large objects (files). ...

Clojure and NoSQL databases

I am currently trying to pick between different NoSQL databases for my project. The project is being written in clojure and javascript. I am currently looking at three candidates for storage. What are the relative strengths and weaknesses of MongoDB, FleetDB and CouchDB? Which one is better supported in Clojure? Which one is better suppo...

What is the most mature MongoDB driver for C#?

So, there are mongodb-csharp simple-mongodb NoRM as C# drivers for MongoDB available. Which one of them is the most mature and stable one? Why would you choose one over the other two? Are they production ready? ...

Which Python API should be used with Mongo DB and Django

I have been going back and forth over which Python API to use when interacting with Mongo. I did a quick survey of the landscape and identified three leading candidates. PyMongo MongoEngine Ming If you were designing a new content-heavy website using the django framework, what API would you choose and why? MongoEngine looks like i...

Running mongod as a windows service

Hello, i have installed mongodb on win32 and i am trying to run it as a service. I have followed the instructions posted here: http://www.deltasdevelopers.com/post/Running-MongoDB-as-a-Windows-Service.aspx but when when windows tries to 'load'/'run' the service there is a problem. I see the service under the services control banner co...

Problem with MongoDB Ruby Driver

I'm on Ubuntu, and I've done install gem mongo which reported Successfully installed bson-1.0 Successfully installed mongo-1.0 2 gems installed I've started mongod Now I cd to the mongo gem directory and try > ruby examples/simple.rb and I get the error ./examples/../lib/mongo.rb:31:in `require': no such file to load -- bson (...

Why Document DB ( like mongodb and couchdb ) are better for large amount of data ?

I am very newbie to this world of document db. So... why this db are better than RDBMS ( like mysql or postgresql ) for very large amount of data ? ...

How to "defragment" MongoDB index effectively in production?

I've been looking at MongoDB. Feels good. I added some indexes to a collection, uploaded a bunch of data, then removed all the data, and I noticed the indexes did not change size, similar to the behavior reported here. If I call db.repairDatabase() the indexes are then squashed to near-zero. Similarly if I don't remove all the d...

What is the recommended approach towards multi-tenant databases in MongoDB?

I'm thinking of creating a multi-tenant app using MongoDB. I don't have any guesses in terms of how many tenants I'd have yet, but I would like to be able to scale into the thousands. I can think of three strategies: All tenants in the same collection, using tenant-specific fields for security 1 Collection per tenant in a single share...

Removing an object in a child collection in MongoDB

I've got a collection of content. Said collection has a collection of responses as such Content : [{ 'id' : '1234', 'Responses' : [{ 'id' : '12345' } etc. Now, I want to remove response 12345, but I don't want to remove all of the responses. I can't seem to find the command to do so. I'm getting the impression that th...

MongoDB Embedded Documents / Documents with Rails

Hello all, I've recently begun playing around with MongoDB on Rails through use of the MongoMapper gem. I was wondering if there is some sort of way to have a class/object/collection be both a Document as well as an Embedded Document. I want the same entity to be both included/embedded in other documents, and also be able to exist on i...