How to Make an App Like Instagram for iOS or Android

How to Make an App like Instagram

Facebook’s acquisition of Instagram for a billion dollars in 2012 was considered by investment analysts as extravagant at the very least. However, by 2016 when Instagram was conservatively valued at $50B, the critics were claiming to have been misquoted. But how easy is it to build an app like Instagram? The simple answer is that it’s not rocket science. It is harder, far harder. I mean, Kim Jong-un’s North Korea and other pariah states have enough rocket scientists to build millions of missiles, but there is only one Instagram in the world. And then there is that bit about Facebook preferring to pay a billion dollars instead of starting a new mobile app development project.

 

But if for some reason you wanted to build a similar app, what would it take? It is an interesting question, and very instructive for entrepreneurs who want to know how to build a billion-dollar app and mobile application developers who want to build scalable applications. Let’s look at the business issues first and then the technical side of building a mega-application. We will confine ourselves to the platform before its acquisition by Facebook when its identity became inextricably linked with FB.

 

Are you as lucky?

Louis Pasteur, the Einstein of biology, reportedly said that chance favors the prepared mind. The biggest factor in Instagram’s growth from start-up to a billion dollars was luck. TechCrunch describes the company as having nailed the element of timing, and that is in retrospect. It was not disruptive. It was creative in the sense that it did not disrupt any industry but created one instead. However, there’s more to the story than just luck. In years of app development, I have learned that good luck in software development is just bad luck postponed.

 

Do your research

Instagram, or what became Instagram, was inspired by a growing popularity amongst iPhone users for location-based applications. Further research by Systrom into check-in apps led him to Burbn, and the proverbial light bulb flashed. The trigger was photos. Burbn’s users were sharing photos more often than they were checking-in. Instagram was still a concept when Systrom met Mike Krieger with who he co-founded Instagram. Together they examined hundreds of apps to identify a niche between online photo editing and outright social media, developing Instagram to build it.

 

Define the app

A software developer’s nightmares typically feature scope-creep. It is what happens when you start a custom software development project with an “I will know it when I see it” attitude. Instagram’s founders had defined their specs pretty well. However, it still took months to develop the prototype called Scotch.

 

Get the team

Mobile application development is not a trivial task. When it is a new concept, your groundbreaking technology and whether or not you choose to partner with highly specialized individuals will break or make the app. The Instagram duo was very choosy about who to work with, which is why they grew their team very slowly. For instance, they refined objective-c development skills instead of hiring new developers.

 

The technology backing Instagram

Any custom software development project is made or broken by the technology used to build it. In the journey to social media dominance, for instance, Facebook has had to redefine NoSQL, create an Artificial Intelligence system and develop a new approach to Javascript in the form of ReactJS. One of the most amazing things that Instagram achieved as a startup was taking less than a year to build a system that supports 20+ million users with only three system engineers.

 

Did someone ask how the hell they did that? According to Kreiger, these were the guiding principles:

  1. Keep it simple (KISS)
  2. Use tested and proven technologies when you can
  3. Don’t reinvent the wheel
Have an App Idea You Want to Build? Click here to tell us about your project

 

The Instagram technology-stack details:

Operating system and hosting

To launch an app, you need to get hosted. One of the radical decisions that defined Instagram was the choice to outsource hosting. They were one of the first companies to adopt Amazons Elastic Cloud in 2010. It was not smooth sailing. Before settling on cloud-hosted Ubuntu 11.04, they had tried earlier versions that were prone to unpredictable system-freezing bouts under high traffic. This is an important lesson for anyone looking to develop the next big app. You must focus on the problem. Instead of trying to host themselves, which would have diverted crucial financial and technical resources to non-core issues, they chose to go with tried and tested solutions.

 

By choosing to use Linux, which is open source and free, the start-up avoided committing resources to software licensing. In building a similar app, serious consideration should be given to outsourcing those aspects that are not core business. If you are an android app development company that has no software development background, you should consider outsourcing development to a specialist mobile app development company and focus on your core competence.

 

Load balancing

Remember where we said Instagram was lucky? Well, we followed up by quoting Louis Pasteur on how chance favors the prepared. On its first day, Instagram got 25,000 users and went on to cross the six million mark in 90 days. That is to say, it averaged 70,000 new users a day in its first 90 days. Many apps would crash and burn under such growth. So, although they were lucky, they were also prepared.

 

From the onset, they built the system to scale up to mega usage. One way this was achieved was routing every single request through load balancing servers. At the start, load balancing was achieved by using NGINX servers implementing Round Robin DNS to route the request to the least loaded server. However, the rapid growth turned the time taken for DNS to update when a server was decommissioned or commissioned into a bottleneck. In response and as per their second engineering principle, use tested and proven technologies, the team switched to Amazon Elastic Load Balancer. The load balancer was backed by three NGINX machines with automated health monitoring, ensuring they could automatically recover from failure.

 

In retrospect, the choices made by Instagram’s engineers seem obvious. However, it’s instructive of what they chose to do when these technologies were not exactly mature. This brings up the next lesson for anyone embarking on a software development project. Software quality assurance is an ongoing process. Having started with scalable choices, Instagram’s engineers were not content with that but continued to deal with issues as they emerged without forgetting that in software development, sophistication is synonymous with simplicity.

Instagram ios App

Instagram ios App

Application servers

So, how does the Instagram back-end run? Before the specifics, let’s look at the rationale. Instagram’s value proposition is its online photo album and editing capability. To achieve that, Kreiger and Systrom had to build the ease to use photo filters. While they started with iOS app development, they kept their eyes on the ultimate prize; easy cross platform mobile app development.

 

