On Apr 26, 2012, at 06:36 PM, Pierre-Yves Chibon wrote:
The current version of HK relies on mongodb for the storage, but I want to test HK with a traditionnal SQL backend. So I have started to work on this.
The interface I defined is there: https://github.com/pypingou/kittystore/blob/master/kittystore/__init__.py
And its implementation using SQLAlchemy is there: https://github.com/pypingou/kittystore/blob/master/kittystore/kittysastore.p...
The mongodb implementation isn't done yet but should be quite trivial to do (most function from the API were coming from it).
The idea is that now, we can have different backend and each module needing access to the emails can use the API directly without having to bother about which storage system is behind.
Follow on thoughts to my previous message.
Let's say you hate the default prototype archiver because mbox is too slow. Further, let's say you have an amazing implementation of the backend message store based on mongodb. How does that fit into my previous picture?
Actually quite easily I think. As long as you can expose insertion into the archiver with the IArchiver interface, and extraction from the archiver via the IMessageStore interface, these two bits can replace the default implementations, just by changing how the ZCA maps the interfaces to implementations. This mongodb-based message-storage-core can even live outside the core process, and *still* be available to in-process Python code, or exposed by the core in its REST API. It would just take a little extra IPC hidden behind the implementations of those two APIs.