Multi-node deployment
Add support for a multi-node deployment.
For example, if a company has users in California and London, they may want to have a primary Keylay server hosted in California, but also have a secondary server in London.
The secondary server would link up to the primary and keep a memory cache the keyword database reducing latency for users of the secondary server.
All the sysadmin would need to do is change the DNS record in the London zone to point to the secondary server.
In terms of cache consistency, the flow would look like this:
- Secondary server spools up and populates memory cache
- On cache hit, serve the URL
- On cache miss, connect to the primary DB and update the cache with the result
This would causes a bit of a slowdown on the initial cache miss, but subsequent requests should hit the cache.
We could also have the second server periodically re-cache (maybe every 5-10 minutes) to avoid these cache misses. Since users may be working in different time zones in this scenario, that may be reasonable.