Re: [PECL-DEV] New extension: chdb
[email protected] (Lorenzo Castelli) Sat, 5 Jun 2010 18:20:22 +0200
| Newsgroups | php.pecl.dev |
|---|---|
| Message-ID | <1275754822.4084.43.camel@lorenzo-desktop> |
On Sat, 2010-06-05 at 16:12 +0200, Pierre Joye wrote: > Hidef idea is to make contants cost free, no runtime initialization. > That's its primary goal. > > The constants are stored in a simple ini file, that's the difference > with your extension. A backend based design would allow both a DB or > whatever else we could imagine while having the benefits of hidef's > primary goal. It will also avoids to have one extension per storage. hidef seems to implement 2 different backends with 2 different interfaces: an ini file backend which directly provides PHP constants, and a PHP serialization backend (FrozenArray) with an array interface. The interface provided by the ini file doesn't seem fit for chdb, as iterating through the whole database and registering the constants would partially kill the purpose of using memory-mapped files. The interface provided by the FrozenArray backend is a standard array interface, and can indeed be suitable for chdb as well. Moving to that interface can in fact be a good idea. On the other hand moving chdb into the same extension as hidef doesn't seem like a good choice to me. For example at Hyves we would have no interest in loading hidef code with chdb, since we only use chdb. I think the reverse is true for people only using hidef. As the two libraries are mostly alternative, I think this would cover most of the cases. And if somebody really wants to use both systems, he can easily load both binaries. By exposing the same interface to PHP code, even in two different extensions, we can still make it easy for people to switch from one implementation to the other. As I said this might be a nice modification for chdb in the future. Lorenzo Castelli