Book Image

Learning SQLite for iOS

By : Gene Da Rocha
Book Image

Learning SQLite for iOS

By: Gene Da Rocha

Overview of this book

The ability to use SQLite with iOS provides a great opportunity to build amazing apps. Apple's iOS SDK provides native support for SQLite databases. This combination offers the potential to create powerful, data-persistent applications. This book starts with the architecture of SQLite database and introduces you to concepts in SQL . You will find yourself equipped to design your own database system, administer it, and maintain it. Further, you will learn how to operate your SQLite databases smoothly using SQL commands. You will be able to extend the functionality of SQLite by using its vast arsenal of C API calls to build some interesting, exciting, new, and intelligent data-driven applications. Understand how Xcode, HTML5, and Phonegap can be used to build a cross-platform modern app which can benefit from all these technologies - all through creating a complete, customizable application skeleton that you can build on for your own apps.
Table of Contents (15 chapters)
Learning SQLite for iOS
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Write Ahead Logging with SQLite


Write Ahead Logging with SQLite, also known as WAL, is the standard method that states how SQLite implements the rollback and commit processes with this mobile database system. The disk access and input and output operations are more sequential, using the WAL methods. Using WAL will involve less of the fsync() functions and operations. It means it is more likely to work properly on different operating systems and smartphones. WAL is faster on most operations and provides better concurrencies, as there are no conflicts with processes reading and writing at the same time with a big reduction in any data block.

As much as there are advantages, there are also limitations to this method. WAL does not work efficiently with very large transactions, but much better with smaller transactions. For transactions of around 100 megabytes, it will work fine, but over a gigabyte, it will start to reduce its efficiency. There is also another issue: WAL could fail operations...