Scott MacVicar presented on SQLite, an embedded SQL database engine that is serverless, public domain, and has a small footprint. SQLite is used by many applications and devices due to its portability and zero configuration. SQLite 3 introduced improvements like 64-bit row IDs, UTF support, and improved concurrency over SQLite 2. Benchmarks showed SQLite 3 generally outperforming MySQL in tests for insert, select, update and delete operations.
6. Public Domain?
May you do good and not evil.
May you find forgiveness for yourself and forgive others.
May you share freely, never taking more than you give.
14. Where can SQLite be used?
• Replacement for a custom file format
• Temporary data storage (Unit Tests) - :memory:
• Alternative to enterprise DB for demo
• Local node storage
• Communication between apps
• Embedded Devices
16. SQLite 3
• 64-bit Rowids • Connections shared
between threads
• BLOB support
• Runtime loadable
• Improved concurrency extensions
• UTF-16 / UTF-8 • Fulltext searching
• User defined collations • ICU support
• Named bound • OS Interface
parameters
17. SQLite v2
• Smaller subset of SQL supported
• Larger file format
• Database format incompatible with v3
• No Unicode support
• No reading while writing
18. Examples
• Firefox 3.0
• Profile directory contains places.sqlite
• Schema on the next page
• iPhone SMS
26. Custom Collations
• Sorting in alphabetical ☹ ☺
order
a a
• ICU also provides this i é
functionality
u i
• Use createCollation to é ó
define comparison ó u
function
34. Benchmarks - Insert
MySQL
10.0 SQLite 2
SQLite 3
7.5 SQLite 3 (nosync)
5.0
2.5
0
Test 1 Test 2
35. Benchmarks - Select
MySQL
10.0 SQLite 2
SQLite 3
7.5 SQLite 3 (nosync)
5.0
2.5
0
Test 3 Test 4
36. Benchmarks - Indices
MySQL
1.2 SQLite 2
SQLite 3
0.9 SQLite 3 (nosync)
0.6
0.3
0
Test 5 Test 6
37. Benchmarks - Update
MySQL
5.00 SQLite 2
SQLite 3
3.75 SQLite 3 (nosync)
2.50
1.25
0
Test 7 Test 8 Test 9
38. Benchmarks - Delete
MySQL
2.0 SQLite 2
SQLite 3
1.6
SQLite 3 (nosync)
1.2
0.8
0.4
0
Test 11 Test 12 Test 13 Test 14
39. Benchmarks - Summary
• SQLite 3 is faster in almost every test
• Using MyISAM would show faster results
• Doesn’t test concurrency
40. Converting from MySQL
• varchar, char -> text
• smallint, tinyint, int -> integer
• auto_increment -> autoincrement
• unknown types converted to text
• MySQLi functions have SQLite3 equivalents