'Lite' Databases (Re: sqlite3 and dates)

rurpy at yahoo.com rurpy at yahoo.com
Thu Feb 19 15:26:04 EST 2015


On 02/19/2015 12:23 AM, Chris Angelico wrote:
> On Thu, Feb 19, 2015 at 6:07 PM, Steven D'Aprano <steve+comp.lang.python at pearwood.info> wrote:
>> Very possibly. With modern dependency management, it isn't hard to install
>> Postgresql:
>>
>> sudo aptitude postgresql
>>
>> or equivalent should work. For primitive operating systems with no
>> dependency management available, Firefox could come with a simple script
>> which downloads, installs, configures and runs Postgresql. (Everything is
>> simple for the guy who doesn't have to do it.)
> 
> Definitely a possibility. I'm pretty sure I've seen that exact thing
> done by one application (on Windows; on a typical Linux system,
> that'll be done by simple dependency management - your package
> metadata says "depends on postgresql" and apt-get or yum or whatever
> will do the work), and it's quite common for a Windows installer
> wizard to go through a series of subcomponents (grab the .NET
> framework, grab these hotfixes that the program depends on, grab some
> adware toolbar that you forgot to untick, and *then* install the
> program you asked for).
> 
>> Possible snags:
>>
>> - Possibly postgresql is simply *too big*. Your 50MB(?) Firefox
>>    turns into a 2GB install. I doubt it -- on Debian, postgresql
>>    is 17MB installed. But I don't know what dependencies I'm not
>>    counting.
> 
> Yeah. And frankly, I would be surprised if Firefox is only 50MB these
> days. The extra dent of PostgreSQL won't be all that significant - and
> don't forget that the SQLite3 dent can be removed, so you're talking
> about the difference between them, plus you can omit a whole bunch of
> PG's ancillaries.
> 
>> - Or it is impossible to configure without excessive amounts of
>>    tech-savvy human intervention. Again, I doubt it. I seem to
>>    recall needing to create a Postgresql user and password. But
>>    maybe even that is too technical for the average Firefox user.
> 
> You don't even need to do that. An absolutely default Postgres on
> Debian or Ubuntu is ready to use, with peer authentication. If you can
> become root, you can then drop privs to the 'postgres' user and
> connect to the database that way.
> 
> I don't know if it's possible to do a non-root installation of
> PostgreSQL, but if it isn't today, it could easily be tomorrow, if
> someone puts in a little effort. You'd miss out on boot-time startup,
> and it'd probably have to do some password-based authentication (with
> autogenerated passwords), but it certainly could work. The Windows
> equivalent ("install for just me") is, I think, already possible.
> 
>> - Maybe there are nasty interactions between Postgresql listening
>>    on some port and Windows firewall wanting to block that same port.
> 
> That's definitely an issue, given that Windows doesn't have Unix
> domain sockets. But I'm sure it's a solvable problem. How does IDLE
> cope with firewall issues?

There's an awful lot of "could"s, "possible"s etc in your 
and Steven's responses.  And most of those words apply to
issues that aren't problems at all when using Sqlite.

I'll point out that five people in this thread (by my 
count) have said that Postgresql requires a significant 
amount of work to setup and use.  Only you and Steven claim
the opposite.  (And it sounds to me like Steven does not 
have a lot of experience installing, configuring and 
maintaining Postgresql -- please correct me if I am wrong 
Steven.)

I've used Postgresql for a number of small to medium size 
projects for work and personal use.  I too think it is an 
amazing piece of work for free  software.  Consequently I 
used it for a small educational app I developed for my 
personal use.  A number of friends saw it, liked it and 
asked about using it themselves.  Unfortunately none of 
these friends were at all technical and the barrier of 
installing and configuring Postresql would have involved 
me in trying to talk them through it on the phone (risky 
as there were OSs I was unfamiliar with involved) or do 
it myself in person (one of them was 2000mi away) or do 
it remotely (again a cost in coming up with and installing 
remote desktop software on different OSs and non-technical 
doubts about its use ("I don't mind you doing this while 
I'm siting beside you but remote access is a different 
story").  Then there are the ongoing maintenance issues 
I mentioned in my last reply to Steven.

None of these would have been impossible to overcome with
more effort and expense.  Or I could have tried as you 
and Steven suggest to "somehow" package Postgresql in my 
app installer.  That would have been an even bigger cost 
in my time with an uncertain outcome.  None of those 
costs would have been necessary at all had I developed 
a self-contained Sqlite app.

Finally keep in mind that if you develop your app using
Sqlite, it is likely to be far easier to migrate to
a heavy-duty backend like Postgresql later should you 
need to than to go in the other direction when you find 
out you didn't really need Postgresql after all and the 
cost turned out to be higher than you expected.

Postresql is a wonderful tool when used where its features 
are needed.  It is not so wonderful used when a less heavy-
weight solution is can provide the necessary functionality.
To insist on using Postgresql in such circumstances is 
technical masturbation.

It is bad advise to recommend using Postgresql without 
regard to the developer's actual needs.



More information about the Python-list mailing list