Why full stack development is better?

It makes my head spin to remember how many technological changes we have experienced in the last years.  For those of us who have lived more than four decades, we not only lived during the arrival of the internet revolution, but also the PC itself and its early evolution.

I remember back in those days in 1989 how easy it was to build a small business system of Accounts Payable using dBase IV or Clipper (Clipper was an old language that came as a compiler bundled with database capabilities).  There was not object orientation, not even the concept of components,  back in those days if you wanted to have some reusable code you could only create your own .lib file by compiling and linking your functions in a procedural library. The database, front end code and any business rules used to live normally within the same executable.  I have to admit that it was easy and fun… (as long as you didn’t need to maintain the code over time…) but not by far as flexible as the tools we have today.

Nowadays the monolithic app experience is part of the past. Even if you are creating a VBA application for automating MS Office tasks, you come to the realization that even your VBA code should not be monolithic and then the layered design arises as the solution to code reuse, cleanliness and maintainability among others. That way we find once and again that for creating a professional app we need to think in creating at least three different layers.

  1. Front End Layer (Interface or GUI)
  2. Message Layer (Ideally when Web Services are necessary for message transport)
  3. Business Layer (can be in the message layer)
  4. Data Layer (your database and other data sources)

How to implement these different layers or components in an app depends many times in the developer’s decision, which can be based on a number of reasons.  I used to have my favorite mix of technologies for creating a web app myself which years ago was to use MSSQL, ASP.NET and jQuery with HTML and CSS to build enterprise apps, then evolved to use MySQL as the Data Layer, PHP Zend Apigility for the Message Layer and Ionic / Electron with AngularJS for the front end.  As you can see, there are at least three technologies that you need to master in order to build a professional enterprise, web or even mobile app, one technology or language per layer to be more precise. Now to the combination of technologies you utilize for creating such apps is called a “stack”.

The concept “Full stack” is something I heard for the first time a couple years ago in a developers conference and I remember there was much of a hype around it, the whole idea at the beginning sounded a little aberrant  to me, as it was to use a single language for all the parts of a layered app. I didn’t think it was a bad idea because of unifying everything under the same hood, I thought that was great; what really scared me at first was the fact of the language of choice to do this:  Javascript.

No, I have nothing against javascript, in fact I have been using it for long, first in ’97 when I started building websites and it was excellent for rollover effects, buttons, dialogs and things like that, I was very amazed the first time I used jQuery and for the first time I started thinking that it was worth to do something more serious with this “toy language” that didn’t have types or what it could look at the first sight a decent object orientation.  When AngularJS was out, it was very clear that with the death of Flash and Silverlight there was a new king of the hill. It was JS or nothing. But then even when I bought completely the idea of replacing Blend and Silverlight (which by the way I thought was a long shot at the time) with AngularJS and Bootstrap/Greensock.js for FrontEnd development, this new NodeJS thing in the server brought many worries to attention.   Would it be fast enough? How it would behave with a medium/high concurrency? How bad would be an error and how easy to manage? And then the web services. Microsoft made great strides with WCF allowing almost all kinds of endpoints and a pipeline for processing messages that works great with high latencies and is built on top of the .NET Framework, Also J2EE is a great platform for Web Services, Jeez, even the guys that created PHP have a very decent offer for Web Services (Apigility), how Node would provide something that even could resemble the tools of the previous mentioned heavy weights?  Well it did it to my surprise and exceeded all my expectations with Loopback.JS

Then we have the need for a tool that will help us when we need to build a website with server based technology, which is also a very valid option when you have certain logic for rendering that want done on the server, a tool like ASP.NET, Symfony, Zend Framework (PHP) or even JSP, there it was. Express.  Although I must be very honest here and admit that personally Express doesn’t convince me a lot compared with their Microsoft, Java and PHP counterparts, but it is still a young and evolving technology that I hold no doubts that in the next few years will become as robust as its PHP (at least) competitors.

So, it makes perfect sense to have a Javascript framework for creating frontend projects for our apps, it may still make sense with a tool like Loopback.JS to have javascript in our message and business layer in the server, but having Javascript in our database??  Yet still it does.  Again, I am not a fan of NoSQL alternatives. I grew up all my career learning relational databases modeling, programming and administration like MSSQL, Oracle and MySQL, then to learn now that NoSQL is a better solution?  Well it partially is.  At least for most mobile and web apps that need a very fast response time for completing queries and fetching data from the server.  I would never advise the use of Mongo (for example) over a MySQL or Oracle database for Enterprise systems that are more based on transactions, insertions, updates and deletions. SQL databases still are the best choice for scenarios like these. However the traditional web scenario where you do one CUD operations for every 10 or 20 select operations, still a document based system like Mongo or Firebase may be lightening fast and therefore the best option for managing millions of records (JSON documents).

So, basically what are the advantages of using the Full Stack approach in our apps?  Well, for example let’s assume for this scenario that we are using AngularJS 2, NodeJS with Loopback.js and a Firebase or MongoDB backend and let’s consider some of them:

Using the same language saves time

It is true, the object model for each technology may be different, but having the same approach with JS OOP, structure, promises and the whole syntax makes easier for a developer to know the whole stack than if he has to learn Javascript and let’s say PHP (plus a PHP framework) and SQL.

