Source: https://databento.com/docs/architecture/ntp-service


# Databento NTP service

Network Time Protocol (NTP) is an internet protocol commonly used to synchronize time
between computer systems over a network. The Databento NTP service is a free public
time service, based on NTP, that's available to everyone over internet and public
cloud.

### Who should use this

Databento's NTP service is ideal for financial users using proximity hosting
services and public cloud providers like AWS, Azure, and GCP, and for users whose
servers are located in the Chicago, New York, and New Jersey metro regions. While more
accurate time synchronization practices exist for these users, the next marginal
improvement for these users over our NTP service will require dedicated hosting
or cross-connects, which are significantly more costly.

All live data users connecting to Databento over internet are strongly recommended to
use this time service to ensure that their local system clock is synchronized against
Databento's internal time source and that latency estimates taken between local
timestamps and Databento timestamps are more accurate.

### Getting started

Anyone can synchronize their clocks against our time service by
pointing their NTP client at **ntp.databento.com**.

Alternatively, you can pick specific servers from this pool, as follows:

| Server | Data center | Location |
| `ntp-01.dc3.databento.com` | CyrusOne Aurora I | 2905 Diehl Rd, Aurora, IL 60502 |
| `ntp-01.ny4.databento.com` | Equinix NY4 | 755 Secaucus Rd, Secaucus, NJ 07094 |
| `ntp-02.ny4.databento.com` | Equinix NY4 | 755 Secaucus Rd, Secaucus, NJ 07094 |

### Recommended configuration

Here are some recommendations for obtaining good accuracy on your system clock against
our NTP service:

- Use a high quality NTP client implementation, such as [chrony](https://chrony-project.org/).
- In most cases, you should only step the clock in the first few updates, before your
application starts. You can configure this with the `makestep` directive in your chrony
configuration:

```
makestep 1 3
```

- Ensure your system clock is only adjusted by **slewing** while your application is
running. This means that your clock is adjusted by slowing down or speeding up instead
of stepping, which ensures monotonic timestamps. By default, chrony adjusts the clock
by slewing.
- However, if your system does not have a real-time clock or is a virtual machine
which can be suspended and resumed with an incorrect time, it may be necessary to allow
stepping on every clock update, as follows:

```
makestep 1 -1
```

In summary, you can add the following lines to your chrony configuration file,
found at `/etc/chrony.conf` or `/etc/chrony/chrony.conf`:

```
pool ntp.databento.com iburst minpoll 4 maxpoll 4

# Step the system clock instead of slewing it if the adjustment is larger than
# one second, but only in the first three clock updates
makestep 1 3
```

You can check that chrony is now using your new NTP sources with the `chronyc sources`
command.

### Architecture - How it works

Since the margin of error in time synchronization is largely a function of distance
and hops to the time source, Databento's NTP service leverages our network of colocated
servers at various financial data centers to help users obtain more accurate time.

The Databento NTP service is composed of a pool of Stratum 1 NTP servers at the
CyrusOne Aurora I and Equinix NY4 data centers. In contrast, common time providers
usually situate their time servers in general-purpose data centers that are further
from popular colocation and proximity hosting sites used by financial firms.

Another important reason to use Databento's time service is the nature of its clock
source. The time servers for our service are synchronized against the same PTP time
source used for supplemental receive and outbound timestamps in our data, thus our
time servers have a margin of error under 200 nanoseconds:

```
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
#* PTP                           0   0   377     1     +9ns[  +11ns] +/-  159ns
```

In turn, our PTP source is based on a pair of grandmaster clocks with under 25
nanosecond root-mean-squared error against UTC. Other public NTP services do not
provide any guarantees about the quality of their clock sources--even if you were to
obtain a time sync to their NTP servers with sub-millisecond tolerance, you may still
be off from UTC by tens of milliseconds.
