no sql Flashcards
what are the 4 types of data
structured and unstructured
dynamic and static
dynamic
changing frequently
static
never changes
strcutured
formal predefined
easy to store and process
unstructured
e.g. audio, image, music
usually still has internal structural properties
sharding data
splitting the data to allow concurrent/parallel access using multiple machines
can simultaneously access each shard
in which two ways can we scale databases
vertically and horizontally
vertical scaling
upgrading hardware e.g. increasing memory
what is the limitaiton of vertical scaling
limited by the amount of cpu ram disk etc that can be configured on a single machine
horizontal scaling
adding more machines which requires shading and replication so you can work with them simultaneously
what is the limitation of horizontal scaling
read-to-write ratio and communication overhead
in which three ways can we benefit form parallelisation
maximise the fraction of the program that can be parallelised
balance the work load and parallel process
minimise the time spent on communication
how does the two phase commit protocol work
the coordinator requests cote for commit and the participants either approve or reject
if all participants accept then everything gets committed at the same time
what is the issue with two phase commit
hard to find a time where all servers are ready to commit
what is the CAP theorem
any distributed database with shared data can have at most 2/3
usually sacrificing consistency