My book on LevelDB is out

Cover of Getting Started with LevelDB

My book Getting Started with LevelDB has now been released from Packt Publishing. Despite the generic nature of the title, it’s focused on using LevelDB with iOS and OS/X so about half the code in the book is Objective-C. The sub-title you can vaguely make out above reads “Store and retrieve key-value based data quickly on iOS and OS X using LevelDB”. 

If you’re a C++ programmer on Unix of any kind, I think there’s enough value in the book for it to be worth getting – all the basics of using the C++ interface are discussed and the theory discussions are generic. I’m hoping to do some followup work to make it more useful to the pure C++ crowd especially on Windows.

I’ve created a forum for discussing the book content and associated open source frameworks.

The writing process for a first-time technical book was, as I’d been warned, many times harder than I’d expected.

In particular, the outline for the book is set in stone very early including page counts to which you have to get close. That didn’t seem like too much of a restriction until I realised swiftly that I hadn’t taken into account the effect of the stylesheet (in Word) on layout and the wordiness of Objective-C.

I’m not sure if there’s any other language as hard to wrap into a printed code sample:

NSString* tabSepStr = [NSString
  stringWithContentsOfFile:pathToBundledData(@"Sample500.txt")
  encoding:NSUTF8StringEncoding error:&openError];
NSArray* tabbedLines = [tabSepStr
  componentsSeparatedByCharactersInSet:
    [NSCharacterSet newlineCharacterSet]];

I’m reasonably happy with the book, although I’ll confess that I’m still playing around with some of the sample code in the later chapters. I got very ambitious with the APLevelDBSS extensions and am trying to scale them back to deliver something useful for complex keys without being a commitment to programming style such as OOFILE or Core Data.