nosql

Try to install mongodb with dijango?

限于喜欢 提交于 2020-01-02 20:44:46
问题 I am trying to configure MongoDB database to Django. I tried a lot of tutorials but still, I am not able to configure. I followed following tutorials commands. http://2buntu.com/articles/1451/installing-django-and-mongodb-in-your-virtualenv/ http://django-mongodb-engine.readthedocs.org/en/latest/topics/setup.html http://docs.mongodb.org/manual/tutorial/write-a-tumblelog-application-with-django-mongodb-engine/ I added the following code to setting.py class. DATABASES = { 'default': { 'ENGINE'

Cassandra slowed down with more nodes

孤街浪徒 提交于 2020-01-02 09:12:15
问题 I set up a Cassandra cluster on AWS. What I want to get is increased I/O throughput (number of reads/writes per second) as more nodes are added (as advertised). However, I got exactly the opposite. The performance is reduced as new nodes are added. Do you know any typical issues that prevents it from scaling? Here is some details: I am adding a text file (15MB) to the column family. Each line is a record. There are 150000 records. When there is 1 node, it takes about 90 seconds to write. But

MongoDB $slice (embedded array paging)

谁说胖子不能爱 提交于 2020-01-02 03:51:08
问题 I have this schema: article: { subject, comments: [] } if I have 8 comments, and query article.find({}, { comments: { $slice: [ -10, 5 ] } }); And I get comments from index 0 to index 4, but I only want comments from index 0 to index 2 to be returned because of paging. (page 1 $slice[ -5, 5 ] from index 3 to index 7, page 2 $slice[ -10, 5 ] from index 0 to index 2) now I have to pass another parameter "lastId" to compare each comments and remove that "_id" < "lastId", but I think it is a

How to count records with one distinct field in mongoose?

主宰稳场 提交于 2020-01-02 03:36:05
问题 While exploring mongoose for nodejs I ran into the problem of needing to know the amount of user in my collection: My collection has records, each record has a user. I want to know the amount of unique (different) users. How can I do this with mongoose? EDIT: The database is growing quite fast, is there anyway to get the number back from the DB instead of getting all the distinct records and counting them? 回答1: Here's an alternative answer as I get an exception when I try Reddest's approach

Elasticsearch filter on aggregation

大憨熊 提交于 2020-01-01 15:39:07
问题 Since I couldn't find anything on Google: Is it possible to filter on an aggregation in elasticsearch. Im thinking of someting like: Get all objects where SUM(obect.X) > 100. Thanks in advance. EDIT - Sample Data I have the following document-structure: { docKey : 1 value: 2 }, { docKey: 1 value: 5 }, { docKey:1 value: 7 }, { docKey:2 value:2 },... I now want to query the docKey from the database where the sum of the value is bigger than X. EDIT2 I found out that is something I have to do in

How do I filter through data in Cassandra?

故事扮演 提交于 2020-01-01 10:58:35
问题 I've been using mySQL for an app for some time, and the more data I collect, the slower it gets. So I have been looking into NOSQL options. One of the things I have in mySQL is a View created from a bunch of joins. The app shows all the important info in a grid, and the user can select ranges, do searches, etc. On this data set. Standard Query stuff. Looking at Cassandra everything is already sorted based on the parameters I provide in my storage-conf.xml. So I would have a certain string as

How do I filter through data in Cassandra?

旧巷老猫 提交于 2020-01-01 10:58:25
问题 I've been using mySQL for an app for some time, and the more data I collect, the slower it gets. So I have been looking into NOSQL options. One of the things I have in mySQL is a View created from a bunch of joins. The app shows all the important info in a grid, and the user can select ranges, do searches, etc. On this data set. Standard Query stuff. Looking at Cassandra everything is already sorted based on the parameters I provide in my storage-conf.xml. So I would have a certain string as

Relational to NoSQL Database

懵懂的女人 提交于 2020-01-01 10:28:08
问题 This question is for all NoSQL and specially mongoDB experts out there. I started by designing a relational DB for a project but client wants us to use a DB that can easily scale. To achieve this we have decided to use mongoDB. These days I am having trouble mapping my relational model for NoSQL. I have a users table which has a many-to-many relation with a lot of other tables as illustrated below: I have a few options when converting it for mongoDB: Option 1 (with complete rows in users):

What are some real use cases for going with a NoSQL Document Store db?

こ雲淡風輕ζ 提交于 2020-01-01 10:09:06
问题 I have been reading documentation and watching screencasts specific to Mongo DB over the past few days and I am at a loss for when a solution like this would be better than a typical pg or mysql environment. Specifically, my question is under what circumstance (w/ use case would be nice) would you want to go the nosql route? Thanks! 回答1: Many disparate writers. Especially when the writers can get segmented due to disconnections in the network, and will later need to resync data that has been