document-database

What are some good, fast persistent storage options for key->value data? [closed]

空扰寡人 提交于 2019-11-27 16:12:33
问题 For a small PHP app I am writing, we need to store a large number of records that have a hash key, and a few simple field values ('host', 'path'). eg: '4420ffb32a' => array( 'host' => '127.0.0.1', 'path' => 'path/to/resource', ); What is the best persistent storage for data like this? Would MySQL be the best choice, or is it overkill for such simple data? What would give the best performance? 回答1: Short answer: Membase. Long answer: You basically have three options: a relational database,

How to organise a many to many relationship in MongoDB

不想你离开。 提交于 2019-11-27 03:27:24
I have two tables/collections; Users and Groups. A user can be a member of any number of groups and a user can also be an owner of any number of groups. In a relational database I'd probably have a third table called UserGroups with a UserID column, a GroupID column and an IsOwner column. I'm using MongoDB and I'm sure there is a different approach for this kind of relationship in a document database. Should I embed the list of groups and groups-as-owner inside the Users table as two arrays of ObjectIDs? Should I also store the list of members and owners in the Groups table as two arrays,

Delete a key from a MongoDB document using Mongoose

社会主义新天地 提交于 2019-11-26 22:17:32
I'm using the Mongoose Library for accessing MongoDB with node.js Is there a way to remove a key from a document ? i.e. not just set the value to null, but remove it? User.findOne({}, function(err, user){ //correctly sets the key to null... but it's still present in the document user.key_to_delete = null; // doesn't seem to have any effect delete user.key_to_delete; user.save(); }); In early versions, you would have needed to drop down the node-mongodb-native driver. Each model has a collection object that contains all the methods that node-mongodb-native offers. So you can do the action in

Pros/cons of document-based databases vs. relational databases

十年热恋 提交于 2019-11-26 21:16:31
I've been trying to see if I can accomplish some requirements with a document based database, in this case CouchDB. Two generic requirements: CRUD of entities with some fields which have unique index on it ecommerce web app like eBay ( better description here ). And I'm begining to think that a Document-based database isn't the best choice to address these requirements. Furthermore, I can't imagine a use for a Document based database (maybe my imagination is too limited). Can you explain to me if I am asking pears from an elm when I try to use a Document oriented database for these

How to organise a many to many relationship in MongoDB

自闭症网瘾萝莉.ら 提交于 2019-11-26 10:30:48
问题 I have two tables/collections; Users and Groups. A user can be a member of any number of groups and a user can also be an owner of any number of groups. In a relational database I\'d probably have a third table called UserGroups with a UserID column, a GroupID column and an IsOwner column. I\'m using MongoDB and I\'m sure there is a different approach for this kind of relationship in a document database. Should I embed the list of groups and groups-as-owner inside the Users table as two

Delete a key from a MongoDB document using Mongoose

巧了我就是萌 提交于 2019-11-26 08:15:03
问题 I\'m using the Mongoose Library for accessing MongoDB with node.js Is there a way to remove a key from a document ? i.e. not just set the value to null, but remove it? User.findOne({}, function(err, user){ //correctly sets the key to null... but it\'s still present in the document user.key_to_delete = null; // doesn\'t seem to have any effect delete user.key_to_delete; user.save(); }); 回答1: In early versions, you would have needed to drop down the node-mongodb-native driver. Each model has a