Using an embedded DB (SQLite / SQL Compact) for Message Passing within an app?

Posted by wk1989 on Stack Overflow See other posts from Stack Overflow or by wk1989
Published on 2010-04-27T13:36:24Z Indexed on 2010/05/31 1:32 UTC
Read the original article Hit count: 206

Filed under:
|
|

Hello,

Just out of curiosity, for applications that have a fairly complicated module tree, would something like sqlite/sql compact edition work well for message passing?

So if I have modules containing data such as:

\SubsystemA\SubSubSysB\ModuleB\ModuleDataC, \SubSystemB\SubSubSystemC\ModuleA\ModuleDataX

Using traditional message passing/routing, you have to go through intermediate modules in order to pass a message to ModuleB to request say ModuleDataC.

Instead of doing that, if we we simply store "\SubsystemA\SubSubSysB\ModuleB\ModuleDataC" in a sqlite database, getting that data is as simple as a sql query and needs no routing and passing stuff around.

Has anyone done this before? Even if you haven't, do you foresee any issues & performance impact? The only concern I have right now would be the passing of custom types, e.g. if ModuleDataC is a custom data structure or a pointer, I'll need some way of storing the data structure into the DB or storing the pointer into the DB.

Thanks,

JW

EDIT

One usage case I haven't thought about is when you want to send a message from ModuleA to ModuleB to get ModuleB to do something rather than just getting/setting data. Is it possible to do this using an embedded DB? I believe callback from the DB would be needed, how feasible is this?

© Stack Overflow or respective owner

Related posts about design

Related posts about design-patterns