惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Jina AI
Jina AI
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI
Help Net Security
Help Net Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
GbyAI
GbyAI
博客园_首页
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
MongoDB | Blog
MongoDB | Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
L
LINUX DO - 最新话题
PCI Perspectives
PCI Perspectives
博客园 - 三生石上(FineUI控件)
V2EX - 技术
V2EX - 技术
Spread Privacy
Spread Privacy
T
Tor Project blog
量子位
阮一峰的网络日志
阮一峰的网络日志
S
SegmentFault 最新的问题
小众软件
小众软件
博客园 - 叶小钗
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Blog — PlanetScale
Blog — PlanetScale
H
Help Net Security
Y
Y Combinator Blog
N
News | PayPal Newsroom
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
T
Tenable Blog
Scott Helme
Scott Helme
G
GRAHAM CLULEY
大猫的无限游戏
大猫的无限游戏
aimingoo的专栏
aimingoo的专栏
IT之家
IT之家
Schneier on Security
Schneier on Security
F
Fortinet All Blogs
Martin Fowler
Martin Fowler
T
Threat Research - Cisco Blogs
博客园 - 司徒正美
Application and Cybersecurity Blog
Application and Cybersecurity Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Attack and Defense Labs
Attack and Defense Labs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
The Last Watchdog
The Last Watchdog
L
LangChain Blog
C
Check Point Blog
Google Online Security Blog
Google Online Security Blog
V
Visual Studio Blog
Latest news
Latest news

blag

