Graph Databases, Column Stores, Key Value Stores and Document Databases Flashcards
Graph databases
This shows data as a mathematical graph
Advantages and Disadvantages of Graph Databases
- Used in data science as well and can really focus on relationships
- Often used as parts of larger systems to show the relationships
- However, can be issues with scaling as the graph gets bigger
Column Stores
They have tables like relational databases but data is stored in columns, not rows. not all rows will have the same number of columns
Advantages of Column Stores
- The performance of searching for a specific column is much faster
- It is able to retrieve all info from a column very quickly
The Disadvantages of Column Stores
- The performance of searching for a specific row is much slower
- The performance of adding a new row is not as good as a new value would have to be added to each of the columns
Hashing
- to directly search the location of desired data on the disk without using index structure
Advantages and disadvantages of hashing
- Can think of a hash table as being like an array
* BUT – a poor hash function can lead to key collisions
Key value stores
- Also known as a Dictionary, rather than a hash table
- The idea is that a simple key maps to a more complex value
- Is like an array of keys
- The values are the records in the table
- The records can have different fields to each other unlike a relational DB
Keys in key value stores
- Keys need to be unique to prevent the problem of key collisions
- Keys should not be too long for performance reasons
Values in key value stores
• The values can be anything – different databases permit different
data types
• However, can also be more complex such as sets, lists, code, images
or even key-value pairs again encapsulated in an object
Advantages of key value stores
Performance - querying is very quick
Data Variation- values can be different from each other
Disadvantages of key value stores
Lack of referential integrity - data in different values can contradict each other
Basic querying only - three operations: PUT, GET, DELETE
Document Databases
- Use document oriented model to store data
- They are self contained
- Similar to key value stores as they have keys
Advantages of Document databases
- Good if the data is varied – the documents can all contain different fields
- Key-value storage approach offers quick performance – fast to load and store documents
Disadvantages of document databases
Basic operations only- more advanced as key value store but not as advanced as SQL
No normalisation