Hindsight is 20 20 it has been said, but predicting the future is an imprecise art at best. When developing an app to run on both Android and iOS, it easy to get distracted. The distraction might be, for instance, Android app development at the cost of uniform and consistent UX across platforms.

 

The approach chosen by Instagram to achieve true cross platform app development, colloquially defined as write once, run everywhere, was to move most of the functionalities to the back end or application servers. They built an architecture running Django (a Python framework) on Extra-Large, Amazon’s High-CPU machines. The rationale was that Instagram (picture editing) was a CPU intensive application and not a memory intensive one.

 

This approach allowed them elasticity since the machines are stateless, and scalability because they could instantiate new machines on demand. Compared to self-hosting, in which the team would have had to buy servers and commit personnel to configure and manage them, it becomes obvious that this was a winning proposition.

 

Data storage

Well, everyone knows pictures require lots of memory. How does Instagram store the 1.2 billion pictures uploaded to the app daily? Prior to being bought by Facebook, after which we can safely assume the app was moved to NoSQL, Instagram used PostgreSQL. The main cluster was 12 quadruple extra-large instances of Postgres replicated in a different zone. The default Amazon network disk system was inadequate with respect to iOS, so they reconfigured it to use software RAID. Instagram optimized the system to manage in-memory data so that in case a machine failed, the memory profile was moved from one machine to another using vmtouch.

 

Every Android app developer, iOS developer and Android application development company has trade secrets that they consider to be their competitive edge. One such secret is how to optimize the connection to databases from app servers. Instagram optimization used Pgbouncer, a utility that allowed pooled connections to PostgreSQL. The result is that the overhead in managing DB to app connections was drastically reduced, allowing most of the system resources to be used to actually write and read from databases. The actual storage is on Amazon S3. It is coupled with Amazon’s CloudFront as a content delivery network (CDN) for geographically smart routing that stored data close to users to reduce loading times.

 

Notification pushing and task queues

Instagram’s unique value proposition is providing better photo editing and allowing the edited photos to be shared out on social media, namely Twitter or Facebook. The success of your mobile application development efforts relies on the apps ability to push notifications such as new photo uploads as was the case for Instagram. They achieved this asynchronously by adding new tasks (sharing or notifications) to a queue task system called Gearman. It allows these non-real time tasks to be suspended when real-time tasks such as photo uploads arise.

 

Monitoring

With multiple load balancers, database and application servers, and replications, how do you keep informed on what’s happening and where? Many an Android development company will have had over 50 apps to manage on behalf of clients. In such a case, your typical day might be 14 hours of crisis management.

 

But with Munin, the Python-based systems monitoring tool that Instagram uses, you could do 2-hour lunch breaks and leave the office early. PagerDuty is another utility that Kreiger’s team co-opted for monitoring notification and incident management. At the application level, they used Sentry, which is native to Django and written by a Disqus team. I just hope my boss doesn’t discover PagerDuty because I would be so looking for a job.

 

Mobile apps

Instagram is a cross-platform mobile app that offers uniform UX across all platforms. However, it was initially available only on iOS, which used an in-depth knowledge of objective-C plus skilled swift developers and objective-c developers. The android app that came later used a lot of native features to match the iOS UX, most of which were either unavailable in HTML 5 or slow. This was achieved using Java and XML Android development tools. The latest version of Instagram integrates augmented reality app development.

 

Design and user interface

The inspiration for Instagram came from Burbn, a check-in app, and Hipstamatic, a photography app. So how did Instagram make it and why did these apps fail? The niche was identified by Systrom, but Krieger built the app. The first version of Instagram never made it to iTunes because they felt it was too slow and that its functionality was not ready yet. The second was a great UX, which was minimalistic with regard to the first publicly released version. A user could post a photo in just three clicks.

 

This shows what many an early iOS app developer had to learn. It is now common knowledge in the industry that the product is just as important as the UX. In fact, an average app with a great UX will in most cases outperform a great app with average UX.

 

Cost: The billion dollar question

So how much does it cost to develop an app like Instagram? While a billion dollars might be the simple answer, that is not exactly true. But when Facebook paid $1B for Instagram, they clearly thought it was cheaper than developing a similar app. This is because they were also paying for the brand. Facebook was not merely reimbursing the actual cost of development, which would have been significantly less.

 

How much does an app like Instagram Cost to make?

Costing development, like most other service quotations, is more akin to witchcraft than science. How so?

To estimate of cost development of an Instagram clone one would have to factor development costs for:

  • Backend development
  • App development (iOS and Android at the very least)
  • Webend development
  • Testing and quality assurance

 

However, development tends to incur overheads for project management, continuous integration, and testing. Then there is additional complexity in that iOS apps sometimes cost more than Android apps to develop feature for feature. Additionally, backend complexity sometimes increases as simplicity in the front end increases. A conservative estimate would be that it will take 600 to 1000 development hours to do a high-quality clone of Instagram if you add in project and product management investment than $100,000 would be a good starting point for a budget for either Android or iOS platform. If you were looking to build a truly unique Instagram app with modern components such as augmented reality, then budget at least 1,500 to 2,500 thousand hours for developer hours to develop a custom Instagram type app that is truly unique and innovative in its own right and would be unique enough to attract venture investment. This is in line with the 3-man team that launched the first version of Instagram in three months. It follows that $200,000 to $300,000 might suffice to develop an app like Instagram but one that is truly innovative, high-quality and is not just a clone. One that has potential to get venture investment and a loyal audience and at some point itself becoming a billion-dollar app like Instagram as opposed to going to the app-store graveyard like so many cheaply made-apps do.

Related Article : How to Make an App Like Uber

Related Article : 5 Things You Need to Know About Chatbots

Related Article : 5 Ways a CTO can Accelerate Business with AI

Want a Top Development Team to Build Your Next App? Click here