SQLite prefixes its temp files with `etilqs_` - blag Setsum - order agnostic, additive, subtractive checksum - blag Oldest recorded transaction - blag Replacing a cache service with a database - blag SQLite commits are not durable under default settings - blag PSA: SQLite WAL checksums fail silently and may lose data - blag Rickrolling Turso DB (SQLite rewrite in Rust) - blag How bloom filters made SQLite 10x faster - blag In search of a faster SQLite - blag Galloping Search - blag Building a distributed log using S3 (under 150 lines of Go) - blag Zero Disk Architecture - blag PSA: Most databases do not do checksums by default - blag PSA: SQLite does not do checksums - blag Disaggregated Storage - a brief introduction - blag Why does SQLite (in production) have such a bad rep? - blag SQLite Slaps - blag Now - blag Learning C - blag Snapshot Testing - blag Win: contribution to libSQL (SQLite) codebase - blag Errata in Hekaton MVCC paper - blag Internet is wholesome: MVCC edition - blag It is becoming difficult for me to be productive in Python - blag MongoDB secondary only index - blag Introducing CaskDB – a project to teach you writing a key-value store - blag Recurse Center: Winter Break - blag Recurse Center Day 24: Hacking Go compiler to add a new keyword - blag Recurse Center Day 20: Django v4 upgrade (from v1) - blag Recurse Center Day 19 - blag Recurse Center Day 18 - blag Recurse Center Day 17 - blag Recurse Center Day 16: Open Source - blag Recurse Center Day 15: B Tree Algorithms - blag Recurse Center Day 14: NoSQL Transactions - blag Recurse Center Day 13: Why 'Raft'? - blag Recurse Center Day 12: Isolation Anomalies - blag Recurse Center Day 11: B Tree Insertions - blag Recurse Center Day 10: Learning Distributed Systems - blag Recurse Center Day 9: Papers We Love - blag Recurse Center Day 8: B Tree Fill Factor (Part 2) - blag Recurse Center Day 7: Basics of ncurses - blag Recurse Center Day 6: B Tree Root - blag Recurse Center First Week - blag Recurse Center Day 5: Garbage Collection Algorithms - blag Recurse Center Day 4: B Tree fill factor - blag Recurse Center Day 3: Hammock Driven Development - blag Recurse Center Day 2: BTree Node - blag Recurse Center Day 1: init - blag What I want to do at Recurse Center - blag Accepted to the Recurse Center! - blag Towards Inserting One Billion Rows in SQLite Under A Minute - blag Marshaling Struct with Special Fields to JSON in Golang - blag I ended up adding duplicate records on a unique index in MongoDB - blag Setting up Github Actions for Hugo - blag Moving to Hugo - blag Catching SIGTERM in Python - blag Git/Github fork-pull request-update cycle - blag Using uWSGI with Python 3 - blag When is my Cake Day? - blag Staying Ahead of Amazon, in Amazon Treasure Hunt Contest - blag How I Am Maintaining Multiple Emails For Git On A Same Machine - blag An exploit on Gaana.com gave me access to their entire User Database - blag Flashing Asus-WRT Merlin by XVortex on NetGear NightHawk R7000 - blag Install Windows 8 UEFI on Legacy BIOS with Clover (and Dual boot with Yosemite) - blag Scraping Javascript page using Python - blag Installing Transmission (remote and CLI) client on Raspberry Pi - blag About - blag Projects - blag
Collection of insane and fun facts about SQLite - blag
2024-12-30 · via blag
  1. SQLite is the most deployed and most used database. There are over one trillion (1000000000000 or a million million) SQLite databases in active use.

    It is maintained by three people. They don’t allow outside contributions.

  2. SQLite is likely used more than all other database engines combined. Billions and billions of copies of SQLite exist in the wild. It’s everywhere.

  3. It is also probably one of the top five most deployed software modules.

  4. Hwaci is the company behind SQLite. They are also into music(?)

  5. SQLite originated from a US warship. D. Richard Hipp (DRH) was building software for the USS Oscar Austin, a Navy destroyer. The existing software would just stop working whenever the server went down (this was in the 2000s). For a battleship, this was unacceptable.

    So DRH asked the question: what if the database just worked without any server? In DRH words:

    Why do we even need a server? Why can’t I pull this directly off the disk drive? That way if the computer is healthy enough, it can run our application at all, we don’t have dependencies that can fail and cause us to fail, and I looked around and there were no SQL database engines that would do that, and one of the guys I was working with says, “Richard, why don’t you just write one?” “Okay, I’ll give it a try.” I didn’t do that right away, but later on, it was a funding hiatus. This was back in 2000, and if I recall correctly, Newt Gingrich and Bill Clinton were having a fight of some sort, so all government contracts got shut down, so I was out of work for a few months, and I thought, “Well, I’ll just write that database engine now.”

  6. Unlike most open source project that uses standard licenses (like MIT or GPL), SQLite does not come with a OSI-approved license.

    Instead, SQLite is released into the public domain and it has even fewer restrictions.

    Also note that this can be a problem in some countries/jurisdictions where public domain is not recognized. Hence, SQLite sells licenses, called ‘Warranty of Title’.

  7. They don’t allow outside contributions. You cannot just send a pull request and hope the patch will be accepted.

  8. Open Source, Not Open Contribution

    Contributing to SQLite is invite-only (I don’t have a source). Only after you are invited and have signed an affidavit dedicating your contribution to the public domain can you submit patches.

  9. How do they cook?

    There are over 600 lines of test code for every line of code in SQLite. Tests cover 100% of branches (and 100% MC/DC) in the library. The test suite is extremely diverse, including fuzz tests, boundary value tests, regression tests, and tests that simulate operating system crashes, power losses, I/O errors, and out-of-memory errors.

    SQLite first began as a Tcl extension, and its primary test suite is written in Tcl.

  10. Interestingly, some SQLite tests are proprietary. The test suite called TH3 (Test Harness 3), which achieves 100% branch coverage of the code, is proprietary and is not open to access.

    I don’t know any other project which has made code free, but test suites are paid.

    However, they could not sell a single copy of TH3. DRH said in a podcast:

    The 100% MCD tests, that’s called TH3. That’s proprietary. I had the idea that we would sell those tests to avionics manufacturers and make money that way. We’ve sold exactly zero copies of that so that didn’t really work out.

    In order to get access, one needs to be part of SQLite Consortium, which costs $120K/yearly.

  11. It’s an interesting business model. They generate revenue through licenses, paid support, maintenance services, consortium membership, and commercial extensions.

  12. SQLite does not have a Code of Conduct (CoC), rather Code of Ethics derived from “instruments of good works” from chapter 4 of The Rule of St. Benedict

  13. In SQLite: In place of a legal notice, here is a blessing:

    All the of the source code files come with a blessing.

  14. SQLite is so fast, they compete with fopen. For some use cases, you can use SQLite instead of a filesystem, that can be 35% faster.

  15. SQLite vs Redis (guess which is faster?)

    For some usecases, the SQLite can be faster than Redis due to network stack and (de)serialisation overhead.

  16. But, unlike most databases, SQLite has a single writer model. You cannot have more than one concurrent writer.

    This was also changed recently in 2010 by adding WAL mode. Before that, you could have either readers or a writer, but never together.

  17. There are other things which are very common in other databases but not in SQLite:

    • The default is rollback journal mode, which restricts you to have either multiple readers or a single writer
    • Foreign Keys are disabled; they are opt-in
    • It is “weakly typed”. SQLite calls it “type affinity”. Meaning you can insert whatever in a column even though you have defined a type. Strong typed columns are opt-in (by STRICT tables).
    • Many of the ALTER commands you expect in other databases don’t work. For example, you cannot add a contraint to an existing column. (They recently added ability to rename a column name)

    There is a whole list of quirks here.

  18. I hate that it doesn’t enforce types. It’s totally YOLO:

    CREATE TABLE user(id INTEGER);
    INSERT into user VALUES ("YOLO!"); --- This works!
    

    Not only that, it does not throw any error if you give some random type.

    CREATE TABLE t(value TIMMYSTAMP);

    There is no TIMMYSTAMP type, but SQLite accepts this happily.

    SQLite has five types: NULL, INTEGER, REAL, TEXT, BLOB. Want to know something cursed? The type affinity works by substring match!

    CREATE TABLE t(value SPONGEBLOB) --- This is BLOB type!
    

    So yeah, this happens too:

    Note that a declared type of “FLOATING POINT” would give INTEGER affinity, not REAL affinity, due to the “INT” at the end of “POINT”.

  19. This is one my favorite lore. SQLite had to change the default prefix from sqlite_ to etilqs_ when users started calling developers in the middle of the night

  20. SQLite takes backward compatibility very seriously

    All releases of SQLite version 3 can read and write database files created by the very first SQLite 3 release (version 3.0.0) going back to 2004-06-18. This is “backwards compatibility”. The developers promise to maintain backwards compatibility of the database file format for all future releases of SQLite 3.

  21. But they take backward compatibility so seriously that even if they have shipped a bug, they won’t fix it

  22. SQLite’s author D. Richard Hipp (DRH) did not find existing version control systems suitable. So he wrote his own called Fossil. Fossil is powered by SQLite, of course.

    This reminds me of how Linus wrote Git.

    DRH also wrote his own parser generator called Lemon.

  23. DRH wrote the B-Tree based on the algorithm in the book TAOCP by Donald Knuth, coding it on a plane while traveling (super based)

  24. SQLite is pronounced as “Ess-Cue-El-ite”. There is no official guideline though. DRH mentioned in the SQLite forums:

    I wrote SQLite, and I think it should be pronounced “S-Q-L-ite”. Like a mineral. But I’m cool with y’all pronouncing it any way you want.

    :-)

That’s it for today! If I missed any, let me know. Happy holidays and Happy New Year! 🎄 ☃️


1. Sources: Most Deployed, Public Domain and Contributions, Testing, Paid support, Faster than filesystem, SQLite History.
2. I posted this as thread on Twitter, where bunch of people provided more sources. Thanks to them: 1, 2, 3, 4, 5.
3. After following the discussions on Reddit and HN, I have rephrased the license section (#6). Previously, it read: SQLite is not open source in the legal sense, as “open source” has a specific definition and requires licenses approved by the Open Source Initiative (OSI).