SpatialDev is very excited about the launch of the new (To) app (available in the App Store). (To) enlisted the help of SpatialDev to be their technology partner in building this app. (To) puts powerful location tools in the hands of those facing life transitions, where location is the driver for success and happiness. Whether you’re searching for the right school, making a career shift, contemplating retirement or even a change in family status—choosing the right “place” can be an advantage from the start. (To) delivers location information for the perfect fit of lifestyle, family and career aspirations. You can learn more about the app here.
We sat down with Clint Cabanero and Rich Gwozdz, the two lead developers on this project to learn more about the process of building this app:
What are some of the ways the (To) app pushes beyond the “out of the box” iOS?
The iOS platform provides us a lot of options for implementing apps with custom User Interfaces. Throughout the life of this project we’ve used a range of tricks - from simple custom CollectionView cell subclasses to implementing custom controls that require we write the CoreGraphics code to render custom UI elements. This was perhaps one of the most challenging (and rewarding) aspects of the application.
This app brings together a ton of really interesting content, that curated by the (To) team and from other services. How were you able to make all of it appear seamlessly to the users?
Based on a user’s location preference and profile (e.g. medical specializations of interest), we use the ‘Feed’ to pull together an assortment of medical-related jobs, events, news, and residency programs we think the user may be interested in. All of this data comes from our own backend and is augmented by a variety of third party API sources. To make the Feed experience feel ‘always up to date’ we fetch a lot of the content using ‘background fetch tasks’ and save the content on the device in a local persistence layer. That way, when a user opens the Feed, all the content is already on the device for immediate presentation, filtering, or sorting.
You had to update to Swift 3 and iOS 10 mid-project. How did that go?
We were aware of it not being backward compatible and it did require us to make some significant changes. However, we put the time and effort to migrate Release 1 so that the task would be less overwhelming as we continue to grow the code base in the future.
How is sensitive user data being handled? How did you handle security issues?
In general, any sensitive user data that is stored on the device uses the Keychain Services API - this encrypts any sensitive data before it is stored in the file system on a user’s device. If any sensitive user data is sent from the device to our backend, we do so using HTTPS and the JSON Web Token (JWT) architecture.
The backend for this app needed to scale. What strategies did you use to enable scalability?
We’ve had to think about the ability to scale across all tiers of the server-side architecture. On the database tier we have been particularly careful to optimize our queries, and index our data whenever it makes sense. We have also moved some of the more complex API logic to the database inside plv8 functions. This has meant less requests from the API to the DB. We are also leveraging Amazon’s RDS, which allows us to easily “vertically” scale the database instance to a higher capacity machine.
At the API tier we are “horizontally” scaling in several ways. We launch an API instance for each processor available on a server; so a server with 4 CPUs will have 4 instances of the API launched. We also replicate the deployment servers and balance incoming requests to these servers with a load-balancer. We leverage auto-scaling of server deployments, meaning that if CPU usage on a deployed API server reaches a critical level (e.g. 95%) we launch an additional server to increase our capacity.
How did you set things up to automate devops and maintenance?
Almost all aspects of server-infrastructure (both creation and updates) are scripted. This means that the infrastructure can easily be replaced, upgraded, or updated without step-by-step manual intervention. We leverage the Ansible framework and the AWS command-line-interface to author scripts.
What things were most challenging and/or fun for you on this project?
The most challenging part was designing and implementing a highly-secured and scalable IT infrastructure out of AWS components. I’ve noted the scaling issue above, but it was also paired with a requirement to be highly secure. This meant limiting access to server resources with private networks, gateway servers, and highly specific security groups and port-blocking rules. Add to this the requirement that all of this be able to be created from a script and you have a challenge.
Which piece built are you most proud of and why?
The server infrastructure noted above. It was a big challenge that had a short turn-around time.
What things are you looking forward to in future work on this app?
I’m looking forward to refining the geographic scoring algorithms; we plan to incorporate more direct (user responses to questions about place) and indirect (places they are viewing or liked) data input.
Name 3 of your favorite mobile apps. What makes them great for you?
This is embarrassing, but as a backend developer and a bit of a luddite I’m not much of an aficionado of mobile apps. I actually own very few. My favorite app is iBooks, followed by Drum School. Beyond that, most of the apps I have are for my children. Crazy Gears is pretty cool. Ha!