<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br><div><div>On 4 Sep 2011, at 11:34, Colin Guthrie wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: monospace; ">What do you think the best route forward here is?<br><br>1. Convert on the fly only.<br>2. Convert on the fly and write to disk.</span></span></blockquote></div><br><div>Although not directly related, I used to work on a mail server (Scalix) that periodically updated its database format using (2).</div></div><div><br></div><div>You captured the problems that we had with the two approaches very well. For the mail server, the cost of converting on the fly every time outweighed the cost of doing a conversion once on the first access quite substantially. There was a period just after the upgrade when things ran slightly slower although this could be avoided by scanning the entire database (an fsck-like operation).</div><div><br></div><div>However, performance issues aside (which don't apply in this case) there was one huge advantage: subsequent upgrades had nicely separated code. Given an item in the database (in Scalix's case) to get from version N to version M simply involved calling the each of the conversions from N, N+1, … N+M-1 in order. Once we decided that no one in their right minds would ever be using version N any more retiring it from the code base was basically "rm". In your case you can keep the old code until it no longer compiles :-)</div><div><br></div><div>Based on my experience with Scalix, I'd vote for (2) every time.</div><div><br></div><div>jch</div></body></html>