Main Flashcards
What is structured data
Data stored with high degree of organisation
SQL, CSV
Is tags and elements structured or semi-structured
Semi-structured
Why use cloud databases?
Ease of access
Faster time to market
Reduce risks
Lower costs
Scalability
Diaster Recovery
In a SQL Database each row is identified via a
primary key
The statements of inserting, retrieving , updating and deleting
data in relational databases are made by queries which are
written in
SQL
Advantages of Relational Databases (3)
Simple model and queries
Data accuracy (non-repetive)
Data integrity
High security
Limitations of Relational Databases (3)
- Difficult to maintain
- Cost to setup and main tain
- Large physical memory required
- Lack of scalability
- Complexity of structure
- Decrease in performance over time
What usecases widely make use of relational databases? (2)
-Store financial records of the whole industry
-Keep track of inventory
-Hold customer and supplier information
-Keep track of customer orders
-Keep record on employees
NoSQL is what type of database
Non_relational
NoSQL stores data in
Documents
Unique properties of NoSql vs SQL
Flexible data models (post deployment)
Handle huge volmes of rapidly changing unstructured data
What would this look like in NoSQL?
Advantages of NoSQL databases
Scale-out architecture - handle large volumes of data
Store strucutred, unstructured, semi-structured
EAsily update schemeas
Big Data
Disadvantages of NoSQL databases
Lack of standardization
Lack of cross-platform support
Security
Data consistency
Types of NoSQL databases
What is a graph database
Use graph to define relationsships between stored data points
Store and navigate relationships
Give examples of graph databses
Neo4j, Graph DB
Key-value databsed
Use a simple key-value
method to store data
Stores data as a collection
of key-value pairs
Key servers as a unique
identifier
What database stores content by colums rather than rows?
Wide-column database
Advatnages of a wide-columned database
Big data
Examples of wide columed databases
Google Cloud Bigtable, HBASE
Explain visual difference between row and column store
SQL and NoSQL Scaling
SQL = Vertical
NoSQL = Horizontal
Vertical scaling refers to
Adding more resources to your server as demand increases.
Existing code need not change
Horizontal scaling
Adding more servers as demand increases
Vertical vs Horizontal: Downtime
Longer downtime on Vertical
Less downtime on Horizonal
Single point of failure
Vertical vs Horizontal: Message passing
Easy Data sharing and message sharing on Vertical
Complex data sharing and message sharing on horizontal
Vertical vs Horizontal: Complexity
Horizontal increases complexity
2 types of database consistency models
ACID
BASE
ACID stands for
Atomic
Consistency
Isolation
Durability
ACID is used in ___ databases
SQL
BASE stands for
Basically Available - spread across node
Soft state = due to lack of immediate consistency, values may change
Eventually consistent - eventually reach consistent state
ACID v BASE
Difference between strong and eventualy cosnsitency
Strong consistency = Consistent the amount something sent
Eventual consistency = consistent after time as updates propogate
Eventual Consistency: server to client flows
Strong Consistency: server to client flows
What is Cap Theorem / Brewers Theorem related too?
Impossible for distribued system to provide certain charateristics
What guarantees does Cap theorem / Bewer’s refer to?
- Consistency - all clients see same view of data, even after updates
- Available- All clients can find a replicate of data set in case of partial node failure
- Partition-tolerance - system continues to work in case of network failure
Why is CAP theorem called CAP?
Acronym
Consitency
Avaliability
Partitioning
NoSQL schema type?
Pre-define or dynamic schema
What database type is preferred for large large amounts of data
NoSQL
Where a traditional web application might use PhP and MySQL, a Google Cloud website using Apps may use
AppEngine
Datastore
GQL stnads for
Google Query Language
Firebase
- Cloud hosted Real-time database
- Data is stored as JSON and synchronized in realtime to every connected client
- Automatically receive updates with the newest data
- Support: iOS, Android, Web, REST API, C++, Unit and Admin
Setup
Peformance v Scalability
Scalability is number of nodes
Peformance is how effective each node is
Scalng up/down
Vertical Scaling
Scaling out/in
Horizon scaling
On a simple level the “Horizontal Scaling Compute Pattern” is acheived by
Adding or releasing compute nodes
Is Horizontal Scaling Compute Pattern reversible
Yes
What controls the Horizontal Scaling Compute Pattern?
Cloud Platform Management Systems
UseCases for Horizontal Scaling Compute Pattern
Cost efficient scaling required
Application capacity requirements exceed capacity of largest node
Variable requirements
Minimal downtime
What pattern fits the following use cases?
Cost efficient scaling required
Application capacity requirements exceed capacity of largest node
Variable requirements
Minimal downtime
Horizontal Scaling Pattern
What are some caveats of Horizontal Scaling Compute Pattern
- Efficient utilization of resources
- Operational efficiency
What is:
The measure of how a module depends on other modules?
Coupling
Difference between couipling and cohesion
Cohesion - within the same module
Coupling - inbetween modules
Types of coupling
Tightly - Many dependencies
Loosely - some dependencies
Uncoupled
Limitations of tightly coupled
Increased complexity over time
Reduces scalability, portability
If service fails, entire app fails
Advantages of loosely coupled
A Failure in one component != casecase
System is more resilient
Graceful failure
What design pattern allows you to achieve decoupling?
Queue-centric workflow pattern
Queue provides a good way of ….
front end and backend decoupling
FIFO stands for
First in First Out
In a Queue-centric workflow the name of the bus is
Message Queue
Is a queue synchronous or asynchronous
Asynchrous
Are queues relaible?
Yes (e.g. triplicate nodes, multiple workers etc)
What compoennts are the traditional”back end” compoennts of a queue
Worker role
Can multiple workers read from a service bus queue
Usually yes
Can multiple “front end” instnaces feed to a single queue
Yes
What pattern would the following use cases suggest?
Work is time consuming
Work requires external service
Work is resource intensive
Work benefits from rate levelling
Queue-centric workflow pattern
Queues help to enable tiers to..
Scale indpendantly
What queue pattern aims to:
Optimize resources AND
Minimize Human Intervention
Auto scaling
How does an auto scaling pattern work
Continous monitoring of resources
Templetes
Deploy new resources automatically
Is vertical scaling pattern of the auto scaling pattern?
No
Types of auto scaling
Reactive
Predictive - machine learning loads
Scheduled - user defined
Benefits of auto scaling pattern
Lower cost
Automation
Service availability
Reliable performance levels
Improved fault tolernace
What types of cloud patterns are to do with scalability?
Horizontal Scaling COmpute Pattern
Queue-centric workflow pattern
Auto-scaling pattern
What types of patterns are to do with Eventual COnsistency?
MapReduce Pattern
Database Sharding Pattern
What is the logic for databse sharding pattern?
One database can’t handle all of data
Split data across multiple databases