ObjectBox iOS SDK Development
The Context
ObjectBox needed an iOS SDK for their high-performance NoSQL database. The core was written in C++, and they needed someone who could bridge the gap between low-level performance of their cross-platform library and high-level Swift code.
Technical Challenges
There was a C API and some Java bindings for Android app development, but nothing for iOS – a hugely attractive market, of course.
For the existing C++ library core, I developed:
- The Objective-C++ wrapper layer, using Sourcery to generate boilerplate
- A user-friendly Swift API
The key achievement was that developers could keep writing plain Swift objects without inheriting overhead from the library. We wanted to keep the changes you needed to perform on your code to a minimum to adopt ObjectBox.
Team Dynamics
Apart from the CTO, who was sole developer of the actual C API, there was little cooperation with a team. The relative isolation eventually led to us parting ways, because I was looking for something more collaborative.
We stayed on good terms, so when shortly after I departed fellow Mac dev Uli Küsterer was looking for something new, I happily refered him to the team to help them ship the library fast. Uli has extensive C++ knowledge and was likely a much better fit than I.
Personal Reflections
This project taught me:
- How to design and adapt C APIs to interface with Swift
- Objective-C++ to Swift bridging
- FlatBuffers (Protobuf-like) usage in production systems
The API offered a Swift-y expression of constraints. This was in a time where Swift was more in flux, and before result builders, so we created a lot of syntactic sugar from scratch.
Impact
The iOS project was eventually frozen in favor of a focus on Internet of Things applications. However, the work done established patterns that could be reused for other platform bindings and demonstrated how to create developer-friendly APIs on top of high-performance C++ cores.