Data synchronization between multiple pods in Kong DB mode

After the data is synchronized to the database through one pod, are the other pods fully or incrementally synchronized?

See https://github.com/Kong/kong/blob/master/kong.conf.default#L990-L1016

Configuration propagation happens in several phases:

  1. Whichever node receives the admin API request writes a change event (indicating what was modified and when) to the database.
  2. All nodes scan the events table at regular intervals (by default, every 5 seconds). When they see a new event, they retrieve the new configuration as needed.
  3. Routing and plugin configuration differs a bit from most configuration because of the way it’s stored locally. Those changes result in an event that indicates a change to the router version, and Kong checks to see if its router version is up to date either on every request (strict) or at a set interval (eventual, default 1 second intervals). If the version is out of date, Kong rebuilds the router.

The built router is handled per-worker, and workers’ intervals may start at slightly different times. eventual can therefore lead to workers briefly having a different configuration (e.g. for a new route, one worker routes the traffic while another 404s it). However, eventual generally results in less database load, as strict can encounter a scenario where many changes are made in quick succession, and it has to rebuild the router several times. eventual is fine for most use cases.


© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