Mongo

February 22, 2018

Replication Set A replica set in MongoDB is a group of mongod processes that maintain the same data set A replica set can have only one primary capable of confirming writes with { w: “majority” } write concern election new leader takes about 10-30s before, after v3.2 ~2s Shared Cluster https://docs.mongodb.com/manual/tutorial/deploy-shard-cluster/ shard: Each shard contains a subset of the sharded data. Each shard can be deployed as a replica set. ... Read more

Cassandra

February 21, 2018

Data Model Map<RowKey, SortedMap<ColumnKey, ColumnValue>> CREATE KEYSPACE sports WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'datacenter1' : 2}; # you can tune the r/w consistency level with keyspace Availability versus Consistency CREATE TABLE crossfit_gyms_by_city ( country_code text, state_province text, city text, gym_name text, opening_date timestamp, PRIMARY KEY ((country_code, state_province, city), opening_date, gym_name) ) WITH CLUSTERING ORDER BY ( opening_data ASC, gym_name ASC ); Cassandra RDBMS Keyspace Database Column Family Table Partition Key Primary Key Partitioner A partitioner determines how data is distributed across the nodes in the cluster (including replicas). ... Read more

© 2018 | 朱曉清 | powered by Hugo