nosql

Unique IDs with mongodb

笑着哭i 提交于 2019-12-17 10:37:13
问题 If I were building a blog I could use the blog title as the unique identifier and parse it through the URL. However, what if I wanted to use numbers. You know how twitter has www.twitter.com/username/statuses/9834542? Has anyone figured out a nice way of making this work? using "_id" is out of the question since it's way too long. 回答1: As long as you can guarantee uniqueness, you're not constrained to using the default "_id" MongoDB supplies. Therefore, it's down to you how you generate this

Is mongodb running?

五迷三道 提交于 2019-12-17 10:15:31
问题 I have installed mongodb and the php drivers on my unix server. My question is how can I tell if mongodb is running? Is there a simple command line query to check status? If I start it once from the shell will it keep running if I exit the shell (this doesn't seem to be the case). How can I make the mongodb connection persistent and auto start on server reboot? I can run: -bash-3.2$ su Password: [root@xxx]# cd /var/lib [root@xxx]# ./mongodb-linux-i686-1.6.5/bin/mongod ./mongodb-linux-i686-1.6

MAX(), DISTINCT and group by in Cassandra

拜拜、爱过 提交于 2019-12-17 07:31:38
问题 I am trying to remodel a SQL database Cassandra such that, I can find the Cassandra equivalent for the SQL queries. I use CQL 3 and Cassandra v1.2. I modeled the db design in cassandra so that it supports the order by clauses and denormalized tables to support the join operation. However I am at sea when it comes to DISTINCT, SUM() and GROUPBY equvalents SELECT a1,MAX(b1) FROM demo1 group by a1. SELECT DISTINCT (a2) FROM demo2 where b2='sea' SELECT sum(a3), sum(b3) from demo3 where c3='water'

Storing images in NoSQL stores

匆匆过客 提交于 2019-12-17 07:26:36
问题 Our application will be serving a large number of small, thumbnail-size images (about 6-12KB in size) through HTTP. I've been asked to investigate whether using a NoSQL data store is a viable solution for data storage. Ideally, we would like our data store to be fault-toerant and distributed. Is it a good idea to store blobs in NoSQL stores, and which one is good for it? Also, is NoSQL a good solution for our problem, or would we be better served storing the images in the file system and

What is the recommended way to delete a large number of items from DynamoDB?

一笑奈何 提交于 2019-12-17 07:13:23
问题 I'm writing a simple logging service in DynamoDB. I have a logs table that is keyed by a user_id hash and a timestamp (Unix epoch int) range. When a user of the service terminates their account, I need to delete all items in the table, regardless of the range value. What is the recommended way of doing this sort of operation (Keeping in mind there could be millions of items to delete)? My options, as far as I can see are: A: Perform a Scan operation, calling delete on each returned item,

Can I do transactions and locks in CouchDB?

允我心安 提交于 2019-12-17 06:58:05
问题 I need to do transactions (begin, commit or rollback), locks (select for update). How can I do it in a document model db? Edit: The case is this: I want to run an auctions site. And I think how to direct purchase as well. In a direct purchase I have to decrement the quantity field in the item record, but only if the quantity is greater than zero. That is why I need locks and transactions. I don't know how to address that without locks and/or transactions. Can I solve this with CouchDB? 回答1:

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

我怕爱的太早我们不能终老 提交于 2019-12-17 06:24:21
问题 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

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

依然范特西╮ 提交于 2019-12-17 06:23:12
问题 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

The Next-gen Databases

╄→尐↘猪︶ㄣ 提交于 2019-12-17 03:24:12
问题 I'm learning traditional Relational Databases (with PostgreSQL) and doing some research I've come across some new types of databases. CouchDB, Drizzle, and Scalaris to name a few, what is going to be the next database technologies to deal with? 回答1: I would say next-gen database , not next-gen SQL. SQL is a language for querying and manipulating relational databases. SQL is dictated by an international standard. While the standard is revised, it seems to always work within the relational

NoSql vs Relational database

拟墨画扇 提交于 2019-12-17 02:39:10
问题 Recently NoSQL has gained immense popularity. What are the advantages of NoSQL over traditional RDBMS ? 回答1: Not all data is relational. For those situations, NoSQL can be helpful. With that said, NoSQL stands for "Not Only SQL". It's not intended to knock SQL or supplant it. SQL has several very big advantages: Strong mathematical basis. Declarative syntax. A well-known language in Structured Query Language (SQL). Those haven't gone away. It's a mistake to think about this as an either/or