nosql

How to get nodes that have a given amount of outgoing relationships with a given property in Neo4j Cypher?

流过昼夜 提交于 2019-12-10 10:00:20
问题 In my domain a node can have several relationships of the same type to other entities. Each relationship have several properties and I'd like to retrieve the nodes that are connected by at least 2 relationships that present a given property. EG: A relationship between nodes have a property year . How do I find the nodes that have at least two outgoing relationships with the year set to 2012 ? Why Chypher query so far looks like this (syntax error) START x = node(*) MATCH x-[r:RELATIONSHIP

Neo4j.rb create unique relationship

做~自己de王妃 提交于 2019-12-10 09:02:26
问题 Here is my Neo4j Active Node class User include Neo4j::ActiveNode has_many :out, :following, type: :following, model_class: 'User' end john = User.find(:name => "John") tom = User.find(:name => "Tom") # create following relationship john --> tom john.following << tom # check count john.following.count #=> 1 # again create the relationship john.following << tom # again check count john.following.count #=> 2 I want to create unique relationship. To avoid duplication we have to use create unique

SequoiaDB数据库集群部署

隐身守侯 提交于 2019-12-10 08:14:55
一般在多机环境下部署数据库的集群模式是比较繁琐的,下面我来分享一个如何通过shell脚本的方式简单、方便地部署我们的集群。 首先,我们要给机器配置信任关系,这样我们就无需手动的输入密码来执行ssh和scp操作 假设我们我们有四台机器: suse1 suse2 suse3 suse4 suse1是部署控制机,suse2 suse3 suse4是需要部署的机器 suse2 suse3 suse4分别执行 ssh-keygen -d 产生秘钥和公钥,再将各自的公钥存储在suse1的authorized_keys文件中 如果suse1也是需要部署的机器,同样也是需要建立相应的信任关系 建立好信任关系后,将四个脚本文件和SequoiaDB安装软件放在同一个文件夹,我们就可以操作部署了 我将部署的脚本分成了四部分: 控制机执行脚本、远程机执行脚本、函数库脚本和部署配置脚本 控制机执行脚本 sequoiadb_deploy.sh 主要的工作是分发文件,将数据库软件、远程执行脚本、函数库脚本和配置脚本分发到远程机器的 再通知远程的机器执行远程文件 远程机执行脚本 remote_deploy.sh 主要工作 卸载旧版本的SequoiaDB数据库,安装新版本的SequoiaDB数据库,配置SequoiaDB引擎启动文件 启动本机的SequoiaDB引擎 针对部署方案,将磁盘mount到指定的目录

搭建Redis+Lnmp

我怕爱的太早我们不能终老 提交于 2019-12-10 03:49:57
:搭建Redis服务器 2:常用命令 3:修改Redis服务运行参数 4:部署LNMP+Redis RDBMS : 关系数据库管理系统 主流的RDBMS软件 : MySQL MariaDB Oracle DB2 SQL Server NoSQL 泛指非关系型数据库 不需要先预定数据存储结构 每条记录可以不同的数据类型和字段个数 NoSQL主流软件 Memcached, Redis, MongoDB, 是常用的 CouchDB, Neo4j FlockDB 不常用 搭建redis服务器 (1)yum -y install gcc (2)tar -zxf redis-4.0.8.tar.gz (3) make && make install (4) ./utils/install_server.sh //初始化安装(一路回车) /etc/init.d/redis_6379 status //查看状态 6379 //端口号 /etc/init.d/redis_6379 //数据库目录 /etc/redis/6379.conf //主配置文件 /var/log/redis_6379.log //日志目录 /var/lib/redis/6379 //数据库目录 /usr/local/bin/redis-server //启动程序的目录 /usr/local/bin/redis-cli /

Can i delete default MongoDB Index?

只愿长相守 提交于 2019-12-10 03:17:11
问题 I have one collection for which I don't need any index. I just store user search term and date, so my collection is really simple. class UserSearch { public string Term {get; set;} pulic DateTime Date {get;set;} } When I store one UserSearch item, my collection have _id and default index on it. From my knowledge, those "_id" fields will be indexed in ram, so I don't want to spend ram memory for collection which I just store and I'm calculating something every 12 hours. I try to delete it, but

Are there any NoSQL standards emerging? [closed]

