Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems
Rate it:
Open Preview
39%
Flag icon
TCP performs flow control
39%
Flag icon
backpressure), in which a node limits its own rate of sending in order to avoid overloading
39%
Flag icon
additional queueing at the sender before the
39%
Flag icon
TCP considers a packet to be lost if it is not acknowledged within some timeout
39%
Flag icon
and lost packets are automatically retransmitted.
39%
Flag icon
you can only choose timeouts experimentally:
39%
Flag icon
rather than using configured constant timeouts, systems can continually measure response times and their variability (jitter),
39%
Flag icon
TCP retransmission timeouts also work similarly
39%
Flag icon
network is synchronous:
39%
Flag icon
queueing, because the 16 bits of space for the call have already been reserved in the next hop of the network.
39%
Flag icon
bounded delay.
39%
Flag icon
You can give TCP a variable-sized block of data
39%
Flag icon
Why do datacenter networks and the internet use packet switching?
39%
Flag icon
that they are optimized for bursty traffic.
39%
Flag icon
On the other hand, requesting a web page, sending an email, or transferring a file doesn’t have any particular bandwidth requirement
39%
Flag icon
If you guess too low, the transfer is unnecessarily slow, leaving network capacity unused. If you guess too high, the circuit cannot be set up
39%
Flag icon
build hybrid networks
39%
Flag icon
ATM.iii
40%
Flag icon
Variable delays in networks are not a law of nature, but simply the result of a cost/benefit trade-off.
40%
Flag icon
However, such quality of service is currently not enabled in multi-tenant datacenters and public clouds, or when communicating via the internet.iv
40%
Flag icon
variable delays in the network,
40%
Flag icon
This fact sometimes makes it difficult to determine the order in which things happened when multiple machines are involved.
40%
Flag icon
which is an actual hardware device: usually a quartz crystal oscillator.
40%
Flag icon
so each machine has its own notion of time, which may be slightly faster or slower than on other machines.
40%
Flag icon
possible to synchronize clocks to some degree: the most commonly used mechanism is the Ne...
This highlight has been truncated due to consecutive passage length restrictions.
40%
Flag icon
Modern computers have at least two different kinds of clocks: a time-of-day clock and a monotonic clock.
40%
Flag icon
System.currentTimeMillis() in Java return
40%
Flag icon
calendar, not counting leap seconds.
40%
Flag icon
Time-of-day clocks are usually synchronized with NTP, which means that a timestamp from one machine (ideally) means the same as a timestamp on another machine.
40%
Flag icon
These jumps, as well as similar jumps caused by leap seconds, make time-of-day clocks unsuitable for measuring elapsed time
40%
Flag icon
A monotonic clock is suitable for measuring a duration (time interval),
40%
Flag icon
System.nanoTime() in Java are monotonic clocks,
40%
Flag icon
The name comes from the fact that they are guaranteed to always move forward
40%
Flag icon
On a server with multiple CPU sockets, there may be a separate timer per CPU,
40%
Flag icon
Operating systems compensate for any discrepancy and try to present a monotonic view of the clock to application threads,
40%
Flag icon
NTP may adjust the frequency at which the monotonic clock moves forward (this is known as slewing the clock)
40%
Flag icon
should). Clock drift varies depending on the temperature of the machine.
40%
Flag icon
Anecdotal
40%
Flag icon
NTP synchronization can only be as good as the network delay, so there is a limit to its accuracy when you’re on a congested network with variable packet delays.
40%
Flag icon
NTP clients are quite robust, because they query several servers and ignore outliers.
40%
Flag icon
The fact that leap seconds have crashed many large systems [38, 46] shows how easy it is for incorrect assumptions about clocks to sneak into a system.
40%
Flag icon
In virtual machines,
40%
Flag icon
When a CPU core is shared between virtual machines, each VM is paused for tens of milliseconds while another VM is running.
40%
Flag icon
a day may not have exactly 86,400 seconds,
40%
Flag icon
time-of-day clocks may
40%
Flag icon
move backward ...
This highlight has been truncated due to consecutive passage length restrictions.
40%
Flag icon
Thus, if you use software that requires synchronized clocks, it is essential that you also carefully monitor the clock offsets between all the machines.
40%
Flag icon
Database writes can mysteriously disappear: a node with a lagging clock is unable to overwrite values previously written by a node with a fast clock until the clock skew between the nodes has elapsed
40%
Flag icon
Even with tightly NTP-synchronized clocks, you could send a packet at timestamp 100 ms (according to the sender’s clock) and have it arrive at timestamp 99 ms (according to the recipient’s clock)
40%
Flag icon
Probably not, because NTP’s synchronization accuracy is itself limited by the network round-trip time,
1 13 28