nosql

MongoDB fixed size array implementation

可紊 提交于 2019-12-06 12:08:01
问题 My question is related to http://jira.mongodb.org/browse/SERVER-991. I need a nested array of a fixed size storing latest XX events related to current document. How can I implement client-side this feature? I thought of maintaining a count on array size, something like: Select count field from element Push element to embedded array If count < XX, then inc_count; Else, pop latest element; The downsides of this approach: 3 queries for each event push as mongo doesn't have transactions, the

Cassandra slowed down with more nodes

我与影子孤独终老i 提交于 2019-12-06 11:33:20
I set up a Cassandra cluster on AWS. What I want to get is increased I/O throughput (number of reads/writes per second) as more nodes are added (as advertised). However, I got exactly the opposite. The performance is reduced as new nodes are added. Do you know any typical issues that prevents it from scaling? Here is some details: I am adding a text file (15MB) to the column family. Each line is a record. There are 150000 records. When there is 1 node, it takes about 90 seconds to write. But when there are 2 nodes, it takes 120 seconds. I can see the data is spread to 2 nodes. However, there

Cassandra/NoSQL newbie: the right way to model?

蹲街弑〆低调 提交于 2019-12-06 11:11:06
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: { // <-- this is the Users SuperColumnFamily, keyed by username myuser: { // <-- this is a User SuperColumn

which diagram to use in NoSql (Mcd, Merise, UML)

风流意气都作罢 提交于 2019-12-06 10:51:59
again, sorry for my silly question, but it seems that what i've learned from Relation Database should be "erased", there is no joins, so how the hell will i draw use Merise and UML in NoSql? http://en.wikipedia.org/wiki/Class_diagram this one will not work for NoSql? How you organize your project is an independent notion of the technology used for persistence; In particular; UML or ERD or any such tool doesn't particularly apply to relational databases any more than it does to document databases. The idea that NoSQL has "No Joins" is both silly and unhelpful. It's totally correct that (most)

Centos7安装Redis3.X

随声附和 提交于 2019-12-06 10:27:16
本文只是简单搭建Redis,为了整合ELK用,后面会详细写。 Redis:REmote DIctionary Server(远程字典服务器) 是完全开源免费的,用C语言编写的,遵守BSD协议,是一个高性能的(key/value)分布式内存数据库,基于内存运行并支持持久化的NoSQL数据库,是当前最热门的NoSql数据库之一,也被人们称为数据结构服务器 Redis 与其他 key - value 缓存产品有以下三个特点 1:Redis支持数据的持久化,可以将内存中的数据保持在磁盘中,重启的时候可以再次加载进行使用 2:Redis不仅仅支持简单的key-value类型的数据,同时还提供list,set,zset,hash等数据结构的存储 3:Redis支持数据的备份,即master-slave模式的数据备份 Redis的功能 内存存储和持久化:redis支持异步将内存中的数据写到硬盘上,同时不影响继续服务。 取最新N个数据的操作,如:可以将最新的10条评论的ID放在Redis的List集合里面。 模拟类似于HttpSession这种需要设定过期时间的功能。 发布、订阅消息系统。 定时器、计数器。 上传压缩包,并解压 安装GCC gcc是linux下的一个编译程序,是C程序的编译工具。 GCC(GNU Compiler Collection) 是 GNU(GNU's Not Unix)

Riak: are links dissolved if the target is deleted?

谁说胖子不能爱 提交于 2019-12-06 10:26:29
When an item is deleted from a store are links automatically deleted from all of the documents linking to the now missing item? Or do we have a situation that's similar to a broken link on an HTML page? No, links are not deleted automatically. Links are just a metadata stored with objects so to find all objects which link to a deleted object you need to traverse the whole database which is not reasonable. 来源: https://stackoverflow.com/questions/5113264/riak-are-links-dissolved-if-the-target-is-deleted

Titan data corruption

孤街浪徒 提交于 2019-12-06 10:12:20
I get an exception when calling com.tinkerpop.blueprints.Edge.getLabel on some vertex edges : java.lang.IllegalStateException: Could not find type for id: 630 at com.google.common.base.Preconditions.checkState(Preconditions.java:200) at com.thinkaurelius.titan.graphdb.types.vertices.TitanTypeVertex.getName(TitanTypeVertex.java:30) at com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx$VertexConstructor.get(StandardTitanTx.java:321) I can solve this issue by removing all vertex and start over, but we obviously don't want to do that in production. This error seems to occur when there is

(Non-Relational) DBMS Design Resource

蹲街弑〆低调 提交于 2019-12-06 10:03:00
问题 As a personal project, I'm looking to build a rudimentary DBMS. I've read the relevant sections in Elmasri & Navathe (5ed), but could use a more focused text- something a bit more practical and detail-oriented, with real-world recommendations- as E&N only went so deep. The rub is that I want to play with novel non-relational data models. While a lot of E&N was great- indexing implementation details in particular- the more advanced DBMS implementation was only targeted to a relational model. I

Revisions: algorithm and data structure

不打扰是莪最后的温柔 提交于 2019-12-06 10:00:45
I need ideas for structuring and processing data with revisions. For example, I have a database of objects (e.g. cars). Each object has a number of properties, which can be arbitrary, so there's no a set schema to describe these objects. These objects are probably saved as key-value pairs. Now I need to change property of an object. I don't want to completely rewrite it - I want to be able to go back and see history of changes to these properties, that's why I want to add new property and keep the old one (so I guess a timestamp would do the job of telling which property is the latest). At the

json data storage with versioning

我的梦境 提交于 2019-12-06 09:36:56
Problem definition: There is a Java server which stores JSON data that can be mapped to a Java Class. The Java Class is subject to changes. The goal is to be able to update the Java Class and still be able to decode the JSON data of an older version to a Java Object of a newer version. There should be a good versioning system in place. For example the ability to add a new field to the Java Class with a default value. In the case the old JSON data doesn't have this field, the Java object can use the default value of the field. Questions: I've seen GSON , but the versioning support is too