Categories:
Search articles

Search for articles

Sorry, but we couldn't find any matches...

But perhaps we can interest you in one of our more popular articles?

Mobile and web application costs 2020

Jun 4, 2020

Written by Rody Davis Jr

It has never been a better time to build that side project you have been putting off but before you get started, there are a few price considerations to keep in mind when choosing your tech stack.

TL;DR The biggest cost to consider will be the database and its type. SQL is easy to query and hard to scale while NoSQL is the opposite.

Managed or custom

One of the things to decide before starting the project is whether you want to build everything yourself or prefer to use a managed solution such as Firebase, Back4App, Parse, AWS Amplify, Deployd etc. If you want to know more about the top 10 popular alternatives to Firebase, you can check out this post.

If you are building a custom solution, you will either be using AWS (Amazon Web Services), GCP (Google Cloud Platform), Azure by Microsoft or your own server. Basically, every Firebase project is actually just a GCP project under the hood. For example, if you have ever created API keys for Google Maps or Google Translate, you probably were navigated to the console. If you are a mobile dev, then using a managed solution usually seems more favorable.

In this article we will focus on serverless architecture and not cover costs relating to setting up your own server.

Building the MVP

The application that you build in the prototype phase does not necessarily have to be the one you launch to production. When I am starting a project, I will build it locally and see how far I can get with a web app or a PWA. If there is no need for an external database, I will just deploy my website to a static site hosting provider like Github Pages, Codemagic Static Pages or AWS.

This works great for static content, client applications consuming third party APIs, portfolios, and other simple applications. In most cases, this will only cost the price of your domain if you choose to get one. I like to use Google Domains as it has a great UI compared to many other domain registrars I have used in the past and it has a really nice workflow for adding GSuite and other powerful tools for your domain.

If the application you are building requires a mobile application or is the sole application, you can get by with a small cost of running the app. Posting on the AppStore would cost you $99 per year, while with Google Play there is only a one-time registration fee of $25. These prices stay the same, no matter the number of applications. If the application does not need a database beyond the local one, use a custom-built API or a locally hosted website to cut these costs. Some APIs charge for usage (e.g. Google Maps), so make sure to price your app in a way that keeps the lights on.

At this phase in the product life cycle, there are usually little to no analytics, push notifications, cross platform data sync, logging or other features needed for the production-ready release.

Choosing the database

When choosing a database it can be really tempting to just pick what is easy, fast or popular on Twitter. This is a really big decision for your application so take time to consider the pros and cons and where you want the application in the future. You can always migrate data later to other data solutions but keep in mind that some forms of migration can be destructive. Database will most likely make up the majority of your monthly costs for running the application.

Local database

The simplest and free solution is to use a local database on each client. Popular databases include Realm, Hive, Shared Preferences, Moor, CoreData and SQLite. All these solutions run on the phone and require no internet to function as there is no server. In the case of CoreData and Realm, you can have the local database sync with a server instance and thus have a shared solution. For example, Realm can sync to Realm Cloud and CoreData can sync to CloudKit. For many applications this should be the go-to solution and used with other options listed below, you can provide an offline first experience.

Document storage

If you need your application to scale easily and do not need a relational solution, then you want to use NoSQL. If you are on GCP, your choice would be Firestore, and on AWS it would be DynamoDB by Amazon. Both solutions charge in three key areas: total storage, bandwidth, read/writes.

ProviderStorageReadWriteDelete
DynamoDB*$0.25/GB$0.25/1M$1.25/1MN/A
Firestore**$0.18/GB$0.06/100k$0.18/100k$0.02/100k
CosmosDB***$0.25/GB$0.005/10k$0.05/10KN/A

* For the latest DynamoDB pricing look here

** The latest Firebase Firestore pricing can be found here and the pricing for Google Cloud Firestore here

*** For the latest CosmosDB pricing look here

It can be a bit confusing to understand these numbers because charges are based on different metrics. There are quite a few NoSQL databases and they all have different pricing models. Feel free to check out this link for a list of popular NoSQL solutions. Even on Google and AWS they offer multiple types of NoSQL data solutions.

Managed database (DBaaS)

When you need powerful queries or ACID transactions for your data solution, you probably need SQL. All cloud providers offer managed SQL instances that can really help out on cost, backups and maintenance. Amazon has RDS (Relational Database Service) and Google has Cloud SQL. These instances allow you to use PostgreSQL, MySQL or other database engines.

Pricing depends on the amount of stored data and whether you are interested in memory or a single instance (and in case of the latter, if there is any extra configuration to the instance). If you use Microsoft SQL on a SQL server, it can get really expensive fast.

Database instance

The most expensive although sometimes necessary option is to spin up a VM or compute instance that runs the database. It will depend on the server resources to fulfill requests and you will be responsible for scaling and backing up the data. The nice part about this approach is that it gives you total freedom on configuration and setup. You can run any database engine you like and you will be charged based on the storage and bandwidth needed.

Deploying your app

Now that you build your mobile app and/or website and have a database to store your data, it is time to release your product to the world. Even if you have a small team of 1, you should be setting up continuous integration to release your app on a schedule (otherwise you delay and have massive releases). There are multiple options when it comes to deploying your application. I will only cover CI tools that support mobile and web.

Github Actions

Github allows you to set up actions that can trigger based on events for your repo. Github Actions can deploy any app using a docker file. Github Actions is free for open source projects and has a generous 2000/min per month for free accounts and 3000 for pro/team members. Enterprise has 50,000 minutes. After you reach the capacity for the month, the pricing system is pay-as-you-go depending on each machine. For reference, for MacOS it's $0.08/min, for Linux $0.008/min and for Windows $0.016/min. Github Actions is a great choice if you need everything in one place and now that Microsoft owns Github things just keep getting better.

Codemagic

If you need to deploy a mobile application, desktop client, web static page and backend, you definitely want to check this CI out. Codemagic is ideal for cross-platform projects but can also be custom-tailored to any needs with the introduction of the codemagic.yaml file allowing you to run any number of custom scripts. Pricing is really simple too, 500/minutes per month and 2 seats on a team, all included in the free plan. With the launch of pay-as-you-go it has never been easier to estimate all your costs for the month. Everyone will continue to get 500 free build minutes per month but now you can also have paid minutes that do not expire and will kick in once you reach your quota. For teams, each additional team member will be $10/month. You can read more about the new pricing model here.

Fastlane

I wanted to mention fastlane as this can be used in Github Actions, Codemagic or other CI tools but it can be used as a stand-alone as well. When you are in the MVP stage and want to deploy multiple builds to Testflight and Google Play, fastlane is your friend. You can capture screenshots, update metadata and a host of other useful mobile features. When you are ready to set up automation, you can have Codemagic run all your fastlane lanes for you! If you haven’t used fastlane yet for mobile development I would highly recommend it. You really start to see everything that you want to automate and all the potential possibilities.

Conclusion

Applications can vary a lot and so do the app-related monthly costs. Choosing the right data solution can greatly change how much you are paying for maintaining your apps. If you stick with popular and well supported-solutions you will typically have better documentation, support and examples. You have to decide whether you want to custom build a solution or start with Firebase or AWS Amplify for your next project. When you are ready to release, do so often!


Rody Davis Jr is a professional full stack developer in both enterprise and personal applications. He creates apps for App Store, Google Play, Web and Desktop using the latest frameworks. Rody loves Flutter, Web and all things creative and writes Flutter articles on Medium. He hopes to reach as many people possible with his applications and show what is possible with the latest tech.