nosql

Is it possible to use Neo4j database in an Android application?

安稳与你 提交于 2019-12-23 10:26:56
问题 Will it make any error if I use Neo4j database for my Android Application? If so, can anyone suggest me any other Graph database to use as back end for Android application.. 回答1: Yes. While Neo4J offers a REST API to query the database with the Cypher language, I would recommend to build your own layer on top of that to deal with the requests from Android and then filter and forward to Neo4J. This layer will let you to use your own business logic between the Android app and the server, logic

How to search secondary index in Cassandra without equality?

妖精的绣舞 提交于 2019-12-23 09:41:57
问题 I need to be able to perform search on secondary indexes using only <, >, <=, or >=. I understand that Cassandra requires at least one equality index clause because it iterates over all the results from that equality index. Are there any tricks to perform operations using only <, >, <=, or >= (at least conceptually)? Is it a bad idea? Also, does anybody know if there are any plans to change this in Cassandra? Thanks! 回答1: If there were a good way to do this with 0.7 indexes, we/I would have

Why is C in CAP theorem not same as C in ACID?

岁酱吖の 提交于 2019-12-23 09:09:11
问题 My question is pretty simple, was looking for a simpler answer, Why is C in CAP theorem not same as C in ACID? Read this HN thread. Update A Hitchhiker's Guide to NOSQL v1.0, slide 71 says: C in CAP = A+C (Atomic Consistency) 回答1: Both C's stand for consistency, but the notion of consistency in CAP means that "all nodes see the same data at the same time" and the notion of consistency in ACID means that "any transaction the database performs will take it from one consistent state to another".

way to update multiple documents with different values

一个人想着一个人 提交于 2019-12-23 06:53:38
问题 I have the following documents: [{ "_id":1, "name":"john", "position":1 }, {"_id":2, "name":"bob", "position":2 }, {"_id":3, "name":"tom", "position":3 }] In the UI a user can change position of items(eg moving Bob to first position, john gets position 2, tom - position 3). Is there any way to update all positions in all documents at once? 回答1: You can not update two documents at once with a MongoDB query. You will always have to do that in two queries. You can of course set a value of a

Google Firestore - What is OR equivalent?

∥☆過路亽.° 提交于 2019-12-23 05:30:56
问题 I see having mulitple where acts like AND , but how about OR ? 回答1: You can't really do an OR query in Cloud Firestore. As a workaround, you could run two separate queries and merge them together on the client, or add some custom field that would essentially perform the "OR" query for you on the database. (For an example of that latter one, if you know you're going to often run an "age > 65 OR age < 18" query on the database, you could create a specific age_high_or_low field that you would

How to query a graph of documents of different types at once in Marklogic?

独自空忆成欢 提交于 2019-12-23 04:52:56
问题 Background I'm using NoSql database supporting graphs for the first time. It is a huge medical application handling thousands of patients. It is a greenfield project and we as a team are struggling with our persistence layer. We don't know how relationships should be represented and if we should use Triples to handle queries involving huge amount of data. We are using Java API . Data structure Imagine that there are 3 types of JSON documents in our Marklogic database: Patient, Event, File

RethinkDB Survey Modelling

℡╲_俬逩灬. 提交于 2019-12-23 04:45:07
问题 I'm starting a new project (a survey application) and I chose RethinkDB as my database; however, I have some questions about data modelling. I'm going to have questions that can be answered only once by each user. Moreover I'll have reports that will tell the percentage of users that chose each option. At first I thought of the following modelling: { title: String, total_answers: Number, options: [{ value: Number, label: String, respondents: [User IDs] }] } The problem is that RethinkDB

How to handle circular documents in MongoDB/DynamoDB?

让人想犯罪 __ 提交于 2019-12-23 03:23:09
问题 Currently the site is using a relational database (MySQL) however the speed to join all the data is too long and has required caching that has lead to other issues. The issue is how the two tables would nest into each other creating a circular reference. A simple example would be two tables, one for an ACTOR and a second for a MOVIE. The movie would have the actor and the actor would have a movie. Obviously this is easy in a relational database. So for example, an ACTOR schema: ACTOR1 - AGE -

NOSQL集群redis集群部署

只愿长相守 提交于 2019-12-23 03:15:58
1:部署redis集群 2:添加服务器 3:移除服务器 配置管理主机(管理机操作) (1)yum -y instal rubygems (2)gem install redis-3.2.1.gem (3)mkdir /root/bin //创建命令检索目录 (5)tar -zxvf redis-4.0.8.tar.gz cp redis-trib.rb /root/bin/ //创建管理集群脚本 创建集群(服务机操作)[所有的服务机同样操作] (1)/etc/init.d/redis_6379 stop //停止redis服务 (2)vim /etc/redis/6379.conf //修改配置文件 bind 192.168.4.51 //修改ip port 6351 //修改端口(可选配置) cluster-enabled yes //启用集群功能 cluster-config-file nodes-6379.conf //存储集群信息的配置文件 cluster-node-timeout 5000 //集群节点通信超时时间 (3)rm -rf /var/lib/redis/6379/* //清空数据 在管理主机(管理机操作),创建集群 用法 : redis-teib.rb create //创建集群 check //检查集群 info //查看集群信息 reshard /

How to quickly build large scale analytics server?

天涯浪子 提交于 2019-12-23 03:13:19
问题 I need to build a analytics server for large scale (seven figures and up) quickly and for the cheap. Piwik would be the easy choice but for what I've gathered so far, Piwik is rather hard to scale and can require rather hefty servers to handle loads. My second idea would to create quick and dirty Node.js server which just pushes everything to Amazon DynamoDB, so that one can start gathering the data from the day one and then build the UI later on. That would be quick to create and scale