Server-less Architecture

Using AngularJS & Firebase

There are lot of write-ups on the pros & cons of server-less architecture. How it creates vendor stickiness, high TCO, it is restricted to certain technologies, it is not a panacea. I’m not going to get into that argument. One thing, I will buy into is that “it is not a panacea”, everything else is debatable. There are many ways of achieving the sever-less architecture and the one we discussed earlier is AWS and the lambda functions. Yes, it is still a choice but IMHO, it takes orchestration of so many individual components of AWS. You need Lambda, API gateway (to make it REST), Cognito or other Auth providers, DynamoDB or other Database and more.

Google has come up with a platform called Firebase.  It is so simple and concise. What initially started as a JSON database has evolved into a full-fledged platform that encompasses all AWS components that I mentioned above. It can host, it can offer authorization, it can authenticate with 3rd party providers such as Facebook, Google, it can store data and if I missed something, you know what? it can do that too 🙂 (you still need to develop the fron-end website) The biggest drawback is that working on Firebase makes you equivalent to an astronaut on the ISS doing a spacewalk! Yes, remember ISS moves in a geostationary orbit @ ~17k miles an hour? well, Google is not that fast! but they keep constantly updating the platform in weeks if not hours. That is the constant challenge. If you need help and came across a video that is a year old, well – forget it. You need to find something that is not more than six months old at the max.

The simplest and fastest way to get up and running in production is to use AngularJS for the front-end and Firebase for the back-end. For most apps, the free version of Firebase is good enough. You can right your code in AngularJS, minify using tools like gulp, google offers a Javascript SDK / library called AngularFire to interface with Firebase from Angular. You need to do few minutes of configuration on the console for enabling authentication, authorization, you can copy the configuration details (like db connection string) and no need for any secret key / password to be stored on the client side, all authorization is done on the server side. Thus you don’t need to worry that your secret keys are getting exposed.  Once you develop the web-app in AngularJS, minify using gulp, you can host the website either in Firebase or AWS S3 (How to host on S3).

If you are a startup, you want to validate and get an MVP out quickly, this is a great platform. You can even continue to run until you reach a critical mass and if you feel any bottleneck, you can afford to build on any platform. Google platform can scale and where I see problem is if you want to download your data from Firebase, it gets tricky. Even if you are big corporation and need to quickly get a web-based app or need a website to manage an event that is coming up or anything that is not going to run for years and that IT says it will take years to build, I will say nothing can be cheaper and faster than Firebase.

If you have thoughts and want to discuss, I’m always open, drop me a line.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: