Thursday, February 13, 2020

Load Testing GCP - App Engine

Google Cloud Platform: App Engine

Design Components

App Engine Standard is region specific.

Compute Engine can be fired up in different regions


Types of Database Models

  • Relational
  • Document
  • Graph


Summary

  Document database models target use cases where data comes in self-contained documents and relationships between documents are rare. Graph databases target when there are a large amount of many-to-many. Relational are when there is both many-to-one and many-to-many. 


Relational (Best known: SQL)

  The relational model organizes data into relations (tables), with each relation being an unordered collection of tuples (rows). 

  Relational database models tend to enforce schema on write. Essentially requiring every table/row to have the same schema. The application code will then know exactly the schema to expect. 


Factors

  • Strong many-to-one and many-to-many relationships
    • Joins can be done in the query
    • Good for removing duplication
  • Migrations
  • Non-locality when normalized
  • Declarative programming queries

Document

  The document model organizes data into documents (trees).

  Document database models enforce schema on read (i.e. we can write any document structure), but when we read the document back, our application code needs to handle the logic of the document structure.


Factors

  • Strong one-to-many relationships
  • Handles heterogeneous data
  • Imperative programming queries


Graph

  The graph model organizes data into entities (vertices/nodes) and relationships (edges).

  They also only enforce schema on read.


Future Factors:

  • Fault-tolerance
  • handling of concurrency


  

Tuesday, February 11, 2020

Designing Systems - Reliability

Designing Systems - Reliability

  A system that should continue to work [performing the correct function at the desired level of performance] even in the face of [hardware or software faults, and even human error].


Fault - A component of a system deviating from its spec.

Failure - System as a whole stops providing the required service to a user.

Many Critical bugs are due to poor error handling

Hardware Faults

Examples are hard disks crash, RAM faulty, network down. Hard disks mean-time-to-failure is 10 to 50 years. 10,000 -> 1 per day. Can implement redundancy. 

Software Faults

Bugs, runaway processes, software starts responding with corrupted responses.

Can start by thinking about assumptions, interactions in the system, thorough testing, process isolation, measuring, monitoring, analyzing system behavior in production.

Final thoughts

  • Minimize opportunities for errors. Well-designed abstractions, APIs, admin interfaces.
  • Providing sandbox environments for exploration
  • Testing thoroughly at all levels - unit tests to integration to manual
  • Rollout and rollback systems
  • Telemetry
  • Management Practices and Training