老子叫甜甜 提交于 2019-12-10 03:02:55
问题 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 6 years ago . As with most new technologies after a while a standard emerges. Is there anything cooking for NoSQL? 回答1: The whole point of NoSQL is

How to build a no install, client-side only, database web app

眉间皱痕 提交于 2019-12-10 02:58:44
问题 Where I work it is pretty restricted in terms of IT. I do not have access to an SQL Server or a Web server so things like Apache, PHP, mySQL etc are all off the table. No server side anything. The PCs on the network cannot see each other (so installing WAMP and opening firewall ports wouldnt work...besides...we cant install anything either...all locked down), this is due to group policy restrictions. However there are plenty of shared drives that we all can use. Currently we are getting by

MongoDB 那些坑

你离开我真会死。 提交于 2019-12-10 02:34:49
MongoDB 是目前炙手可热的 NoSQL 文档型数据库,它提供的一些特性很棒:如自动 failover 机制,自动 sharding,无模式 schemaless,大部分情况下性能也很棒。但是薄荷在深入使用 MongoDB 过程中,遇到了不少问题,下面总结几个我们遇到的坑。特别申明:我们目前用的 MongoDB 版本是 2.4.10,曾经升级到 MongoDB 2.6.0 版本,问题依然存在,又回退到 2.4.10 版本。 MongoDB 数据库级锁 坑爹指数:5星(最高5星) MongoDB的锁机制和一般关系数据库如 MySQL(InnoDB), Oracle 有很大的差异,InnoDB 和 Oracle 能提供行级粒度锁,而 MongoDB 只能提供 库级粒度锁,这意味着当 MongoDB 一个写锁处于占用状态时,其它的读写操作都得干等。 初看起来库级锁在大并发环境下有严重的问题,但是 MongoDB 依然能够保持大并发量和高性能,这是因为 MongoDB 的锁粒度虽然很粗放,但是在锁处理机制和关系数据库锁有很大差异,主要表现在: MongoDB 没有完整事务支持,操作原子性只到单个 document 级别,所以通常操作粒度比较小; MongoDB 锁实际占用时间是内存数据计算和变更时间,通常很快; MongoDB 锁有一种临时放弃机制,当出现需要等待慢速 IO 读写数据时

Cassandra - WHERE clause with non primary key disadvantages

孤街醉人 提交于 2019-12-10 02:27:59
问题 I am new to cassandra and I am using it for analytics tasks (good indexing needed ). I read in this post (and others): cassandra, select via a non primary key that I can't query my DB with a non-primary key columns with WHERE clause . To do so, it seems that there is 3 possibilities (ALL with major disadvantages): Create a secondary index (not recommended for performance issues). Create a new table (I don't want redundant data even if it's ok with cassandra). Put the column I want to query by

NoSQL 数据库之MongoDB

蓝咒 提交于 2019-12-10 01:17:03
1.MongoDB简介 1.1什么是MongoDB   MongoDB 是一个跨平台的,面向文档的数据库,是当前 NoSQL 数据库产品中最热门的一种。它介于关系数据库和非关系数据库之间,是非关系数据库当中功能最丰富,最像关系数据库的产品。它支持的数据结构非常松散,是类似JSON 的 BSON 格式,因此可以存储比较复杂的数据类型。   MongoDB 的官方网站地址是: http://www.mongodb.org/ 1.2 MongoDB特点   MongoDB 最大的特点是他支持的查询语言非常强大,其语法有点类似于面向对象的查询语言,几乎可以实现类似关系数据库单表查询的绝大部分功能,而且还支持对数据建立索引。它是一个面向集合的,模式自由的文档型数据库。 具体特点总结如下: (1)面向集合存储,易于存储对象类型的数据 (2)模式自由 (3)支持动态查询 (4)支持完全索引,包含内部对象 (5)支持复制和故障恢复 (6)使用高效的二进制数据存储,包括大型对象(如视频等) (7)自动处理碎片,以支持云计算层次的扩展性 (8)支持 Python,PHP,Ruby,Java,C,C#,Javascript,Perl 及 C++语言的驱动程序,社区中也提供了对 Erlang 及.NET 等平台的驱动程序 (9) 文件存储格式为 BSON(一种 JSON 的扩展) 1.3