nosql

Only date range scanning Cassandra CQL timestamp

我与影子孤独终老i 提交于 2019-12-08 07:38:52
问题 I have a table like given below. CREATE TEST( HOURLYTIME TIMESTAMP, FULLTIME TIMESTAMP, DATA TEXT, PRIMARY KEY(HOURLYTIME,FULLTIME) ) I inserted the record (2014-12-12 00:00:00,2014-12-12 00:00:01,'Hello World') I would like to search based on date time range in HOURLYTIME field which holds hourly records.When i tried with token() like select * from TEST where token(HOURLYTIME)=token('2014-12-12') to get all the records for that date it returns only for one hour record i.e for 2014-12-12 **00

When does Cassandra DB index data after updating a column as secondary index

元气小坏坏 提交于 2019-12-08 07:38:51
问题 I've a created a secondary index by using update column ... from cassandra-cli , then I tested by using commnand get User where code = 'MX' , code was the column I put as index, this command just returns data inserted after index creation, but data before is not returned , I thought that previous data would be indexed too , anyone has a clue? thanks in advance 回答1: In Cassandra, secondary index starts working only after it is being created. Go through the SecondaryIndex class in apache

Cassandra Database Data Model: Critic my schema design

こ雲淡風輕ζ 提交于 2019-12-08 07:22:50
问题 I need to implement a database for a testing system. It is designed to store test data for future statistical analysis. It has to be Cassandra based. I've designed a schema, but since this is my first attempt at NoSQL design, I would like to get some feedback. I will first describe the data I wish to save, then describe two basic queries and finally present my suggested design. I intend on using Cassandra 1.1 so I tried to use Composite Columns in my design, however, feel free to suggest

Does the Couchbase REST API support NON-JSON data (binary data)

99封情书 提交于 2019-12-08 07:10:54
问题 I am storing c structures to couchbase, I am doing so so that I can read back these structures later and process directly, I am avoiding the steps of 1 )C structure - > JSON while storing and 2 )JSON -> C structure while retrieving. This is working well when I use lcb_get() and lcb_set() But I also need have a requirement for making hits to views using the REST model and lcb_make_http_request () call. So I was wondering how the lcb_make_http_request () will handle my non-JSON C structure ,

Scaling temporary records in database to count totals to stop over-subscribing

*爱你&永不变心* 提交于 2019-12-08 07:08:54
问题 I'm looking at a system where people RSVP to a free web conference, these web conferences can get really busy with a lot of interest and there are limited places, so there has to be some way to ensure it doesn't get over-subscribed... So, we need to have a countdown from the time they book their seat to the time that their order is completed and confirmed. This way it's the first X amount of people to actually click 'Attending' that get the seats for the conference. If the user does not

Create a table in Cassandra 1.2 with CQL3 where column names will be created at runtime

淺唱寂寞╮ 提交于 2019-12-08 06:27:49
问题 I want to store snapshots of an object in Apache Cassandra 1.2 Row key is the Object#ID and there will be a column for each snapshot. -------- latest -------- v2 -------- v1 id-122 100 -------- 50 -------- 66 -------- So column names are created dynamically at runtime. How to create the previous table in Cassandra 1.2 using CQL3 ? 回答1: You would use the compound primary key feature of CQL3: CREATE TABLE foo ( object_id int, version int, value int, PRIMARY KEY (object_id, version)); 回答2: In

图形数据库、NOSQL和Neo4j

 ̄綄美尐妖づ 提交于 2019-12-08 05:06:40
简介 在 众多不同的数据模型 里,关系数据模型自80年代就处于统治地位,而且有不少实现,如 Oracle 、 MySQL 和 MSSQL ,它们也被称为关系数据库管理系统(RDBMS)。然而,最近随着关系数据库使用案例的不断增加,一些问题也暴露了出来,这主要是因为两个原因: 数据建模中的一些缺陷和问题 ,以及在大数据量和多服务器之上进行水平伸缩的限制。两个趋势让这些问题引起了全球软件社区的重视: 在应对这些趋势时,关系数据库产生了更多的问题。这导致大量解决这些问题某些特定方面的不同技术的出现,它们可以与现有RDBMS相互配合或代替它们 - 亦被称为 混合持久化(Polyglot Persistence) 。数据库替代品并不是新鲜事物,它们已经以 对象数据库(OODBMS) 、层次数据库(如LDAP)等形式存在很长时间了。但是,过去几年间,出现了大量新项目,它们被统称为NOSQL数据库(NOSQL-databases)用户、系统和传感器产生的数据量呈 指数增长 ,其增长速度因大部分数据量集中在象Amazon、Google和其他云服务这样的分布式系统上而进一步加快。 数据内部依赖和复杂度的增加,这一问题因互联网、Web2.0、社交网络,以及对大量不同系统的数据源开放和标准化的访问而加剧。 本文旨在介绍图形数据库(Graph Database)在NOSQL运动里的地位

In MongoDB, how does on get the value in a field for an embedded document, but query based on a different value

◇◆丶佛笑我妖孽 提交于 2019-12-08 04:54:51
问题 I have a basic structure like this: > db.users.findOne() { "_id" : ObjectId("4f384903cd087c6f720066d7"), "current_sign_in_at" : ISODate("2012-02-12T23:19:31Z"), "current_sign_in_ip" : "127.0.0.1", "email" : "something@gmail.com", "encrypted_password" : "$2a$10$fu9B3M/.Gmi8qe7pXtVCPu94mBVC.gn5DzmQXH.g5snHT4AJSZYCu", "last_sign_in_at" : ISODate("2012-02-12T23:19:31Z"), "last_sign_in_ip" : "127.0.0.1", "name" : "Trip Jameson", "sign_in_count" : 100, "usertimes" : [ ...thousands and thousands of

Access subcollection in mongoid with rails form to edit and create new entry

三世轮回 提交于 2019-12-08 04:37:25
问题 I am using mongodb with mongoid in rails3. I am newbie to all this. My models are as shown below. class Californium include Mongoid::Document field :first_name field :License_type Field :Licese_expiry_date embeds_one :address end class Address include Mongoid::Document field :street field :city field :state field :zip embedded_in :Californium, :inverse_of => :address end My Controller class CaliforniaController < ApplicationController def index @california = Californium.all respond_to do

When to replace RDBMS/ORM with NoSQL/DocumentStore

元气小坏坏 提交于 2019-12-08 04:19:55
问题 I've looked at MongoDB/norm (but want a general document-oriented store answer). It seems really nice to work with and I'm interested in knowing when it should be used instead of RDBMS+ORM? What should i use for for instance: Stackoverflow similiar sites Social communities forums (I posted another more general question but it got a splendid answer that might be interesting for others, hence the new question) 回答1: All of the examples you mentioned can be built using a document store. Whether