nosql

Cassandra/NoSQL newbie: the right way to model?

≡放荡痞女 提交于 2019-12-08 01:52:22
问题 as the title says I am fairly (read: completely) new to NoSQL DBS such as Cassandra. As many others, I learned RMDBS before. So I did a little reading on 'WTF is a super column' and other obvious google hits, but I am still not sure how to model this: Say I want to save Users, as in username/password/name/etc... what if that user has like, a mobile phone and a landline telephone? is this the 'right' way to do it? (using the same abbreviated JSON style as seen on other sites) Users: { // <--

How to select where sum of fields is greater than a value in MongoDB

落花浮王杯 提交于 2019-12-08 00:53:32
问题 Using MongoDB, How would I write this regular SQL statement? SELECT * FROM table WHERE (field1+field2+field3) > 1 I've been messing with $group, $project, $add, etc. I feel like I'm dancing all around the solution but can't figure it out. 回答1: The easiest way to do this is by using $where (I am not telling that it is not possible to do this with aggregation) db.table.find({$where: function() { return this.field1 + this.field2 + this.field3 > 1 // most probably you have to handle additional

How to check if a database exists with mongoose.createConnection()?

依然范特西╮ 提交于 2019-12-07 21:45:17
问题 I want to create multiple connections using mongoose. Therefore, I've chosen to use mongoose.createConnection() instead of mongoose.connect() . When I connect on my localhost, I want to check if the database that I'm connecting to exists. My connection to a non-existing database: let db = mongoose.createConnection('mongodb://localhost/nonexistentdb'); Nevertheless, the events still give the the following results: db.on('open', function() { console.log("Opened"); // <= logged }); db.on(

Key-Value Database with Java client

爷,独闯天下 提交于 2019-12-07 21:17:23
问题 I basically want to store a hashtable on disk so I can query it later. My program is written in Java. The hashtable maps from String to List. There are a lot of key-value stores out there, but after doing a lot of research/reading, its not clear which one is the best for my purposes. Here are some things that are important to me. Simple key-value store which allows you to retrieve a value with a single key. Good Java client that is documented well. Dataset is small and there is no need for

PHP-Driver DataStax Cassandra DB - How to use?

瘦欲@ 提交于 2019-12-07 20:44:32
I've done the installation process as following: System PHP 7.0.5-1~dotdeb+8.1 (cli) ( NTS ) Debian 8 Nginx 1.8.1 Laravel 5.2 Java Installation mkdir -p /usr/lib/jvm wget URL to Oraclesite mv mv jdk-8u77-linux-x64.tar.gz\?... jdk-8u77-linux-x64.tar.gz tar xzf jdk-8u77-linux-x64.tar.gz rm jdk-8u77-linux-x64.tar.gz update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_version/bin/java" 1 update-alternatives --set java /usr/lib/jvm/jdk1.8.0_version/bin/java Install needed packages apt install cmake automake libtool git php7.0-dev libgmp-dev libssl-dev Libuv Installation cd

集结阿里云数据库最强阵容 DTCC 2019 八大亮点抢先看

筅森魡賤 提交于 2019-12-07 20:38:20
2019年5月8日-5月10日,由国内知名IT技术社区主办的数据库技术交流盛会——DTCC 2019将在北京新云南皇冠假日大酒店召开。数据风云,十年变迁,DTCC见证并铭记了国内数据库技术的关键成长历程。作为DTCC的老朋友和全球领先的云计算厂商,阿里云数据库团队受邀参加本次技术盛会,不仅将派出重量级嘉宾阵容,还会为广大数据库业内人士和行业用户奉上 8场精彩议题 ,精彩不容错过。 本次DTCC大会云集多位阿里云数据库顶级大咖,将为您带来最具价值的技术交流和探讨,干货满满。由 阿里巴巴集团副总裁、达摩院数据库首席科学家、阿里云智能事业群数据库产品事业部总负责 李飞飞博士 领衔,Google第一代分布式SQL系统Tenzing核心人物、阿里云OLAP产品分析引擎负责人林亮,数据库内核团队资深技术专家何登成等核心团队成员将依次亮相,分别就云原生数据库、新一代自研分析型数据库、分布式数据库、时序数据库、图数据库等最in的技术话题,展开深入讨论,分享最佳实战经验。同时,李飞飞博士还将作为DTCC大会的专家顾问,把握数据技术的主题内容与方向。 洞见前沿技术趋势,见证阿里云数据库成长历程。在这场数据库领域从业人士难得的年度盛会和交流平台上,阿里云技术大牛们将带来怎样的饕餮盛宴? 下面小编就为大家提前梳理了8大亮点,并附上阿里云议题全集,精彩一网打尽。 期待与您共聚一堂,共话行业未来! 温馨提示

Neo4j - Unit testing REST Api calls

给你一囗甜甜゛ 提交于 2019-12-07 19:32:49
问题 I'm about to use Neo4j Server (Rest Api). I've thought to the way of unit testing Neo4j. I found NoSqlUnit that play the same role as DbUnit but dedicated to NoSql database like Neo4j. However, main solutions are easy to set up for those who use the embbeded version of Neo4J (in plain Java, Scala ..). Is there an effective way to unit test Rest Api calls thanks to an embedded database substitution? UPDATE ---------------------- Sorry, I misread the NoSqlUnit documentation. It seems that an

搭建高可用mongodb集群(二)—— 副本集

…衆ロ難τιáo~ 提交于 2019-12-07 19:16:36
在上一篇文章 《搭建高可用MongoDB集群(一)——配置MongoDB》 提到了几个问题还没有解决。 主节点挂了能否自动切换连接?目前需要手工切换。 主节点的读写压力过大如何解决? 从节点每个上面的数据都是对数据库全量拷贝,从节点压力会不会过大? 数据压力大到机器支撑不了的时候能否做到自动扩展? 这篇文章看完这些问题就可以搞定了。NoSQL的产生就是为了解决大数据量、高扩展性、高性能、灵活数据模型、高可用性。但是光通过主从模式的架构远远达不到上面几点,由此MongoDB设计了副本集和分片的功能。这篇文章主要介绍 副本集 : mongoDB官方已经 不建议使用主从模式 了,替代方案是采用副本集的模式, 点击查看 ,如图: 那什么是副本集呢?打魔兽世界总说打副本,其实这两个概念差不多一个意思。游戏里的副本是指玩家集中在高峰时间去一个场景打怪,会出现玩家暴多怪物少的情况,游戏开发商为了保证玩家的体验度,就为每一批玩家单独开放一个同样的空间同样的数量的怪物,这一个复制的场景就是一个副本,不管有多少个玩家各自在各自的副本里玩不会互相影响。 mongoDB的副本也是这个,主从模式其实就是一个单副本的应用,没有很好的扩展性和容错性。而副本集具有多个副本保证了容错性,就算一个副本挂掉了还有很多副本存在,并且解决了上面第一个问题“主节点挂掉了,整个集群内会自动切换”

What data modeling tools are nosql (couchdb) developers using? [closed]

送分小仙女□ 提交于 2019-12-07 18:16:32
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . At some point, I assume that anyone developing for couchdb (or other nosql option) must still identify what must be stored in each document. And it would seem that, although very rarely, every once in a while we would need to have some relationships between these documents. So, are people still using ER-type

Martin Fowler对于nosql的看法

泪湿孤枕 提交于 2019-12-07 17:51:32
The rise of NoSQL databases marks the end of the era of relational database dominance NoSQL数据库的崛起标志这个关系型数据库统治时代的终结。 But NoSQL databases will not become the new dominators. Relational will still be popular, and used in the majority of situations. They, however, will no longer be the automatic choice. 但是NoSQL数据库不会变成新时代的统治者。关系型数据库也依然会流行下去,并且占据大部分场景。然而,他们不会再是自动化的选择了。 The era of Polyglot Persistence has begun 多语言持久化的时代已经开始 Big Data is the driver for NoSQL’s rise, but not the only reason to use NoSQL 大数据是NoSQL型数据库崛起的始作俑者, 但是这不仅仅是使用NoSQL的唯一原因。 Many NoSQL databases are designed to run well on large