-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 25/01/12 19:52, Ryan Macy wrote:
> I used API generically (not necessarily SQLites API)

You can't use SQLite's API although it wasn't clear you realised that!

> I am creating an application in python that uses an RESTful API to
> allow the user connect to my service and submit statements. It will
> return the result in JSON or XML. I would think I could spawn a new
> SQLite "instance" for each database the user creates. More or less I
> wanted to see if anyone else has successfully accomplished this or has
> pondered the plausibility of this scenario.

If you do that then the database being SQLite is irrelevant.  Any database
will work.  Unless there is almost no load though you'll want to use a
server whose operation more clearly matches the usage model.   You should
note that existing database APIs in web servers have to provide a lot of
extra functionality and details like connection pooling, timeouts, caching
etc.

SQLite doesn't work with networked file systems (see the FAQ) so for
practical purposes you'll only be able to run this on one server.  Not
much of a service then!

> This seems inconsequential

Huh?  If you are making it available as a service then you have to care
about authentication.  And identity - how do you tell users apart and keep
their databases separate?  How will you deal with attacks from malicious
users?  How will you add a security model to stop people from attaching
random files, using too much memory or CPU?  What about audit trails so
that if an account is hacked you can tell what the bad guys did?  And what
about SQLite's model where there are no per table permissions so a
connection with access can do anything to any data in database and
anything else they can attach?

> Everything has latency. I'm not sure where you're going with this.

In the SQLite API you ask for result rows one at a time.  If it takes 25ms
round trip time to ask for a row then there is no way to get more than 40
rows per second.

If you are using a longer distance network as clarified then you'll have
to batch up result rows but this will present difficulty with transactions
and locking (do you keep the db open between requests, how do you ensure
continuing requests hit the same process).

When using SQLite in process there is essentially no latency as there
isn't even a context switch.

> You came off as a prick, but maybe I didn't offer enough information...
> Or my question is not intelligent enough for youĆ 

I suggest reading the whole thing, but this is the pertinent part:

  http://catb.org/esr/faqs/smart-questions.html#keepcool

Roger


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk8g0nkACgkQmOOfHg372QRe9ACfUrJe987i2E8FDaZHqeKVRS3D
hJoAoNx5bqV9dnbTPk1HsqfnkNiNUBXj
=fhW/
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to