Times are hard
One of the things RavenDB does is allow you to define a backup task that will be executed on a given schedule (such as every Saturday at midnight). However, as it turns out, specifying the right time is actually a pretty hard thing to do. The problem is what to do when you have multiple time zones involved:
- UTC
- The server local time
- The operator’s local time
- The business hours of the application using the database
In some cases, you might have a server in Germany being managed from Japan with users primarily from South Africa. There are at least four different options for when Saturday’s midnight is, and the one sure thing is that it will happen when you least want it to.
Because of that, RavenDB takes the simple positon that the time that it cares about is the server's own time. An operator is free to define it as they wish, but only the server local time is relevant. But we still need to make the operator’s job easier, and we do it using the following method:
The operator can specify the time specification using CRON syntax (which should be common to most admins). We translate the CRON syntax to a human readable string, but we also provide the next backup date with the server’s time (when it will actually run), the operator’s local time (which as you can see is a bit different from the server) and the duration. The later is actually really important because it gives the operator an intuitive understanding of when the backup is going to run next.
Comments
Would it make sense here to show the time zone name with the local time and server time markers? I'm thinking here especially when the server is in a different time zone, but currently has the same offset from UTC as the local time zone. The various DST issues here somehow always crops up for me when I think I have all cases covered :) Showing the time zone name (ie. CET) should help the operator discover these issues.
Kaare, That is actually quite hard sometimes, and we have to draw the line at some point ;-) For example, the local admin time is from JS, the server side is from .NET. They don't always agree on such things.
I just gave up on trying to cover all bases. There is a a great talk by Matt about this here: https://www.youtube.com/watch?v=u9Q4qbbJ0Vw
Basically, time is stupid complex.
Comment preview