nosql

Designing record keys for document-oriented database - best practices

烈酒焚心 提交于 2019-12-06 06:41:01
问题 Our team has started development of an application backed by Couchbase DB; for every one of us it's the first experience with a no-SQL database. We've started to define our entities and adopted the practice of using "type" prefixes, suggested by Couchbase manual: Entity "A": key: a#123 Entity "B": key: b#123 But we realized that we're getting confused with choosing the strategy for creating compound document keys. We use counters a lot, and they require their own documents. Our keys have

Why is multi-value field a bad idea in relational databases

亡梦爱人 提交于 2019-12-06 06:18:51
问题 Having been working with Mongodb and Solr/Lucene, I am starting to wonder why multi-value field for relational databases are (generally) considered an bad idea? I am aware of the theoretical foundation of relational database and normalization. In practice, however, I ran into many use cases where I end up using an meta table of key-value pairs to supplement the main table, such as in the cases of tagging, where I wish I don't have to make multiple joins to look up the data. Or where

Store a function in IndexedDb datastore

泄露秘密 提交于 2019-12-06 06:08:47
问题 Is it possible in any way to store a function in an IndexedDB datastore? I have done some searching and found nothing on the data types that IndexedDB supports. I tried simply adding a function and the instance of a function to an object store as follows, but it didn't work. var myclass = function () { self = this; self.name = 'Sam'; self.hello = function () { console.log('Hello ' + self.name); }; } var transaction = db.transaction(['codeobject'], 'readwrite'); var store = transaction

NoSQL system to save relational data

萝らか妹 提交于 2019-12-06 05:22:20
问题 If my data is relational (publishers-authors-books, associations-teams-players), can we use NoSQL system like HBase or MongoDB to store the data? (I know it may sound like a stupid question but I'm just learning :)) 回答1: Yes, you can store any type of data in NoSQL datastores. The kind of information you describe should be very adequate for NoSQL. However, be aware that in a typical NoSQL solution, you would be trading some/many features that are taken for granted in SQL databases, such as

Programmatically creating edges in ArangoDB

微笑、不失礼 提交于 2019-12-06 05:11:34
What is the simplest way to quickly create edges in ArangoDB programmatically? I would like to create relationships between documents based on a common attribute. I'd like to be able to select an attribute, and for every document in collection A, create an edge to every document in collection B that has the same value in an equivalent attribute. For example, if I've imported email messages into a collection and people into another collection, I would like to generate edges between the emails and collections. An email's schema might look like this: { "_key": "subject": "body": "from": "to": }

Key-Value Database with Java client

谁说我不能喝 提交于 2019-12-06 04:39:17
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 advanced features. Again, I want it to be simple. I have looked into Redis and MongoDB. Both look

分布式系统一致性(ACID、CAP、BASE、二段提交、三段提交、TCC、幂等性)原理详解

老子叫甜甜 提交于 2019-12-06 04:39:12
1 背景 一致性是一个抽象的、具有多重含义的计算机术语,在不同应用场景下,有不同的定义和含义。在传统的IT时代,一致性通常指强一致性,强一致性通常体现在你中有我、我中有你、浑然一体;而在互联网时代,一致性的含义远远超出了它原有的含义,在我们讨论互联网时代的一致性之前,我们先了解一下互联网时代的特点,互联网时代信息量巨大、需要计算能力巨大,不但对用户响应速度要求快,而且吞吐量指标也要向外扩展(既:水平伸缩),于是单节点的服务器无法满足需求,服务节点开始池化,想想那个经典的故事,一只筷子一折就断,一把筷子怎么都折不断,可见人多力量大的思想是多么的重要,但是人多也不一定能解决所有事情,还得进行有序、合理的分配任务,进行有效的管理,于是互联网时代谈论最多的话题就是拆分,拆分一般分为“水平拆分”和“垂直拆分”(大家不要对应到数据库或者缓存拆分,这里主要表达一种逻辑)。这里,“水平拆分”指的是同一个功能由于单机节点无法满足性能需求,需要扩展成为多节点,多个节点具有一致的功能,组成一个服务池,一个节点服务一部分的请求量,团结起来共同处理大规模高并发的请求量。“垂直拆分”指的是按照功能拆分,秉着“专业的人干专业的事儿”的原则,把一个复杂的功能拆分到多个单一的简单的元功能,不同的元功能组合在一起,和未拆分前完成的功能是一致的,由于每个元功能职责单一、功能简单,让维护和变更都变得更简单、安全

Cassandra - search by primary key using an arbitrary subset of the primary key columns

别等时光非礼了梦想. 提交于 2019-12-06 04:13:27
问题 Is it possible to find records in Cassandra who's primary key matches an arbitrary subset of all of the primary key fields? Example: Using the table described below, it is possible to find the records whos's primary key has a particular type and name without specifying an id or size ? CREATE TABLE playlists ( id uuid, type text, name text, size int, artist text, PRIMARY KEY (id, type, name, size) ); Thanks! 回答1: At least in Cassandra 1.2 it is possible but it is disabled by default, If you

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

别说谁变了你拦得住时间么 提交于 2019-12-06 03:45:25
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 software (like Workbench for instance) to create a visual representation of the data stored in the

RavenDB. How to load document with only 5 items from inner collection?

本秂侑毒 提交于 2019-12-06 03:44:15
问题 Here is a document in the store: { "Name": "Hibernating Rhinos", "Employees": [ { "Name": "Ayende" }, { "Name": "John" }, { "Name": "Bob" }, { "Name": "Tom" }, { "Name": "Lane" }, { "Name": "Bill" }, { "Name": "Tad" } ] } It is easy to load this document with or without Employees collection, but how to load only part of inner collection? For instance, first 5 items: { "Name": "Hibernating Rhinos", "Employees": [ { "Name": "Ayende" }, { "Name": "John" }, { "Name": "Bob" }, { "Name": "Tom" }, {