NoSQL

This one is reviewed but I need to delete its copy from hubpages or somewhere

NoSQL Data models:

  1. key-value 
    1. Aggregate model. 
    2. key or id is used to get the data. 
    3. Lookup is based on the key.  
  2. document
    1. Aggregate model. 
    2. key or id used to get the data. 
    3. Lookup is based on the fields in the aggregate in form of query. Parts of the aggregate are retrieved rather than whole. DB will create indexes on the aggregate. 
      1. People can put ids for lookup.
      2. Mostly the lookup will be on something else and not id. 
      3. Partial lookups are possible. 
  3. column family
    1. Data is organized into columns. 
    2. Useful in case of reads. 
    3. Imposes structure on the aggregate. 
  4. graph

Data distribution Model:
  1. Sharding: Distributes different data across different servers. 
  2. Replication: Copies data across multiple servers. Configurations include: 
    1. Master-Slave: 
      1. Master handles writes and sync with Slave
      2. Slave handles reads
      3. Reduces the chance of update conflicts. 
    2. Peer-to-peer:
      1. Any handle/system will be able to handle the writes. They will sync with each other. 
      2. Avoids single point of failure but will need to take care of conflicts. 
DB scaling Tips & Tricks: 
  1. Don't use shared databases for different applications. Instead use single database for single applications. Then get the data from different applications into Hadoop file system(shared Database). 
  2. Vertical Scaling: It means adding disk space, storage, memory. 
  3. Horizontal Scaling: It means adding more machines/clusters. 
  4. Relational databases can't work on clusters because they communicate to the single disk space. So by desing they will follow vertical scaling. 
    1. For different sets of data, rdbms runs on different servers(effectively sharding the data).
    2. Application layer takes care of which data is stored where. 
    3. RDBMS are usually single server and negotiation of contracts get tedious. 
    4. They are aggregate ignorant. 
  5. Polygot persistence: It means using different data stores in different circumstances.
  6. NoSQL is used as application DB and not integration DB.
  7. Aggregate orientation ensures that minimum number of nodes are queried to get the data. 
    1. It helps to aggregate data together to ensure that similar data lies on single node so querying is easy and optimized. 
    2. Its central to cluster. 
    3. DB will ensure data is stored together on nodes as aggregates.
    4. Manipulation of multiple aggregate need to happen at the application level. 
You might also like:


No comments:

Post a Comment

NoSQL

This one is reviewed but I need to delete its copy from hubpages or somewhere NoSQL Data models: key-value  Aggregate model.  key or i...