16/11/2017
A lot of startups start with a great iPhone app idea. From that point on though, starts the stress of technical decisions. “Should I use hybrid technology or go native?”, “Should the app be written in Objective-C or Swift?”, “What OS should I support?” and finally “Do I need a backend?”, “What kind of back-end?”, heck “What is a backend?”.
Today I’ll cover those last three questions. I’ll talk about backends.
So, let’s address the first question: "Do I even need a backend?"
This question is very easy to answer. If you answer yes to any of the questions below, then the answer is: “yes, you need a backend”.
Do you have any need to synchronize data between multiple devices?
Do you want to display your user’s data on a website?
Do you want to offer back up for the data generated by the user?
Do you want to be able to change your app behavior based on your input without re-releasing the app?
What is your answer? Do you need a backend? If your answer is no, then you’re among the very few. Most applications today require some kind of backend. Consider yourself lucky, you just saved a lot of money and headaches.
On the other side, if you answered yes, then welcome to the world of iPhone app development. You’ll see it’s an exciting world with a lot of moving parts.
Now might be a good time to answer the third question: What is a backend?
A back end is software that runs on a server which your application and website can communicate with. You can use this backend for lots of things:
- storing data
- sharing data
- control your app
- host content to show in your app
- run your business logic in a central place so you don’t have to re-implement that business logic in your apps
- crunch some numbers based on the data stored on that backend
Infrastructure
This code can run on a server in your closet (aka a bad idea), on a server you own in a datacenter or on someone else’s server. Let’s dive into those options for a bit.
In today’s world, you have a few options when it comes to picking your backend- for your application.
Option 1
If you are iOS only you could go with CloudKit by Apple:
Pros:
- Apple is not going to pull the plug on this
- No user registration is needed. Your users are already registered via their appleID. Data will be available as soon as your user install your app. Do not underestimate how much that can help your app user experience.
Downsides:
- iOS only
- Data can’t be shared across users
- Can only be used for data storage, you can’t add business logic in the cloud
Option 2
You can go with any of the backend as a service (BaaS) that exist on the market today:
Firebase by Google
DynamoDB (and related tools) from AWS
There are others, just make sure you pick one that won’t go anywhere (just google Parse shutdown and you’ll understand why)
The pros:
- very easy to setup
- Cheap to code for your first version
- Quick to integrate in your iPhone app
- Reduces the need for a backend developer (you can keep the business logic in your app, which actually is a bad in the long term)
- Can quickly scale up with demand
- Cost are super low when you start
The downsides:
- Cost can quickly ramp up when your app gets popular
- Your developer is tempted to put the business logic in your iPhone app (bad idea)
- This third party could close down that service (just google Parse shutdown)
- Lacks flexibility since you can’t modify the code
Option 3
You can go with a custom backend which runs on someone else’s cloud (ie: AWS, Heroku, Azure, Google AppEngine)
Pros:
- You can do anything you want
- Can scale to meet demand
- You own it, you can move it to another cloud easily
- You can optimize your backend for cost when you scale up
Downside:
- More complex to put in place
- Expensive to setup as you must get a backend developer to do it
- More IT headaches to deal with
Option 4
You can go with a custom backend on your own server in a data center. I won’t detail that one as it only applies to the giant companies of this world. And even those companies are now more and more renting someone else’s servers. Netflix famously uses AWS to host part of its infrastructure.
Sofware options
Now that we covered the infrastructure you can use, let’s talk a little bit about the technology you can run on those servers. Those are usually called stacks. There are some well-defined combinations of software that people are working with out there. Here are a few:
- LAMP: this stack runs on a machine running the Linux operating system. It uses Apache to serve the content hosted on the server. It uses a MySQL database to store the data and finally uses PHP as the programming language
- MEAN: MongoDB, ExpressJS, Angular, Nodejs
- Ruby Stack: Ruby/Ruby on Rails/RVM (Ruby Virtual Machine)/MySQL/Apache/PHP
There are a lot of other stacks, this is just to give you an idea of the most popular today.
Each stack has its own benefits. For most apps, you could use any of those stacks. What will most likely direct which stack you’ll use is what your team knows and needs.
If you intend to do some Big Data work, then a NoSQL database like MongoDB will be a better choice, if all you need is to store your users' data, then any stack will do.
Still have questions? Don’t hesitate to signup for my Founder tech support program and I can guide you through the taking the right decision for your app: https://mobdesignapps.fr/?utm_source=Facebook&utm_medium=post&utm_campaign=awareness&utm_content=backend