title: Whats the most efficient way to persist a Joda-Time `DateTime` object?
body: <p>I've written some Java software that very frequently persists and retrieves <a href="http://www.joda.org/joda-time/" rel="nofollow noreferrer">Joda-Time</a> <a href="http://www.joda.org/joda-time/apidocs/org/joda/time/DateTime.html" rel="nofollow noreferrer"><code>DateTime</code></a> objects from Redis.  I just serialise and deserialise the objects at present.  The software reads the objects about 50 times more often than it writes.  I've not profiled serialising/deserialising Joda-Time objects, but the software has scaled well, computationally, under load and I'm happy with the performance.</p>
  <p>What hasn't scaled well is memory usage.  The serialised Joda-Time objects are pretty big and a decent size Redis instance can only take about 3 days worth of customer data before I need to flush it out to a relational database on disk.  A secondary issue is Redis' own backup mechanisms seem harder to manage the larger the dataset gets...</p>
  <p>Setting aside the temptation to throw more RAM at the problem, I've thought of the following ideas so far:</p>
  <ul>
  <li>serialise then compress the objects before persisting</li>
  <li>persist as a ISO date format string</li>
  <li>persist as some other Joda-compatible string format</li>
  </ul>
  <p>I will try out and profile these before deciding, but I wonder if anyone can think of a more efficient way of reducing the memory footprint of persisted Joda objects without breaking the computational bank?</p>