nosql

Couchbase, reduction too large error

冷暖自知 提交于 2020-01-04 14:37:25
问题 On my work I using couchbase and I have some problems. From some devices data come to couchbase, and after I calling aggregate view. This view must aggregate values by 2 keys: timestamp and deviceId. Everything was fine, before I have tried to aggregate more then 10k values. In this case I have reduction error Map function: function(doc, meta) { if (doc.type == "PeopleCountingIn"&& doc.undefined!=true) { emit(doc.id+"@"+doc.time, [doc.in, doc.out, doc.id, doc.time, meta.id]); } } Reduce

Row Locking in HBase single row transaction support

ぃ、小莉子 提交于 2020-01-04 11:05:25
问题 In HBase, For providing single row transaction support it uses Row Locking Concept. Suppose, for example Put p=new Put("/*Row Key*/"); This statement will lock the row. so, until we complete the table.put(p) the lock won't gets released. So, in between if i start a new put i.e Put p1=new Put("/ Row Key "); the p1 put should not work since the row has already been locked but in HBase 0.94 when i tried it's working. Regarding Row Lock Link Where i had seen about Row Lock Is there any thing

How to update in one query, multiple times without sharing to simple queries?

两盒软妹~` 提交于 2020-01-04 09:16:09
问题 I have the following model: { "_id": "unique1", "companyBases": [ { "_id": "company base 1", "vehicles": [ ....some objects ] }, { "_id": "company base 2", "vehicles": [ ....some objects ] }, { "_id": "company base 3", "vehicles": [ ....some objects ] } ] } I would like to update this document by overwritting "vehicles" array in some "companyBases" that matches. This is my input: [ { "_id": "company base 1", "vehicles": [ array thats overwrites old array "vehicles", where _id of object in

Can someone explain me Cascading and FetchType lazy in Ektorp?

▼魔方 西西 提交于 2020-01-04 03:02:08
问题 I am new to CouchDB and Ektorp (I ACTUALLY started today to try to work with it). The most detailed documentation I have found to help me getting started is this one: http://www.ektorp.org/reference_documentation.html#d100e394 My use case is that I want to save a very complex class as a document (I have managed that so far), but I do not want to load all the fields all the time (since some of those are potentially big collections of other simpler documents). Here is an example of what I have

redis笔记之一

孤街浪徒 提交于 2020-01-04 01:11:55
NoSQL简介 全称是Not Only SQL,泛指菲关系型数据库,它是通过键值对存储数据并且将数据存储在内存中。而像mysql,sql server这些通过关系表存数据的就叫关系型数据库 为什么需要NoSQL 主要传统的关系型数据库暴露了许多问题 1.对数据库高并发读写的需求 高并发就是同一时间有许多用户访问同一网站造成访问量太大容易造成服务器崩溃,而传统的解决方法就是搭建集群,通俗的讲就是原先一个服务器提供服务,现在变成多个服务器提供服务 2.高负载-对海量数据的高效率存储和访问的需求 通俗的讲就是数据量非常大,造成没地方存储或者访问查询sql的语句超过上千万造成查询非常低下 3.高扩展-对数据库的高可扩展性和高可用性的需求 通俗的讲相当于银行窗口排队,刚开始一个窗口不能满足需求,后来增加多个窗口,而增加窗口不会造成业务上的不同,也就是集群起来很方便 主流的NoSQL产品 主要有四大类 1.键值(key-value)存储数据库 主流产品:redis 典型应用:内容缓存,主要用于处理大量数据的高访问负载 优势:快速查询 劣势:存储的数据缺少结构化 2.列存储数据库 主流产品:HBase 典型应用:分布式的文件系统 优势:查询速度快,可扩展性强,更容易进行分布式扩展 劣势:功能相对局限 3.文档数据库 主流产品:MongoDB 典型应用:web应用 优势:数据结构要求不严格 劣势

Querying with “contains” on a list of user defined type (UDT)

若如初见. 提交于 2020-01-03 19:31:28
问题 For data model like: create type city ( name text, code int ); create table user ( id uuid, name text, cities list<FROZEN<city>>, primary key ( id ) ); create index user_city_index on user(cities); Querying as select id, cities from user where cities contains {name:'My City', code: 10}; is working fine. But is it possible to query select id, cities from user where cities contains {name:'My City'}; and discard the code attribute, i.e. code=<any> ? Can this be achieved with the utilization of

Querying with “contains” on a list of user defined type (UDT)

浪子不回头ぞ 提交于 2020-01-03 19:31:22
问题 For data model like: create type city ( name text, code int ); create table user ( id uuid, name text, cities list<FROZEN<city>>, primary key ( id ) ); create index user_city_index on user(cities); Querying as select id, cities from user where cities contains {name:'My City', code: 10}; is working fine. But is it possible to query select id, cities from user where cities contains {name:'My City'}; and discard the code attribute, i.e. code=<any> ? Can this be achieved with the utilization of

Elasticsearch distinct filter values

十年热恋 提交于 2020-01-03 17:22:50
问题 I have a large document store in elasticsearch and would like to retrieve the distinct filter values for display on HTML drop-downs. An example would be something like [ { "name": "John Doe", "deparments": [ { "name": "Accounts" }, { "name": "Management" } ] }, { "name": "Jane Smith", "deparments": [ { "name": "IT" }, { "name": "Management" } ] } ] The drop-down should have a list of departments, i.e. IT, Account and Management. Would some kind person please point me in the right direction

Neo4j/Cypher effective pagination with order by over large sub-graph

故事扮演 提交于 2020-01-03 16:43:33
问题 I have following simple relationship between (:User) nodes. (:User)-[:FOLLOWS {timestamp}]->(:User) If I paginate followers ordered by FOLLOWS.timestamp I'm running into performance problems when someone has millions of followers. MATCH (u:User {Id:{id}})<-[f:FOLLOWS]-(follower) WHERE f.timestamp <= {timestamp} RETURN follower ORDER BY f.timestamp DESC LIMIT 100 What is suggested approach for paginating big sets of data when ordering is required? UPDATE follower timestamp --------------------

MongoDB :are reads/writes to database concurrent?

▼魔方 西西 提交于 2020-01-03 13:21:10
问题 What happens when million threads try to read from and write to MongoDB at the same time? does locking happens on a db-level, table-level or row-level ? 回答1: It happens at db-level, however with Mongo 2.0 there are a few methods for concurrency, such as inserting/updating by the _id field. 回答2: You might run into concurrency problems, especially if you're working with a single MongoDB instance rather than a sharded cluster. The threads would likely start blocking eachother as they wait for