Choosing the best backend for your iOS App can be a challenge. There are many options, and which one is best suited for your needs depends on a number of factors, such as:
- Do you need a cloud service?
- Should you run your own server?
- Should you use CloudKit, Firebase, or another option?
We are going to dig into these questions and more to help you choose the best backend and cloud services for your iOS app.
Is the Best Backend Actually No Backend At All?
First, it's important to know that cloud services aren't needed in every case when it comes to an iOS app. What can you do without them - A lot, actually.
A thing to know about iOS apps is, that in a lot of cases, people don’t need the cloud to store their data. It can just be stored on their phone.
Backend Decisions with Mikaela Caron
June 28, 2022Leo Dion, Principal CEO and Swift Developer at BrightDigit Full Transcript
Guest
Youtube Video - https://youtu.be/_-k97s1ZPzE
Show Notes
- Do you need a backend?
- Why company size matters?
- SQL vs NoSQL Database
- Hosting vs MBaaS
- What if you have an existing dev ops or backend team?
- Is CloudKit an even better option with transferrable apps?
- When does Vapor make sense?
- How can devs learn more about iOS/Swift backends?
Choosing Cloud Services for Your Best Backend
Using cloud services for your iOS app backend can be helpful if you're storing data or syncing across multiple devices. For example, note-taking apps that are available on all Apple devices can use a combination of iCloud and CloudKit to store information on the backend.
If you've decided that you do need backend storage, there are a few things you should consider before making that choice.
The Purpose of Your App: MVP Vs. Enterprise
The first thing to consider is your timeline, budget and being clear about the purpose of your app: Is it a simple Minimum Viable Product (MVP) or an Enterprise app you mean to support over the long-term, meaning it needs to be well designed from the start?
An MVP is a simple app for proving it's something your customers will actually want. It's something you need to get out quickly and is most likely a bare-bones version of the features you think your customers will want.
On the other end of the spectrum, there are enterprise apps that need to be well-architected right from the beginning.
When you are writing your Swift app, you'll want to make sure you have some healthy abstraction with your backend communication.
What devices will your app support?
There's a variety of devices you may need to support:
- Are you only supporting Apple devices?
- Or are you going cross-platform and supporting Android?
- Will you have a desktop, and will it be browser-based or an application?
- And if you’re doing a desktop application, will it support Windows and/or Linux?
- Does your app need to support connectivity with the Internet of Things?
These are all questions to consider when deciding what backend services to use.
If you're only supporting Apple devices, you may want to consider CloudKit. If you're supporting Windows or Android, Firebase might be a better option.
Complex Vs. Simple Queries
Many tasks use relational data, which are best performed using some sort of SQL database. Unfortunately these can be pricey. Conversely, many simple document-based cloud storage options are cheaper.
Therefore, if you're willing to offload a lot of the complexity of a good query over to the device and want to save some money, document-based services such as Firebase might be a good option.
The Expertise of Your Team
This is a big factor because if their expertise is .NET, you're probably better off using a Microsoft backend with an SQL Server and C#. If you're already getting a decent price on Microsoft Azure, for instance, use it because that's what your team has expertise using.
If your team is well versed in Swift, you may want to consider Vapor for your backend.
User Interface (UI)
We also recommend doing some user-focused design to come up with the kind of data that your users will need. Afterward, work your way back towards how you would need to store that.
SwiftUI has now become the first tool you should be looking at if you’re building an app natively to iOS (or any other Apple device).
These factors, plus the budget you're working with and the time you have to spend are all factors to consider when thinking about back-end storage.
So, what are your options?
Once you've asked yourself all these necessary questions, you'll want to start looking at the options that fit your needs and budget. Here are some options to consider.
Hosting a Server For Your Backend
The most customizable and robust option is just to host your own server. You can buy your own server and host it at a site with a virtual machine like Amazon Elastic Compute Cloud(EC2), Linode or DigitalOcean.
Databases
Server Software
If you're working with a simple MVP or releasing only for Apple, I would not recommend hosting your own. If you have simple needs, go with the simplest solution.
CloudKit as Your Backend
One really affordable option worth exploring in more detail is Apple's back-end storage system, CloudKit. CloudKit is fairly simple to use if you're sticking with iOS.
Firebase as Your Backend
Firebase is the most popular mobile backend as a service not only because of its price but also because it's available on a plethora of devices.
Final Tips
We know we're leaving you with a lot of information, luckily we've created a cheat sheet based on this article to help you get a summary.
Whatever you choose, remember, if you need to pivot, do it early. Don't do it when it's too late.