Why I chose CoreData over Maildir

I’ve gotten a few e-mails now from people asking me why I have chosen CoreData over a standard mail format like Maildir. Kiwi will support Maildir for importing and exporting your mail (via Libetpan), but it will not be using it as it’s primary storage method. Here’s a few of the pro’s and con’s for each:

CoreData

Advantages

  • Fast
  • Atomic Commit
  • Manages object graph
  • Simplifies implementation of multithreading
  • Allows for easy integration of added metadata like tags
  • Disadvantages

  • Format is application specific
  • Makes Spotlight integration more difficult
  • Maildir

    Advantages

  • Standard mail storage format
  • One message per file makes Spotlight integration easy
  • Small memory footprint
  • Disadvantage’s

  • Slower
  • Makes persistence code much more complex
  • Makes implementation of the interface much more complex
  • It’s impossible for me to ignore the speed and ease that CoreData brings to the table. While there are definite advantages to using an open standard like Maildir, CoreData is going to make it easier implement more innovate features. In a way the format for Kiwi is not proprietary, since the application will be open source and everyone will have access to the schema for the SQLlite database. So hopefully, CoreData will be the right choice and will allow us to build a better app faster.


    4 Responses to “Why I chose CoreData over Maildir”  

    1. 1 Petteri

      Hi! I just wanted to remind you, that it is very difficult to change Core Data data models after they’ve been created. Or its not difficult to change them, but one has to manage migration from the old version to the new version manually in code. It may be easy just to extend a data model, and SQLite databases can be easier for Core Data to handle than say XML files. And maybe your data model is so mature right now (after all, email storage is not a new problem to solve), so you don’t need to worry about these things. I just wanted to point this out, in case you haven’t thought about it.

    2. 2 Sime

      And mbox? The most open and stable format?

    3. 3 Matt Ronge

      Sime,

      A lot of what I said above applies to many of the open mail formats. Since Kiwi is IMAP only, what it stores the local cache as doesn’t matter. All of your mail is on the server, so if Kiwi’s local cache gets corrupt or wiped out Kiwi will just redownload from the server.

    Leave a Reply