Systems Review Flashcards

1
Q

What is the actor model?

A

Used in multi-threaded, multi-CPU architectures with concurrent programming. Used to build highly concurrent and parallel systems. Running an OOP method requires coordination when accessed by multiple threads. One option is to add (distributed) locks around these methods to ensure only one thread enters the method at a time so internal state isn’t corrupted, but hurts performance. You can’t rely on local memory when threads are running on different CPU cores. Relying on stack-based error handling is problematic since a “caller” thread will delegate the task to “callee” thread. Instead of calling methods, actors send messages to each other. By sending a message, an actor delegates work to another actor. Each actor processes incoming messages sequentially (eliminating races) but different actors can work concurrently. The parent actor supervises its children actors. Actors modify only their private state and only affect other actors indirectly through messaging. Akka is a popular implementation of the actor model for Java and Scala

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a state machine?

A

An arbitrary service like a database. The reliability of a service can be increased by means of replication, running several instances of the service on different servers. Clients contact an entire cluster (made up of replicas communicating between themselves) to perform a service rather than a single server. One replica in the cluster serves as a leader and the others serve as followers. The leader acts on client requests and replicates commands to followers. The cluster can handle network partitions (servers getting disconnected from other servers) and server crashes gracefully as only as a majority of servers are available to the leader.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Blob storage?

A

Optimized for storing and retrieving massive amounts of unstructured data. Examples include videos, images, large text file. Common solutions include S3 and Google Cloud Storage.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a time-series database?

A

Specialize in storing time series data (eg events that happen over time). Good for aggregating data by time. Common use cases include logging or IOT or asset prices. Common solutions include InfluxDB and Prometheus.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a graph database?

A

Use for relational data that doesn’t make sense to store in a tabular format. Built on top of the graph model. Neo4j is the most popular option. Common use cases include social networks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a spatial database?

A

Optimized for storing geometric space (eg locations on a map). Rely on spatial indices, most common is quadtree (where every node has 0 or 4 children nodes - think of a grid where you can drill down by quadrants).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is sharding?

A

Split up main database into small databases called shards to increase throughput and avoid duplication/replicas. Can shard based on index value (eg customer name or region). This can lead to hot spots where certain shards are more heavily used. Can alternatively use hashing function. Typically a service would make a database request to a reverse proxy that would forward the request to the correct shard.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does leader election work?

A

A consensus algorithm that allow multiple nodes in a cluster to agree on a data value (ie who the leader is) such as paxos and raft. Zookeeper and Etcd are often used to implement leader election. These are highly available and strongly consistency key-value stores. Use a leader key with a value of the server that’s the leader.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What AWS service provides a networking service to connect communications between your services

A

VPC Lattice

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly