nosql

Nosql model structure

与世无争的帅哥 提交于 2019-12-20 06:47:07
问题 How would you structure your Cloud Firestore db. I have collections of Teams, Arenas and Games: public class Team { public String name; public String homeCourtId; } public class Game{ public String matchId; public String date; public Arena arena; public Team homeTeam; public Team awayTeam; } public class Arena { public String name; public String phone; public String email; public String address; public String postalCode; public String city; public String district; public String cordLat;

MongoDB - Advantage of using 12 bytes string as unique identifier instead of incremental value

天涯浪子 提交于 2019-12-20 05:38:30
问题 Is there any specific reason for MongoDB generating uuid as unique identifier instead of incremental values as unique identifier?. 回答1: Incrementing values or sequences require a central point of reference which is a limiting factor for scaling. ObjectIDs are designed to be reasonably unique IDs that can be independently generated in a distributed environment with monotonically increasing values (a leading timestamp component) for approximate ordering. ObjectIDs are typically generated by

Google App Engine Datastore, returning before it was updated for several seconds

大憨熊 提交于 2019-12-20 05:03:52
问题 So I have values I need to update in my datastore. I am using a transaction do so as seen below. After the update has been committed I send a result back to the client letting them know the update has went through. The client then sends another request for an updated list of items. All code executes correctly as far as I can tell, no errors thrown and eventually I do get the update requested showing as expected. My issue is even after the commit sometimes it is several seconds sometimes

Google App Engine Datastore, returning before it was updated for several seconds

五迷三道 提交于 2019-12-20 05:03:07
问题 So I have values I need to update in my datastore. I am using a transaction do so as seen below. After the update has been committed I send a result back to the client letting them know the update has went through. The client then sends another request for an updated list of items. All code executes correctly as far as I can tell, no errors thrown and eventually I do get the update requested showing as expected. My issue is even after the commit sometimes it is several seconds sometimes

Using firebase tree structure to represent a “document outline” structure directly

∥☆過路亽.° 提交于 2019-12-20 04:34:51
问题 How good/stupid would it be to use Firebase tree structure to directly represent a user-facing tree structure, like a "document outline" in "word processors"? As opposed to e.g. doing an SQL-join parent-child type of relationship and then building the tree via a projection (which would probably be slow). I know that there is a limit of 32 levels of nesting ( https://www.firebase.com/docs/web/guide/understanding-data.html ), which should be enough, as I cannot imagine a sane user wanting to do

Cassandra update column

帅比萌擦擦* 提交于 2019-12-20 03:17:04
问题 how can i update column in cassandra database?? columnfam{ username{ name:edds, surname:surname, email:mymail@rrr.com } } for example i need update surname?? im using php client PHPCASSA. thanx 回答1: As Octopus-Paul says, updates are the same as inserts. There's no need to read before writing, though. You can just do this: $column_family->insert('username', array('surname' => $new_surname)); 回答2: Have a look here cassandra-internals-writing (Look at comments 14 and 15). I guess that if you

MongoDB dot (.) in key name

让人想犯罪 __ 提交于 2019-12-20 02:35:27
问题 It seems mongo does not allow insertion of keys with a dot (.) or dollar sign ($) however when I imported a JSON file that contained a dot in it using the mongoimport tool it worked fine. The driver is complaining about trying to insert that element. This is what the document looks like in the database: { "_id": { "$oid": "..." }, "make": "saab", "models": { "9.7x": [ 2007, 2008, 2009, 2010 ] } } Am I doing this all wrong and should not be using hash maps like that with external data (i.e.

How to read the cassandra nodetool histograms percentile and other columns?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-20 01:39:09
问题 How to read the cassandra nodetool histograms percentile and other coulmns? Percentile SSTables Write Latency Read Latency Partition Size Cell Count (micros) (micros) (bytes) 50% 1.00 14.24 4055.27 149 2 75% 35.00 17.08 17436.92 149 2 95% 35.00 24.60 74975.55 642 2 98% 86.00 35.43 129557.75 770 2 99% 103.00 51.01 186563.16 770 2 Min 0.00 2.76 51.01 104 2 Max 124.00 36904729.27 12359319.16 924 2 回答1: They show the distribution of the metrics. For example, in your data the write latency for 95%

Find some values in a mongodb collection?

谁都会走 提交于 2019-12-20 01:37:48
问题 Im trying to read a (mongo)userdatabase with java. On the tutorial page I saw how to read the whole collection. I can do something like that: DBCursor cursor = col.find(); while (cursor.hasNext()) { System.out.println(cursor.next()); } Now if I have a collection with users := name, age, password (...) and whatever. Now I would like to find a name with a password. For example for a login process. Lets say I have two strings: String n and p. If there is a user.equals(n) and a password.equals(p)

Find some values in a mongodb collection?

安稳与你 提交于 2019-12-20 01:37:20
问题 Im trying to read a (mongo)userdatabase with java. On the tutorial page I saw how to read the whole collection. I can do something like that: DBCursor cursor = col.find(); while (cursor.hasNext()) { System.out.println(cursor.next()); } Now if I have a collection with users := name, age, password (...) and whatever. Now I would like to find a name with a password. For example for a login process. Lets say I have two strings: String n and p. If there is a user.equals(n) and a password.equals(p)