Archive for May 29, 2013

Wednesday, May 29, 2013 [Tweets] [Favorites]

Atomic Commit in SQLite

Jonathan Penn links to this great article about how SQLite works:

An important feature of transactional databases like SQLite is “atomic commit”. Atomic commit means that either all database changes within a single transaction occur or none of them occur. With atomic commit, it is as if many different writes to different sections of the database file occur instantaneously and simultaneously. Real hardware serializes writes to mass storage, and writing a single sector takes a finite amount of time. So it is impossible to truly write many different sectors of a database file simultaneously and/or instantaneously. But the atomic commit logic within SQLite makes it appear as if the changes for a transaction are all written instantaneously and simultaneously.

SQLite has the important property that transactions appear to be atomic even if the transaction is interrupted by an operating system crash or power failure.

Big Ice Cubes

I was hoping Dr. Drang would weigh in on this:

In some cases, they go beyond just saying that big cubes melt slower and also claim that they do so while cooling your drink just as much. These claims should be looked upon with a gimlet eye, because the cubes’ melting is what does the cooling.

No question, some of the cooling comes from raising the temperature of the ice from below freezing up to the melting point. But that’s small beer. The specific heat of ice (0.50 cal/g-K) is only about half that of water (and about equal to that of ethanol), so raising the temperature of ice does little to lower the temperature of your drink. The significant cooling comes from ice’s heat of fusion, which is a whopping 80 cal/g. This is what pulls heat out of your drink and lowers its temperature.

That said, I like the idea of The Sweethome.