Hello there, How is it going?
Welcome to 8bitmen.com

This article is a comprehensive write-up on How to pick the right backend technology for your app? The article lists down several uses cases, with related backend technologies & their real-life implementation resources, which assist us in figuring out which technology would suit best for our requirements.

For all the articles in the pick the right tech stack series navigate here

So, without any further ado.
Let’s get started.

1. USE CASE

Before Drilling Down the Use Cases, Do Read through these General Guidelines When Picking A Backend Programming Language

Every programming language corresponds to a certain programming paradigm, be it a functional, an object-oriented or a procedural one & also caters to some specific use cases.

Today web apps involve more than one use-case hence the need arises to use multiple programming languages when writing the backend of a service.

The architecture of web applications has evolved from monolithic to microservices, where separate individual modules, written in different programming languages, run together in conjunction with each other. All these services/modules join forces to make one complete business service.

The need for one or more programming languages entirely depends on the business requirement.

If you have multiple use-cases, for instance, you need to write an asynchronous non-blocking service like a chat application along with a regular classic MVC service. Consider going forward with a loosely coupled microservices architecture, right from the start.

Leverage the microservices architecture & harness the power of multiple technologies.

The use cases below give us a general idea of the languages to be considered for implementing a specific use-case.

 

2. USE CASE

Are You Building An App Which Needs to Interact With/Stream Data From the Backend Server In Real-time?

For Instance, A Chat App? A Real-time Browser-based Massive Multiplayer Game Like Agar.io?

A Real-time Collaborative Text Editor? Or An Audio Video Streaming App Like Spotify, Netflix?

Real-time data streaming apps are highly asynchronous & non-blocking in nature. To build these, we need a backend technology built specifically to pull these kinds of tasks off smoothly.

Traditional MVC frameworks, which are blocking in nature, are not equipped to handle these kinds of scenarios well. When the traffic starts to grow on the app, the blocking nature of MVC frameworks starts to become a bottleneck.

Think of Ajax, when you hear the term asynchronous. On the other hand, non-blocking means the main thread flow on the backend doesn’t wait for the processes to execute. The flow just receives the requests, passes the execution & keeps going in a loop receiving other requests. It doesn’t wait for the initial request to complete.

It is equipped to handle multiple requests at one point in time without spawning multiple threads. There is no locking of resources & contention between threads, which otherwise might add latency to the response.

Non-blocking kills the need for multi-threading, making things much simpler & efficient. It’s an event-driven architecture as opposed to the traditional request-response servlet architecture.

To get a deeper understanding of things does go through the relevant read resources below.

Some Of the Technologies Which Enable Us to Write these Kinds Of Apps:

NodeJS
A JavaScript runtime built on Chrome’s V8 JavaScript engine.

Java Spring Project Reactor
It’s a library for building non-blocking applications on the JVM based on Reactive Streams specification

Java Scala Play Framework
A framework specifically built to write scalable web applications. Non-blocking in nature. Built on Akka.

Java Scala Akka Framework
A framework for building highly concurrent, distributed, message-driven applications for Java & Scala.

Python Tornado
A Python-based web framework for building asynchronous applications. Ideal for long polling, web sockets & long-lived connections.

Relevant Reads

Blocking vs Non-blocking StackOverflow

Blocking vs Non-blocking NodeJS

Event-driven architecture

LinkedIn’s real-time platform built with Play framework

How Netflix scales with NodeJS

How Uber uses NodeJS to scale their business

 

3. USE CASE

Do You Intend to Build A Peer to Peer Web App Like YaCy, A P2P Distributed Search Engine? Or LiveStation, A P2P Live TV & Radio Service by Microsoft?

P2P peer to peer apps have no central server rather they are hosted by peers in the network, which make the apps automagically fast & scalable.

Users instead of fetching data from a distant located corporation server now fetch data from the systems of other users, hosting content, located close to them geographically.

Also, when a user logs into a P2P app, he acts as both the leecher (one who fetches data) & the seeder (one who hosts or uploads data to the network). Data can be hosted by the user either temporarily or for a longer period of time.

So, the underlying p2p architecture averts the need for writing a backend for a peer to peer web app. To get a deeper understanding on what P2P web apps are, how do they work? What is the underlying architecture? Do go through the relevant read resources below.

The Technologies Which Will Help Us Write A Peer to Peer Web App Are:

JavaScript
It is the programming language of the web. It helps us build interactive web pages & work with Html & CSS

DAT Protocol
It is a peer to peer protocol which enables us to write efficient P2P web apps via APIs & other features.

Freedom JS
A framework for building p2p web apps. Create social applications that easily work in modern web browsers

Relevant Reads

What are peer to peer web apps & how do they work?

An in-depth understanding of peer to peer networks

Peer to peer social networks & federated architecture

YaCy, a peer to peer search engine

Netflix researching on Peer to peer technology for streaming

 

4. USE CASE

Do You Intend to Build A Regular CRUD-based Web App Having An MVC Architecture Like An Online Ticket Booking Portal, A Social Networking Site Etc?

CRUD (Create Read Update Delete) is the most common form of web apps being built today by businesses. Be it an online booking portal, an app collecting user data or a social site etc. all have an MVC (Model View Controller) architecture on the backend.

