Documentation Source Text

Hex Artifact Content
Login

Artifact 6b4e4ad63dcb12902e19cf551cbb41a0be9ae4c4:


0000: 3c 74 69 74 6c 65 3e 53 51 4c 69 74 65 20 49 73  <title>SQLite Is
0010: 20 53 65 72 76 65 72 6c 65 73 73 3c 2f 74 69 74   Serverless</tit
0020: 6c 65 3e 0a 0a 3c 68 32 3e 53 51 4c 69 74 65 20  le>..<h2>SQLite 
0030: 49 73 20 53 65 72 76 65 72 6c 65 73 73 3c 2f 68  Is Serverless</h
0040: 32 3e 0a 0a 3c 70 3e 0a 4d 6f 73 74 20 53 51 4c  2>..<p>.Most SQL
0050: 20 64 61 74 61 62 61 73 65 20 65 6e 67 69 6e 65   database engine
0060: 73 20 61 72 65 20 69 6d 70 6c 65 6d 65 6e 74 65  s are implemente
0070: 64 20 61 73 20 61 20 73 65 70 61 72 61 74 65 20  d as a separate 
0080: 73 65 72 76 65 72 20 70 72 6f 63 65 73 73 2e 0a  server process..
0090: 50 72 6f 67 72 61 6d 73 20 74 68 61 74 20 77 61  Programs that wa
00a0: 6e 74 20 74 6f 20 61 63 63 65 73 73 20 74 68 65  nt to access the
00b0: 20 64 61 74 61 62 61 73 65 20 63 6f 6d 6d 75 6e   database commun
00c0: 69 63 61 74 65 20 77 69 74 68 20 74 68 65 20 73  icate with the s
00d0: 65 72 76 65 72 0a 75 73 69 6e 67 20 73 6f 6d 65  erver.using some
00e0: 20 6b 69 6e 64 20 6f 66 20 69 6e 74 65 72 70 72   kind of interpr
00f0: 6f 63 65 73 73 20 63 6f 6d 6d 75 6e 69 63 61 74  ocess communicat
0100: 69 6f 6e 20 28 74 79 70 69 63 61 6c 6c 79 20 54  ion (typically T
0110: 43 50 2f 49 50 29 20 74 6f 20 73 65 6e 64 20 0a  CP/IP) to send .
0120: 72 65 71 75 65 73 74 73 20 74 6f 20 74 68 65 20  requests to the 
0130: 73 65 72 76 65 72 20 61 6e 64 20 74 6f 20 72 65  server and to re
0140: 63 65 69 76 65 20 62 61 63 6b 20 72 65 73 75 6c  ceive back resul
0150: 74 73 2e 20 0a 53 51 4c 69 74 65 20 64 6f 65 73  ts. .SQLite does
0160: 20 6e 6f 74 20 77 6f 72 6b 20 74 68 69 73 20 77   not work this w
0170: 61 79 2e 20 0a 57 69 74 68 20 53 51 4c 69 74 65  ay. .With SQLite
0180: 2c 20 74 68 65 20 70 72 6f 63 65 73 73 20 74 68  , the process th
0190: 61 74 20 77 61 6e 74 73 20 74 6f 20 61 63 63 65  at wants to acce
01a0: 73 73 20 74 68 65 20 64 61 74 61 62 61 73 65 20  ss the database 
01b0: 72 65 61 64 73 20 61 6e 64 20 0a 77 72 69 74 65  reads and .write
01c0: 73 20 64 69 72 65 63 74 6c 79 20 66 72 6f 6d 20  s directly from 
01d0: 74 68 65 20 64 61 74 61 62 61 73 65 20 66 69 6c  the database fil
01e0: 65 73 20 6f 6e 20 64 69 73 6b 2e 20 0a 54 68 65  es on disk. .The
01f0: 72 65 20 69 73 20 6e 6f 20 69 6e 74 65 72 6d 65  re is no interme
0200: 64 69 61 72 79 20 73 65 72 76 65 72 20 70 72 6f  diary server pro
0210: 63 65 73 73 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a  cess..</p>..<p>.
0220: 54 68 65 72 65 20 61 72 65 20 61 64 76 61 6e 74  There are advant
0230: 61 67 65 73 20 61 6e 64 20 64 69 73 61 64 76 61  ages and disadva
0240: 6e 74 61 67 65 73 20 74 6f 20 62 65 69 6e 67 20  ntages to being 
0250: 73 65 72 76 65 72 6c 65 73 73 2e 0a 54 68 65 20  serverless..The 
0260: 6d 61 69 6e 20 61 64 76 61 6e 74 61 67 65 20 69  main advantage i
0270: 73 20 74 68 61 74 20 74 68 65 72 65 20 69 73 20  s that there is 
0280: 6e 6f 20 73 65 70 61 72 61 74 65 20 73 65 72 76  no separate serv
0290: 65 72 20 70 72 6f 63 65 73 73 0a 74 6f 20 69 6e  er process.to in
02a0: 73 74 61 6c 6c 2c 20 73 65 74 75 70 2c 20 63 6f  stall, setup, co
02b0: 6e 66 69 67 75 72 65 2c 20 69 6e 69 74 69 61 6c  nfigure, initial
02c0: 69 7a 65 2c 20 6d 61 6e 61 67 65 2c 20 61 6e 64  ize, manage, and
02d0: 20 74 72 6f 75 62 6c 65 73 68 6f 6f 74 2e 20 0a   troubleshoot. .
02e0: 54 68 69 73 20 69 73 20 6f 6e 65 20 72 65 61 73  This is one reas
02f0: 6f 6e 20 77 68 79 20 53 51 4c 69 74 65 20 69 73  on why SQLite is
0300: 20 61 20 0a 22 3c 61 20 68 72 65 66 3d 22 7a 65   a ."<a href="ze
0310: 72 6f 63 6f 6e 66 2e 68 74 6d 6c 22 3e 7a 65 72  roconf.html">zer
0320: 6f 2d 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 3c  o-configuration<
0330: 2f 61 3e 22 20 64 61 74 61 62 61 73 65 20 65 6e  /a>" database en
0340: 67 69 6e 65 2e 20 0a 50 72 6f 67 72 61 6d 73 20  gine. .Programs 
0350: 74 68 61 74 20 75 73 65 20 53 51 4c 69 74 65 20  that use SQLite 
0360: 72 65 71 75 69 72 65 20 6e 6f 20 61 64 6d 69 6e  require no admin
0370: 69 73 74 72 61 74 69 76 65 20 73 75 70 70 6f 72  istrative suppor
0380: 74 20 66 6f 72 20 0a 73 65 74 74 69 6e 67 20 75  t for .setting u
0390: 70 20 74 68 65 20 64 61 74 61 62 61 73 65 20 65  p the database e
03a0: 6e 67 69 6e 65 20 62 65 66 6f 72 65 20 74 68 65  ngine before the
03b0: 79 20 61 72 65 20 72 75 6e 2e 0a 41 6e 79 20 70  y are run..Any p
03c0: 72 6f 67 72 61 6d 20 74 68 61 74 20 69 73 20 61  rogram that is a
03d0: 62 6c 65 20 74 6f 20 61 63 63 65 73 73 20 74 68  ble to access th
03e0: 65 20 64 69 73 6b 20 69 73 20 61 62 6c 65 20 74  e disk is able t
03f0: 6f 20 75 73 65 20 61 6e 20 53 51 4c 69 74 65 20  o use an SQLite 
0400: 64 61 74 61 62 61 73 65 2e 0a 3c 2f 70 3e 0a 0a  database..</p>..
0410: 3c 70 3e 0a 4f 6e 20 74 68 65 20 6f 74 68 65 72  <p>.On the other
0420: 20 68 61 6e 64 2c 20 61 20 64 61 74 61 62 61 73   hand, a databas
0430: 65 20 65 6e 67 69 6e 65 20 74 68 61 74 20 75 73  e engine that us
0440: 65 73 20 61 20 73 65 72 76 65 72 20 63 61 6e 20  es a server can 
0450: 0a 70 72 6f 76 69 64 65 20 62 65 74 74 65 72 20  .provide better 
0460: 70 72 6f 74 65 63 74 69 6f 6e 20 66 72 6f 6d 20  protection from 
0470: 62 75 67 73 20 69 6e 20 74 68 65 20 63 6c 69 65  bugs in the clie
0480: 6e 74 20 0a 61 70 70 6c 69 63 61 74 69 6f 6e 20  nt .application 
0490: 2d 20 73 74 72 61 79 20 70 6f 69 6e 74 65 72 73  - stray pointers
04a0: 20 69 6e 20 61 20 63 6c 69 65 6e 74 20 63 61 6e   in a client can
04b0: 6e 6f 74 20 63 6f 72 72 75 70 74 20 6d 65 6d 6f  not corrupt memo
04c0: 72 79 20 0a 6f 6e 20 74 68 65 20 73 65 72 76 65  ry .on the serve
04d0: 72 2e 20 0a 41 6e 64 20 62 65 63 61 75 73 65 20  r. .And because 
04e0: 61 20 73 65 72 76 65 72 20 69 73 20 61 20 73 69  a server is a si
04f0: 6e 67 6c 65 20 70 65 72 73 69 73 74 65 6e 74 20  ngle persistent 
0500: 70 72 6f 63 65 73 73 2c 0a 69 74 20 69 73 20 61  process,.it is a
0510: 62 6c 65 20 63 6f 6e 74 72 6f 6c 20 64 61 74 61  ble control data
0520: 62 61 73 65 20 61 63 63 65 73 73 20 77 69 74 68  base access with
0530: 20 6d 6f 72 65 20 70 72 65 63 69 73 69 6f 6e 2c   more precision,
0540: 20 0a 61 6c 6c 6f 77 69 6e 67 20 66 6f 72 20 66   .allowing for f
0550: 69 6e 65 72 20 67 72 61 69 6e 20 6c 6f 63 6b 69  iner grain locki
0560: 6e 67 20 61 6e 64 20 62 65 74 74 65 72 20 63 6f  ng and better co
0570: 6e 63 75 72 72 61 6e 63 79 2e 0a 3c 2f 70 3e 0a  ncurrancy..</p>.
0580: 0a 3c 70 3e 0a 4d 6f 73 74 20 53 51 4c 20 64 61  .<p>.Most SQL da
0590: 74 61 62 61 73 65 20 65 6e 67 69 6e 65 73 20 61  tabase engines a
05a0: 72 65 20 63 6c 69 65 6e 74 2f 73 65 72 76 65 72  re client/server
05b0: 20 62 61 73 65 64 2e 20 0a 4f 66 20 74 68 6f 73   based. .Of thos
05c0: 65 20 74 68 61 74 20 61 72 65 20 73 65 72 76 65  e that are serve
05d0: 72 6c 65 73 73 2c 20 53 51 4c 69 74 65 20 69 73  rless, SQLite is
05e0: 20 74 68 65 20 6f 6e 6c 79 20 6f 6e 65 0a 6b 6e   the only one.kn
05f0: 6f 77 6e 20 74 6f 20 74 68 69 73 20 61 75 74 68  own to this auth
0600: 6f 72 20 74 68 61 74 20 61 6c 6c 6f 77 73 20 6d  or that allows m
0610: 75 6c 74 69 70 6c 65 20 61 70 70 6c 69 63 61 74  ultiple applicat
0620: 69 6f 6e 73 0a 74 6f 20 61 63 63 65 73 73 20 74  ions.to access t
0630: 68 65 20 73 61 6d 65 20 64 61 74 61 62 61 73 65  he same database
0640: 20 61 74 20 74 68 65 20 73 61 6d 65 20 74 69 6d   at the same tim
0650: 65 2e 20 0a 3c 2f 70 3e 0a                       e. .</p>.