This one is reviewed but I need to delete its copy from hubpages or somewhere
NoSQL Data models:
- key-value
- Aggregate model.
- key or id is used to get the data.
- Lookup is based on the key.
- document
- Aggregate model.
- key or id used to get the data.
- 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.
- People can put ids for lookup.
- Mostly the lookup will be on something else and not id.
- Partial lookups are possible.
- column family
- Data is organized into columns.
- Useful in case of reads.
- Imposes structure on the aggregate.
- graph
Data distribution Model:
- Sharding: Distributes different data across different servers.
- Replication: Copies data across multiple servers. Configurations include:
- Master-Slave:
- Master handles writes and sync with Slave
- Slave handles reads
- Reduces the chance of update conflicts.
- Peer-to-peer:
- Any handle/system will be able to handle the writes. They will sync with each other.
- Avoids single point of failure but will need to take care of conflicts.
DB scaling Tips & Tricks:
- 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).
- Vertical Scaling: It means adding disk space, storage, memory.
- Horizontal Scaling: It means adding more machines/clusters.
- Relational databases can't work on clusters because they communicate to the single disk space. So by desing they will follow vertical scaling.
- For different sets of data, rdbms runs on different servers(effectively sharding the data).
- Application layer takes care of which data is stored where.
- RDBMS are usually single server and negotiation of contracts get tedious.
- They are aggregate ignorant.
- Polygot persistence: It means using different data stores in different circumstances.
- NoSQL is used as application DB and not integration DB.
- Aggregate orientation ensures that minimum number of nodes are queried to get the data.
- It helps to aggregate data together to ensure that similar data lies on single node so querying is easy and optimized.
- Its central to cluster.
- DB will ensure data is stored together on nodes as aggregates.
- Manipulation of multiple aggregate need to happen at the application level.
You might also like: