On Mon, 2003-06-23 at 03:55, Thies C. Arntzen wrote:
> On Sun, Jun 22, 2003 at 10:38:42PM -0400, Sterling Hughes wrote:
> > Hey,
> > 
> > Unless anyone objects I'm going to enable the sqlite extension by
> 
>     i object strongly. sterling, why have you gotten into the
>     enable-all, bundle-all mode lately? what do you gain?
> 

Well, I wouldn't say I'm in the enable-all, bundle-all mode.   But I'll
talk a little bit about why SQLite is über-cool, and why I think should
always be enabled.

Many times in PHP you don't really need a RDBM.  Whether its building a
weblog system, writing a Polling system, or a small content management
system.  In these cases many people either misuse a RDBM, causing major
headaches, or they use flatfiles, which cause even larger headaches.

Whoops, I forgot to lock.  Whoops, I used fread() on 20k of data, when I
only need 2k.  Whoops, I seek'ed through an entire directory, searching
for a file.  Whoops, this is getting annoying, isn't it? ;-)

In these cases, where you don't have the necessity of a transaction
based environment, and you aren't write-heavy, SQLite is a godsend.  It
provides a very intelligent file management and indexing system, coupled
with a data abstraction interface - SQL.  I imagine SQLite to be used
inplace of custom flatfile systems, and custom flatfile management.  Its
a small, low-level library that manages optimizes and manages file
access and manipulation.

Did I mention it also cooks your toast?

The second reason I want this enabled by default is that SQLite is the
end-to-end solution.  No database server required.  This means when
installed on shared hosting providers, they don't have to worry about
permissions management, performance issues, access partitioning,
replication, etc.  You as the PHP user also don't need to worry about
not having an SQL-esque solution available (it supports a larger subset
of ANSI 92 then MySQL btw).  SQLite is very respectful of permissions,
etc.  And, we can make it respect PHP safe mode, open base dir, etc. 
This makes it very shared host friendly.

So why bundle and enable by default?

Well three reasons.

a) It provides a very low memory footprint.  Its initialization costs
you nothing, and it only hurts you if you use it.  Compare this to
libmysql which caused 13% of total execution time in CGI mode, just to
find the MySQL port (I fixed this, but still).

b) Its a very small code size.  Compare sqlite and mbstring for
example.  1.9 mb, for the PHP extension, and the source code is
absolutely nothing.

c) In order for it to be useful for shared hosts, it needs to be always
enabled.  SQLite isn't yet very popular, and not many people know about
it.  Having something like this always available can be a great boon to
portable application development with PHP.

-Sterling

-- 
"A business that makes nothing but money is a poor kind of business." 
    - Henry Ford

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to