Javascript is fast, has great performance with high latency and is very reliable in the server…

Well, that is partially true… As long as you have a simple event pipeline connected to few calculations and some database access you will be fine, V8, which is the name of the NodeJS javascript engine, is known for its performant event management, as well as its great response to latency, however if you want to make calculations, lots of them, it is better to have a module preferably written in let’s say python that will be called by our NodeJS server app, as V8 performs very poorly with non-integer calculations. Still the simplicity of using the same language and the decent performance with high latency should be more than enough to convince us of the viability of Javascript on the server, specially when most web and mobile apps don’t normally depend on lots of mathematic operations.

No-SQL is really fast and effective for processing millions of records

As long as you are reading and not writing data.  But yet again, most web and mobile apps have normally a 1:10 ratio of write vs. read operations which makes a database engine like Mongo or Firebase the perfect choice for these scenarios.

Using the same language most of the times means also using the same IDE

Which in turns means saving time to learn new tools. It is so easy to develop against a javascript stack that you can even work the whole project only using a good editor like Sublime Text or Atom, however I would strongly advise the use of a more professional tool that will save lots of development time like JetBrains WebStorm, which is probably the greatest IDE I have seen for the Mac (Visual Studio is still by far the leader in a Windows platform, however WebStorm would still with no discussion be second place in the list).

 

Most of the languages and tools are Open Source which means saving money

If you are like me you probably love Microsoft languages and technologies, and it is truth, most of Microsoft development tools and languages have been for a long time the best tools in its class in the world. A clear proof of this is their IDE Visual Studio, which still has no match in the Windows world. However there are two problems with Microsoft, many will not agree with a so controversial point of view, but I will hold to my personal opinion:

1) Microsoft tends to kill its own products and suddenly announce after spending millions of dollars in promoting them, that they will lose support in matter of months. Many of us lived that bitter experience with Silverlight and even WPF, and I don’t know you, but I don’t forgive a company easily for betraying my trust as a developer like that. Yes I was one of those developers than in 2008 invested all my time, money and effort in learning Silverlight and become an expert with this technology, only for one year after my investment see a an event ridiculously called “Silverlight FireStarter” be the beginning of the end for the product.  The name was quite accurate, it was a fire starter, like taking Silverlight, putting gasoline on it and then start the fire…  Want some other example?  XNA.  Yes, Microsoft did it and will do it again.. and again.. and yet again…

 

2) Microsoft tools are expensive, if buying a few copies of Visual Studio and a few subscriptions to MSDN doesn’t sound like a lot of money to you, would it be an IIS hosting with Windows Server, (comparing with the costs of a server with a LAMP stack)? What about a SQL Server license package? Even the very acclaimed Microsoft cloud platform, Windows Azure with SQL Azure, which is not extremely expensive with its “Pay as you go” plans, constrains your application to run only in Windows Azure, try to taking it out to another server solution and you have to re-write the whole thing.  An application written for Windows Azure will always need to be in the Azure cloud. This may seem too obvious, but the truth is that if you have a full stack JS app, you can take it with you to virtually any hosting, as it doesn’t need a specific web server environment to run, at least, no as specific as Azure for sure.

 

Want to move your app to Web? Mobile? Desktop? Only change Front End code… a little!

Is as simple as it sounds, for example let’s say we have a web app developed using AngularJS 2 and Bootstrap 3, the very same app will work in Mobile perfectly by adding some Cordova functions and wrapping the app properly in a Cordova project.  Want something more specialized and an even more native user experience? Change the Front-End of the app to use the Ionic Framework. (Still most of your AngularJS Front-End code will be reusable), Want to move the app now to a native Desktop Application that won’t have to depend on a Browser? We only make a few changes to the Front-End code and add support for Electron and you have your desktop app working as natively and nicely as, let’s say the Atom Editor.  So easily, saves time and most importantly… money, which  is a scarce resource for any startup these days.

Conclusion

There may be many ways to build your app, there are so many buzz terms (ASP.NET MVC, J2EE, Ruby, JSP, Sencha, Meteor, PHP, Symfony, ZF2, to name a few…), old and new technologies that have presence in the software development world that is very difficult to make an informed decision if you don’t consider the pros and cons of every single option. We have done that for you, and it was the kind of research that takes weeks for a team of seasoned professionals, it is not easy to quit to your personal preferences and think impartially, I am very happy with the result of such exercise at GeoSys and that is why we recommend you the use of a Javascript Full Stack solution for your next Web or Mobile project.  Even if you still want to use a different stack for specific reasons we support you with a team of experts in .NET, PHP or Java technologies, we know that every case is different, but for most of them we recommend the JS Full Stack solution because we know.  I hate to sound too pretentious, but that is what experience is for, to know how to make good recommendations, isn’t it? 🙂

Posted in Development, MEAN Stack, Software.

Will de la Vega

Will de la Vega has been a full stack developer for more than 15 years now. He has created solutions for large websites, social media software, healthcare systems and political marketing, among others, using C# ASP.NET jQuery, Angular and React.
In his spare time he is learning how to write a decent blog article.