in reply to Re: Where to put an application database?
in thread Where to put an application database?

I agree with it depending upon the "kind of app" as you put it. Since this could be used by a number of different users I m leaning towards using /var as the data dir.

The bigger issue, in my mind, is having the database files be mode 666 maybe. I know that Oracle, MySQL and others are setuid to get around that, but I need to check the docs for SQLite to see if it does that, too.

You must always remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.

Replies are listed 'Best First'.
Re^3: Where to put an application database?
by roboticus (Chancellor) on Oct 17, 2014 at 17:54 UTC

    boftx:

    A lot of databases handle the permissions issue by having a separate server process that actually does the database work, and all clients just submit requests to that process to get the work done.

    SQLite, though, doesn't use a server process. Instead every client has a copy of the code to perform database updates. In that case, the file will need to be modifiable by everyone if you want them to be able to make any changes.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

      OUCH!

      You must always remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.
        OUCH!

        Yeah.

        As its creator, Richard Hipp, talking at PGcon 2014, said:

        SQLite is not a replacement for PostgreSQL. SQLite is a replacement for fopen().  [2]

        The SQLite docs contain a page called "Appropriate Uses for SQLite" [1], which says:

        SQLite supports an unlimited number of simultaneous readers, but it will only allow one writer at any instant in time. For many situations, this is not a problem. Each application does its database work quickly and moves on, and no lock lasts for more than a few dozen milliseconds. But there are some applications that require more concurrency, and those applications may need to seek a different solution.

        Wonderful tool as SQLite is: when compared with full-fledged RDBMS's it has some pretty heavy limitations. It's best thought of as a 1-person database (and the possibility for embeddedness is of course enormously useful (browsers, phones)).

        [1] http://sqlite.org/whentouse.html

        [2] Hipp's keynote at PGcon 2014

        [2] youtube version of Hipp's talk