nosql

Cassandra Schema Design

ぃ、小莉子 提交于 2019-12-24 16:48:04
问题 I'm continuing exploring Cassandra and I would like to create Student <=> Course relation which is similar to Many-to-Many on RDBMS. In term of Queries I will use the following query; Retrieve all courses in which student enrolled. Retrieve all students enrolled in specific course. Let's say that I create to Column Families. one for Course and another for Student. CREATE COLUMN FAMILY student with comparator = UTF8Type AND key_validation_class=UTF8Type and column_metadata=[ {column_name

How Cassandra file system interacts with platform file system

久未见 提交于 2019-12-24 15:56:44
问题 I am doing research regarding NoSql. I have found two DBs that are close to what I require for implementation. just wondering how the file system of these Nosql interacts with Windows/Linux file system? for instance, Cassandra uses Cassandra file system, so is it the case that it is a virtual file system that with help of JRE/JDK, it interacts with the platform file system? 回答1: The Cassandra File System is actually not required to use Cassandra. CFS only comes with DataStax Enterprise and

Why is it called NoSQL?

蓝咒 提交于 2019-12-24 15:33:33
问题 I've recently worked with MongoDB and learned about its schemaless design. However, I'm confused with the term NoSQL? Why is it called that? Doesn't it use SQL or SQL-like queries? I've also read from an article that the main difference lies in how data is stored. Is this true? In the case of MongoDB, it's stored like JSON documents. Also, I'm confused why I always see 'NoSQL vs relational databases'. Aren't NoSQL databases relational? I believe documents in MongoDB are still related/linked

Mongodb multi update with different value

时间秒杀一切 提交于 2019-12-24 14:43:07
问题 I have multiple document to update in mongodb , each document has to be updated with different value . Values to update is available in a JSON array . {_id :1 ,name :'A','place':'London'}, {_id :2 ,name :'B','place':'UK'}, {_id :3 ,name :'C','place':'USA'}, {_id :4 ,name :'D','place':'CANADA'}, {_id :5 ,name :'E','place':'India'} JSON array to update : [{_id :1 ,name :'l','place':'Indonesia'},{_id :2 ,name :'B','place':'UAE'}] I have to update _id 1,2 of my collection with new value in json

Three-Way Relationship in Firebase

非 Y 不嫁゛ 提交于 2019-12-24 14:24:30
问题 I've been learning a lot about denormalised data over the past few months, but I wanted to know if the following is possible in a flattened architecture world. I know how to handle two-way relationships in Firebase, but what about a three-way relationship. Let me explain... I have 5 items in my database, services , providers , serviceAtProvider , reviews and users . I want to be able to add providers to services and vice versa. I'd also like there to be a specific page for a provider inside a

App Engine Errors when trying to insert many entities in bulk with condition that property “UserNo” increases by 1 everytime an entity's inserted

拈花ヽ惹草 提交于 2019-12-24 13:54:07
问题 I want to insert many user entities in bulk. User entity has property Name & UserNo . The requirement is that the property UserNo will automatically increase by 1 every time a User entity was inserted. The following code works fine if I try to insert 1 record at a time. public void insertUser(String name){ Entity userEntity=new Entity("User"); long maxID=Utility.getPropertyMaxID("User", "UserNo")+1; userEntity.setProperty("Name",name); datastore.put(userEntity); } public static long

perform math in searchqueries mongodb

流过昼夜 提交于 2019-12-24 13:52:14
问题 Is there a way to perform math in the find function as is possible in MySQL? I have the following sql query for performing searches based on radius in MySQL: SELECT id,(3959 * acos(cos(radians(37)) * cos(radians(lat)) * cos( radians(lng) - radians(-122)) + sin(radians(37)) * sin(radians(lat)))) AS distance FROM markers HAVING distance < 25 ORDER BY distance LIMIT 0 , 20; And would like to be able to perform something similar in mongodb or node.js. Is this possible? 回答1: The MongoDB query

Multiple arrays of objects inside array of objects in MongoDB

只愿长相守 提交于 2019-12-24 13:33:57
问题 Fellow programmers. Is it considered as a bad practice to use such MongoDb model: { companyId: '', companyName: '', companyDivisions: [ { divisionId: '', divisionName: '', divisionDepartments: [ { departmentId: '', departmentName: '' }, ... ] }, ... ], }, ... Because right now it's getting complicated to update certain departments. Thanks. 回答1: I don't think this is a bad practice generally speaking . If your model resembles this data structure it is a good choice storing data this way,

Is Reservation System Suitable for Amazon DynamoDB / NoSQL?

北战南征 提交于 2019-12-24 12:18:05
问题 I'm working on basic restaurant reservation system and was thinking about using Amazon DynamoDB for this project. That being said, I'm not even sure if DynamoDB is suitable for something like this or if I should stick to MySQL RDS since some of the queries may be quite complex. Functionality I need: User will submit a " Find Table " form with date, time and party size. Check RESTAURANT table if date and party size is even allowed. Check BLOCKED table for blocked dates (holidays and other

What's a suitable storage RDBMS,NoSQL, for caching web site responses?

為{幸葍}努か 提交于 2019-12-24 11:13:49
问题 We're in the process of building an internal, Java-based RESTful web services application that exposes domain-specific data in XML format. We want to supplement the architecture and improve performance by leveraging a cache store. We expect to host the cache on separate but collocated servers, and since the web services are Java/Grails, a Java or HTTP API to the cache would be ideal. As requests come in, unique URI's and their responses would be cached using a simple key/value convention, for