On Sun, Jun 12, 2011 at 11:18 AM, Yan Nagler <yan.nag...@broadlight.com>wrote:
> Hello dear SQLite users! > > > > My name is Yan Nagler. I am from Israel and currently work for Broadlight > Inc. > > > > We would like to adopt the SQLite for our needs. > > The main goal is probably as usual: having all the data centralized, > conceptually well-modeled via relational scheme, managed by SQL engine, and > restricted by its constraints system. > > > > But our potential implementation has number of principal limitations: > > 1. We are running on MIPS, so it has to be cross-compiled for this > processor > 2. OS is Linux > 3. The database has to be placed in Kernel space and accessed from > Kernel module(s) > 4. We need it “in-memory”. The database instance is built every system > launch: there is no need in persistent storage. Moreover, the storage > medium > is “flash”, so we have to preserve it from extra-writing. > > > > The questions: > > 1. Is this combination theoretically possible? > > Yes. > > 1. > 2. If it is, has someone observed an adaptation process like this? > > Yes. We are aware of another (well-known) company that has put SQLite into a Windows device driver. On windows (I'm not sure about Linux or MIPS) they had to disable floating-point operations since the floating point registers on x86 are not preserved on a kernel trap. Other than that, no significant modifications had to be made to SQLite in order to run it in kernel space. SQLite has minimal library dependences. You can disable the VFS module of SQLite (the part that writes to the filesystem) and have it hold all content in memory. With the VFS disabled, SQLite uses only a few simply library functions such as "strcmp" and "memcpy" so it will be easily supported in the kernel. SQLites malloc() and free() be default, but that can be overridden to use a different memory allocator, or to simply make due with a fixed amount of storage that is called at start time or boot time. > > 1. > 2. If someone has, what are the results: limitations, drawbacks, etc.? > > SQLite will easily cross-compile to MIPS. We are aware of commercial products that use SQLite on MIPS (though in user space). SQLite uses b-trees for storage. B-trees are optimized for block-oriented storage such as disk. For a pure in-memory database, red-black trees or AVL trees would probably be more efficient. But if the b-tree performance is adequate for you, then SQLite should work find in the application you describe. > > 1. > > > > I would be happy to any feedback and help. > > > > Sincerely, > > > > > > *Yan Nagler*** > > Software Engineer > > ** <http://www.broadlight.com/>** > > > > 7 Sapir St., Herzliya 46852, Israel > > t.: +972-9-9593-660 > > f.: +972-9-9593-665 > > m.: yan.nag...@broadlight.com > > * * > > > -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users