加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

SQLite

发布时间:2020-12-13 00:05:48 所属栏目:百科 来源:网络整理
导读:When I first see the sqlite,I feel it's good . So I record something about it. self-contained: 1.sqlite is largely self-contained.It requires very minimal support from external libraries or from operating system.This makes if well suit for

When I first see the sqlite,I feel it's good . So I record something about it.

self-contained:

1.sqlite is largely self-contained.It requires very minimal support from external libraries or from operating system.This makes if well suit for use in embedded devices that lack the support infrastructure(基础设施) of a desktop computer.This also makes sqlite appropriate for use within applications that need to run without modification on a wide variety of computers of varying configurations.

2.sqllite is written in ANSI-C and should be easily complied by any standard C compiler.It makes mininal use of the standard C library.The only required c library functions called are:

.memset()

.memcpy()

.memcmp()

.strcmp()

.malloc(),free(),and realloc()

3.Communications between sqlite and the OS and disk are mediated through an interchangeable VFS layer.VFS modules for unix and windows are provide in the source tree.It's a simple matter to devise an alternative VFS for embedded devices.

4.The sqlite source code is available as an "amalgamation"(http://www.sqlite.org/amalgamation.html)- a single large c source code file.Projects that wanna include sqlite can do so simply by dropping this one source file(named "sqlit3.c") and its corresponding header("sqlite3.h")into their source tree and compiling it together with the rest of the code.Sqlite doesn't link against any external libraries(other than the C library,as described above) and does not require any special build support.


serveless:

1. Most sql database engines are implemented as a separate server process. Programs that want to access the database communicate with the servere using some kind of interprocess communication(tipicallly TCP/IP)to send requests to the server and to receive back the results.Sqlite does not work this way.With sqlite,the process that wants to access the database reads and writes directly from the database files on disk.There is no intermediary server process.

2.There are advantages and disadvantages to being serverless.The main advantage is that there is no separate server process to install,setup,configue,initialize,manage,and troubleshoot.This is one reason why sqlite is a "zero-configuration" database engine.Programs that use sqlite require no administratie support for setting up the database engine before they are run.Any program that is able to access the disk is able to use an sqlite database.On the other hand,a database engine that uses a server can provide better protection from bugs in the client application-stray pointers(流浪指针) in a client cannot corrupt memory on the server.And because a server is single persistent concurrency.

3.Most sql database engines are client/server based.of those that are serverless,sqlite is the only one known to this author that allows multiple applications to access the same database at the same time.


Sqlite is a compact library.With all features enabled,the library size can be less than 350KB,depending on the target platform and compiler optimization settings.If optional features are omitted,the size fo the Sqlite library can be reduced below 300KB,SQlite can also be made to run in mininal stack space(4KB)and very little heap(100KB),making sqlite a popular database engine choice on memory constrained gadgets such as cellphones,PDAs,and MP3 players.There is a tradeoff between memory usage and speed. sqlite generally run faster the more memory you give it.Nevertheless,performance is usually quite good even inlow-memory environment.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读