A few years back, if you were a service based company (developing products for customers), and a product owner came to you with his requirements of a cloud application / product (basically a web app + iOS and Android and a web based admin panel to monitor it all, think of UBER, Facebook), you would be using a PHP framework like Codeigniter, Laravel, CakePHP or even core PHP for the back-end and the standard HTML+CSS+Bootstrap for the front-end for your web application. For your iOS and Android apps, you would have to stick with native technologies like Swift, Objective C and XML+Java respectively.
This means, you would create three back-ends and three front-ends. The three different applications will now share the common database, which would mostly be MYSQL.
But in the past couple of years, the world has been taken by storm by innovations throughout the complete stack — front end, back end and the database. Even the ORMs we use to interact with the databases are completely different now.
So, what has changed and how does it affect us?
Here are the things that have been affected –
- Application structure
- Back end architecture
- Code reusability
The new approach changes the entire way you look at these cloud based products. With the help of React Native or Flutter (both are competitors), you can create iOS and Android front-ends at the same time!
Instead of creating three different back-ends, now, all you have to do is create a single back-end using NodeJS.
NodeJS allows you to create a server and all the functionalities can be served to an external client using APIs and routes created in a middleware called Express (you can use Koa and Hapi in the place of Express as well).
This means that NodeJS will be the only entity communicating with the database (could be MongoDB). This reduces the number of requests and functions happening on the database level and also removes the complexity which was faced in the past, entirely, by creating just one server and one back end (NodeJS) instead of 3 different back-end and servers. So, NodeJS runs all the queries on the database (Mongo in this case) using an ORM (mongoose) and serves this queried data using APIs that need to be called by any external entity / app etc.
Now, the fun part is, that this external entity could very well be your own three front-ends -> XML (for android), Swift (for iOS) and Bootstrap (for Web).
You can further reduce your work by using Flutter or React Native (as discussed earlier) and create iOS and android together. The web front end could be created in ReactJS which in itself provides a lot of code re-usability by dividing the page into reusable components. This new approach significantly reduces the amount of work you now need to do in order to build a digital product in 2018. The diagram below explains this new technique ->
In short, all that we are doing now is this -> instead of creating three different back-ends, create only one (NodeJS), instead of interacting with database with three different back-ends, only one back-end interacts with the database, thereby reducing chances of failure and reducing failure to sync between the three entities. Even for the front-end you can save a lot of time by using flutter or react native and building iOS and android at the same time and for the web front ends, we can divide it into reusable components by using ReactJS and save time on coding down everything.
We at Myrl Tech (http://www.myrl.tech/) develop some of the most complex applications for our clients. Feel free to get in touch.