Essential Architectural Building Blocks and Patterns Flashcards
(17 cards)
What are the core principles of API Design?
RESTful principles, versioning, authentication/authorization
REST (Representational State Transfer) principles include statelessness, cacheability, and a uniform interface.
What is the difference between SQL and NoSQL databases?
SQL is structured and relational, while NoSQL is non-relational and can be document-based, key-value, column-family, or graph
SQL databases use structured query language, while NoSQL databases are more flexible in data storage.
When should you use NoSQL databases?
When handling large volumes of unstructured data, requiring high scalability and flexibility
Common use cases include big data applications and real-time web apps.
What are common types of NoSQL databases?
- Key-value
- Document
- Column-family
- Graph
Each type has specific use cases, such as key-value stores for caching and graph databases for social networks.
Why is indexing important in databases?
It improves query performance by allowing faster data retrieval
Indexes can significantly reduce the amount of data scanned during queries.
What are the different levels of caching placement?
- Client
- CDN
- Application-level
- Database-level
Each level has its own benefits and trade-offs in terms of speed and consistency.
What are common caching strategies?
- Write-through
- Write-back
- LRU (Least Recently Used)
- LFU (Least Frequently Used)
These strategies help manage how data is stored and retrieved in cache.
What is a common challenge in caching?
Invalidation
Keeping cached data consistent with the underlying data can be complex.
What is the purpose of message queues?
Asynchronous communication, decoupling, buffering, fan-out
They help manage communication between different services or components in a system.
Name two examples of message queues.
- Kafka
- RabbitMQ
Both are popular tools for handling message brokering and event streaming.
What are the pros of microservices?
Scalability, flexibility, and independent deployment
Microservices allow teams to work on different components without affecting the whole system.
What are the cons of microservices?
Increased complexity, potential for inter-service communication issues
Managing many microservices can lead to challenges in coordination and consistency.
What is the CQRS design pattern?
Separates reads and writes to optimize performance
CQRS stands for Command Query Responsibility Segregation.
What is the Bulkhead design pattern?
Isolates failures to prevent system-wide outages
This pattern helps maintain service availability by containing faults.
What does the Circuit Breaker pattern do?
Prevents cascading failures in a system
It allows a system to gracefully handle failures and avoid overwhelming dependent services.
What is the Publisher/Subscriber design pattern?
Decouples components and allows asynchronous communication
This pattern helps in building event-driven architectures.
What is the purpose of the Retry Pattern?
Handles transient failures by retrying requests
It is commonly used in distributed systems to improve reliability.