Notes:
- Queries per second / Traffic / Concurrency
- Index size / Time per query
- Resiliency
Notes:
- Scaling reasons?
Notes:
- What are the two directions we can scale to?
Notes:
- (Dis-)Advantages of Scaling up?
- + Easy
- + Little overhead (network, hardware)
- - No fault-tolerance
- - No concurrency
- - Scaling limited by hardware
Notes:
Notes:
- (Dis-)Advantages of Scaling out?
- + Fault-tolerance, resiliency
- + Concurrency
- + "Unlimited" scaling
- - Complex
- - Overhead: Network, Monitoring
Notes:
- Partitioned index
- Distributed queries
Notes:
Term | Doc IDs |
---|---|
Book | #1, #2, #3 |
Information | #1, #2, #3 |
Retrieval | #1 |
Search | #2 |
Notes:
- How to partition? There are two ways along the axes of the table.
- By term
- By doc
Notes:
- How can the index be partitioned? Think of the Inverted Index.
Notes:
- (Dis-)Advantages of Term-partitioned index?
- + Single term queries are easy
- - Uneven distribution
- - Index updates hit all servers
Notes:
Notes:
- (Dis-)Advantages of Term-partitioned index?
- + Even distribution
- + Easy to update index
- + Completely independent partial indices
- - Even single query terms are complex
Notes:
- Number of nodes is fixed
$\text{node}(\text{doc}) = \text{id}(\text{doc}) , % , \text{num}(\text{nodes})$ $\text{node}(\text{#4}) = 4 , % , 3 = 1$
Notes:
- How to search with document-partitioned index?
Notes:
- What is the performance improvement? Assume a query takes 1s on a single node.
- 1 node:
$n$ documents per index$\approx$ $m$ seconds per query - 2 nodes:
$\frac{n}{2}$ documents per index$\approx$ $\frac{m}{2}$ seconds per query - …
- More traffic
- Less downtimes
Notes:
- How?
Notes:
- Benefits of more shards?
- Benefits of more replicas?
- Shard
-
- Slice of document collection
- Master / Leader / Primary
-
- Distribute requests to Replicas
- Distribute requests to other Masters
- Replica
-
- Contains all documents of shard
- Will actually handle queries
- Can become Master
Notes:
- More docs
- Better query parallelization
- A single query is faster
$\text{Shards} \times 2 \approx \text{Index} \div 2 \approx \text{Performance} \times 2$
Notes:
- Better resiliency
- Better concurrency
- More queries can be handled in parallel
$\text{Replicas} \times 2 \approx \text{Parallel queries} \times 2$
Notes: