nosql

When to replace RDBMS/ORM with NoSQL [closed]

送分小仙女□ 提交于 2019-12-17 22:32:22
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . What kind of projects benefit from using a NoSQL database instead of rdbms wrapped by an ORM? Examples: Stackoverflow similiar sites?

Scan with filter using HBase shell

随声附和 提交于 2019-12-17 21:42:42
问题 Does anybody know how to scan records based on some scan filter i.e.: column:something = "somevalue" Something like this, but from HBase shell? 回答1: Try this. It's kind of ugly, but it works for me. import org.apache.hadoop.hbase.filter.CompareFilter import org.apache.hadoop.hbase.filter.SingleColumnValueFilter import org.apache.hadoop.hbase.filter.SubstringComparator import org.apache.hadoop.hbase.util.Bytes scan 't1', { COLUMNS => 'family:qualifier', FILTER => SingleColumnValueFilter.new

Transaction support in MongoDB

可紊 提交于 2019-12-17 19:18:17
问题 I am new to MongoDB. I read that MongoDB does not support multi-document transactions here http://docs.mongodb.org/manual/faq/fundamentals/. If I want to save data in two collections(A and B) atomically, then i can't do that using MongoDB i.e. if save fails in case of B, still A will have the data. Isn't it a big disadvantage? Still, people are using MongoDB rather than RDBMS. Why? 回答1: MongoDB does not support multi-document transactions. However, MongoDB does provide atomic operations on a

MongoDb via jndi

为君一笑 提交于 2019-12-17 19:02:22
问题 Do you know if it is possible to setup mongodb instance in spring like any other db via datasource from jndi? Thx 回答1: If you mean like regular RDBMS with JDBC access, then the answer is no. 回答2: Yes it is possible, why relying in someone elses code when you can create your own JNDI factory? just create a class that implements javax.naming.spi.ObjectFactory and a bean that pulls mongo from the JNDI context, I configured this for spring data-mongo MongoTemplate object. public class

When to use CouchDB over MongoDB and vice versa

混江龙づ霸主 提交于 2019-12-17 17:18:58
问题 I am stuck between these two NoSQL databases. In my project I will be creating a database within a database. For example, I need a solution to create dynamic tables. So users can create tables with columns and rows. I think either MongoDB or CouchDB will be good for this, but I am not sure which one. I will also need efficient paging as well. 回答1: Of C, A & P (Consistency, Availability & Partition tolerance) which 2 are more important to you? Quick reference, the Visual Guide To NoSQL Systems

Elastic search - tagging strength (nested/child document boosting)

隐身守侯 提交于 2019-12-17 16:52:21
问题 Given the popular example of a post that has a collection of tags, let's say that we would want each tag to be more than a string but a tuple of a string and a double which signifies the strength of said tag. How would one query posts and score these based on the sum of tag strengths (let's assume we are searching for exact terms in the tags names) 回答1: It can be done by indexing tags as nested documents and then using the nested query in combination with the custom score query. In the

how do i add a value to the top of an array in mongodb?

有些话、适合烂在心里 提交于 2019-12-17 16:37:21
问题 how do i add a value to the top of an array in mongodb? say i have this document in my mongo collection: { "colors" : [ "red", "green", "blue" ] } how do i add "yellow" to the front of the list? when i do: {$push:{colors:"yellow"}} i'd get this: { "colors" : [ "red", "green", "blue", "yellow" ] } i want this: { "colors" : [ "yellow", "red", "green", "blue"] } thanks in advance! 回答1: "unshift" inserts data in the front of an array.. whereas "push" inserts it at the end. e.g. in JavaScript: > a

DynamoDB vs MongoDB NoSQL [closed]

依然范特西╮ 提交于 2019-12-17 15:26:22
问题 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 last year . I'm trying to figure it out what can I use for a future project, we plan to store from about 500k records per month in the first year and maybe more for the next years this is a vertical application so there's no need to use a database for this, that's the reason why I decided

Get a document in MongoDB without specifying collection

只谈情不闲聊 提交于 2019-12-17 12:59:32
问题 MongoDB IDs are unique for a single database cluster. Is it possible to get documents using their IDs, without specifying the collection name? If yes, how? If no, why not? 回答1: Yes, but not in a scalable way (since you must query each collection). If you have 2 or 3 collections, this might be ok, but... you probably should review your design to figure out why you're doing this. Why are you, by the way? You get a list of all of the collections in the database. You loop through them, and query

在Spring Boot中整合Redis缓存

雨燕双飞 提交于 2019-12-17 11:52:29
一、Redis简介 Redis 是完全开源免费的,遵守BSD协议,是一个高性能的key-value非关系性数据库(NoSql)。 Redis 与其他 key - value 缓存产品有以下三个特点: 1、Redis支持数据的持久化,可以将内存中的数据保存在磁盘中,重启的时候可以再次加载进行使用。 2、Redis不仅仅支持简单的key-value类型的数据,同时还提供list,set,zset,hash等数据结构的存储。 3、Redis支持数据的备份,即master-slave模式的数据备份。 Redis优势: 1、性能极高 – Redis能读的速度是110000次/s,写的速度是81000次/s 。 2、丰富的数据类型 – Redis支持二进制案例的 Strings, Lists, Hashes, Sets 及 Ordered Sets 数据类型操作。 3、原子 – Redis的所有操作都是原子性的,意思就是要么成功执行要么失败完全不执行。单个操作是原子性的。多个操作也支持事务,即原子性,通过MULTI和EXEC指令包起来。 4、丰富的特性 – Redis还支持 publish/subscribe, 通知, key 过期等等特性。 二、Redis安装 目前Redis官网只有Linux版本,但由于大多数开发者还是基于windows平台开发的,所以这里只介绍windows版本的下载安装