Though the view part is tweaked a little with the rise of UI frameworks by React, Angular, Vue etc. Applications are now primarily REST-based. The Model view controller pattern stays.

Some Of the Technologies Which Enable Us to Build MVC Based Apps Are:

Java Spring
This is the de-facto framework in the industry for building Java web applications. It takes care of all the infrastructure, complex configurations & heavy lifting & lets the developers focus on the business logic.

Python Django
This is a python web framework which assists rapid & clean development of web apps

Ruby on Rails
A web app framework written in Ruby for writing web apps.

PHP Laravel
A PHP based framework for building MVC based web apps

ASP .NET MVC
A web MVC framework by Microsoft for writing web apps with .NET

 

5. USE CASE

Do You Intend to Build A Blog Or A Content Management System Like WordPress? Or You Might Want to Build A Really Simple Web, Social App?

If you intend to write an app which doesn’t involve much complexity like a blog, a simple form-based app, apps which integrate with social media. Social, web browser-based strategy, airline, football manager kind of games. You can pick PHP.

PHP is ideally used in these kinds of scenarios. We can also consider other web frameworks like Spring boot, Ruby on Rails, which cut down the verbosity, configuration, development time & stuff by notches. Facilitate rapid development etc. But PHP hosting will cost much less in comparison to hosting other technologies.

PHP is ideal for very simple use cases.

 

6. USE CASE

Do You Need to Run CPU Intensive, Memory Intensive, Heavy Computational Tasks On the Backend Such As Big Data Processing, Parallel Processing, Running Monitoring & Analytics On Quite A Big Amount Of Data?

Performance is critical in systems running tasks which are CPU & memory intensive. Handling massive amounts of data, technically called Big Data has its costs. A system with high latency & memory consumption can blow up the economy of a tech company.

Also, regular web frameworks & scripting languages are not meant for number crunching.

Some Of the Technologies Which Help Us Write Performant, Distributed, Scalable Systems Are:

C++
A programming language which facilitates low-level memory manipulation.

Rust
A language similar to C++ built for high performance & safe concurrency.

Java
A powerful object-oriented language to write JVM based high performance, scalable backends.

Scala
An object-oriented & functional programming language under one package.

Erlang
A functional programming language with built-in support for concurrency, fault-tolerance & distribution. Facilitates the development of massively scalable systems.

Go
A programming language by Google to write apps for multi-core machines & handling a large amount of data.

Julia
A dynamically programmed language built for high performance & running computations & numerical analytics.

Relevant Reads

Facebook manages petabytes of data on a regular basis with the help of Presto, a distributed query engine written in Java. The data infrastructure components at Facebook are primarily written in Java.

Go programming language at Google

The publisher of the popular game Stardew Valley uses Rust for safe concurrency. Dropbox wrote its core file storage systems in Rust.

Whatsapp uses Erlang to run it’s messaging servers

 

7. USE CASE

Are You Writing An AI Machine Learning based App? Is Artificial Intelligence Involved In the Business Logic?

When it comes to writing AI apps there are a lot of use cases. One solution doesn’t fit all. You might want to use AI for general problem solving, running simulations, genetic algorithms, statistical computations, numerical analysis & what not.

Some Of the Popular Languages Used For Writing AI-based Apps Are:

R
A programming language primarily used for statistical computing, data analysis & graphics. Widely used in AI-based apps which involve running statistical computations.

Smalltalk
An object-oriented programming language used for running simulations, genetic algorithms, neural networks & machine learning.

Lisp
It is the second oldest high-level programming language being used today. It is based on lambda calculus & widely used for implementing AI.

Python
One of the most popular languages when it comes to implementing AI primarily due to the extensive AI libraries available in the language. Python is used to implement natural language processing, general AI, neural networks & a lot more.

Prolog
A logic-based programming language used to implement AI & computational linguistics.

Java
Used to implement AI especially in data processing & distributed systems.

 

8. USE CASE
Are You Writing A Decentralized Blockchain App?

If you look at the design & architecture of a blockchain app. It has features specific to the crypto, blockchain domain besides being a web app.

So, to implement the web app we would use the regular programming languages stated in the scenarios above such as Java, Python, C++

Then there are specific languages to implement the blockchain stuff such as:

Simplicity
A functional language designed to build blockchain & crypto apps.

Solidity
An object-oriented programming language for writing & implementing smart contracts on various blockchain platforms.

Rholang
A concurrent programming language used to implement protocols & smart contracts on general purpose blockchain.

 

More On the Blog

How Hotstar scaled with 10.3 million concurrent users – An architectural insight

How to pick the right front end language for your app – explained with use cases

A thorough insight into what is a cloud architect & why should you become one

What database does Facebook use – a deep dive 

How does PayPal handle billions of messages per day with Reactive Streams?

How many developers do you need for your startup? – A deep dive

 

Well, Guys!! this is pretty much it. A few things…
If you liked the article, do let me know in the comments. Share it with your folks. If you think any particular use case is left out, do share your insights.

This doc is continually updated as the technology evolves.

For all the articles in the pick the right tech stack series navigate here

You can follow 8bitmen on social media, do subscribe to the browser notifications for updates on the new content on the blog.

I’ll see you in the next article
Until then…
Cheers