System Design Basic Concepts Flashcards
Four main things to care about with system design
Performance, Scalability, Availability, Reliability
What do we call the hardware that runs a system?
Machine
What do we call the hardware a client uses?
Device
What’s the difference between a “service” and a “server”?
A server is an instance of a binary that provides many services
What does API stand for?
Application Programming Interface
What is an API?
It defines how programs interact with each other.
What is a good mental test for scalability?
How well could the program behave if capacity was increased ten-fold?
In what context would you use an Entity-Relationship Diagram?
Designing a database schema
What do you call the set of rules used for an Entity-Relationship Diagram?
Unified Modeling Language
What does UML stand for?
Unified Modeling Language
What is monolithic design?
When all software is built and deployed as a single unit
What are “microservices”?
When software is represented as a collection of independent services that communicate with each other
What is “loose coupling” vs. “tight coupling”?
Loose coupling is when different components and services have minimal dependencies on each other.
Tight coupling is when they’re highly-dependent on each other.
What is “high cohesion” vs. “low cohesion”?
High cohesion is when the logic, methods and classes of a single service are functionally related.
Low cohesion is when the service does a lot of overlapping things and has a vague role.
Why is high cohesion good? Four things.
It’s easier to maintain, deploy, test and understand?
What are the two models of interservice interaction?
Orchestration and Choreography
What is orchestration?
A model of interservice interaction one service is the “orchestrator” and manages communication between services.
What is choreography?
A model of interservice interaction where an event stream holds events and each service may produce events or subscribe (listen to) certain events.
What is persistence?
After data is written to a DB, it is stably stored on non-volatile memory.
Volatile vs. non-volatile memory
Volatile memory is erased when it is powered off, like RAM. Non-volatile is like a hard drive, which maintains data even when powered off.
What does NoSQL stand for?
Not Only SQL
What is NoSQL?
Catch-all term for DBs that don’t store data in tables, such as a key-value collection.
What is a normalized database vs. a de-normalized one?
In a normalized database, data is isolated and non-redundant.
A de-normalized database is when data from one table is copied to be part of another. An example is when you have a FrequencyCap table, and a FrequencyCap field on Campaign.
Vertical vs. Horizontal Scaling
Vertical scaling: Increase the resources of a single machine
Horizontal scaling: Adding more machines
Three examples of ways you can add to vertically scale
CPU, memory, storage
Two examples of ways to horizontally scale a database
Replication, sharding
Replication (in the context of a database)
When you copy data from the primary DB to multiple secondary read-only nodes.
Sharding (in the context of a database)
When you split data into smaller datasets, which you distribute.
Vertical partitioning (in the context of a database)
When data in a DB is sharded by-column.
How do you avoid imbalanced data when sharding a database? That is, one shard having a lot more data than the others.
You hash the shard key.
What does TCP/IP stand for?
Transmission Control Protocol / Internet Protocol
What is TCP/IP?
A model for how data is transmitted around the internet.
What are the four layers of TCP/IP?
Application layer (HTTP)
Transport layer (TCP)
Internet layer (IP)
Network Layer (LAN)
Internet Protocol
Rules for how data packets are routed across networks.
Transmission Control Protocol
Rules for how to deal with network unreliability, so data is reliable.
What does UDP stand for?
User Datagram Protocol
What is UDP?
Protocol for network unreliability handling – it’s a faster version of TCP that is OK with dropping packets?
In what situation might you want to use UDP over TCP?
When you’re OK with dropping packets, like for streaming video
What does SSL stand for?
Secure Sockets Layer
What does TLS stand for?
Transport Layer Security
What’s the relationship between SSL and TLS?
SSL is deprecated in favor of TLS.
What is SSL?
It encrypts connections between the client and server?
What is HTTPS?
It’s HTTP but secured by SSL.
What does DNS stand for?
Domain Name System
What does DNS do?
It resolves domain names to IP addresses.
Proxy
A server relaying traffic to/from the client, and applying logic to that traffic.
Reverse Proxy
A server that accepts requests from clients and forwards them to the server.
What’s the difference between a proxy and a reverse proxy?
Proxy = used by client
Reverse Proxy = used by server
What is the most common use case for a reverse proxy?
Load balancer
System Integration
Term for deciding how components share information
Database Integration
A system integration strategy where the database is the primary means of sharing information between components.
What does REST stand for?
Representational State Transfer