Serverless architecture: Amazon vs Azure


I’ve been reading about serverless architecture, starting in this article http://martinfowler.com/articles/serverless.html, written by Martin Fowler.

Yes, sure, and now you are going to summarize the article.

Not at all, italic voice, I am trying to add more value to that article and, at the same time, take some notes I can review in the future.

As Martin Fowler was talking a lot about AWS Lambda, I was trying to see if there is something similar in Azure because, as Amazon says, Lambda functions are to be written in Java, Node.js or Python and neither of those is my main backend language. I have nothing against none of those languages or against Amazon, but, if I can choose, I prefer to write code in C# and deploy it to Azure (and I believe I am not the only case), just because of my knowledge and experience. I’ve been reading from lots of different websites and I have written this article not with my own experience, but with my compendium of information obtained.

So, let me understand, all this article is because you don’t know how to write code in Python?

No, italic voice, I don’t mind learning new languages, I think it is a good thing, the point here is, there are more actors in the market and, as a TA, I need to know the most relevant to offer alternatives to my clients.

I assume that not many companies are ready for such a huge change of philosophy and, more than the companies, the IT teams behind them. If exposing data from their well protected backend to the outside, even throughout very well secured API Gateways is seen like a weakness in some IT departments, if we remove the backend server from the equation, the heat is starting to hit the room. The idea of losing control of their servers would drive crazy more than one security engineer. The idea of the neediness of their services to configure scalable virtual machines, would make more than one job obsolete. It is our responsibility to give good and enough information to our clients when we propose a solution for a problem, and provide good reasons for the change and, in order to do that, research is our allied, with research we can answer the why’s and the how’s. I tried to do that in this article, at least, for me as a notebook.

Uh huh! Gotcha! What you want is a justification to remove people from projects!

Not at all, italic voice, what I need to understand, is the differences between platforms, because perhaps in the near future I will need to advice some client with them.

Let’s be clear, serverless does not mean no server is used, it means, according to ThoughtWorks: “Serverless architecture replaces long-running virtual machines with ephemeral compute power that comes into existence on request and disappears immediately after use.” So, yes, there is a server. The main difference is you don’t have to care about scale, provision or operation.

Such an architecture is really efficient in terms of compute power, but, on the other hand, makes harder to deploy, manage and share code amongst services.

So, lately I read a lot about AWS Lambda but, surprisingly, I haven’t found too much information regarding the equivalent in Microsoft Azure. There is an equivalent and, as there is, it is needed to be compared before to advise any client willing to start thinking on this cutting edge architecture.

More info in AWS Lambda here: https://aws.amazon.com/lambda/

More info in Azure Functions here: https://azure.microsoft.com/en-us/documentation/articles/functions-overview/

So, which one is better? As usually, it depends. Do you need to write the code in C#? You can’t use Lambda. Do you need to deploy your serverless architecture on premises? You can’t use Lambda. I’ve read somewhere (I don’t really know where at the moment of writing this) that Lambda supports up to 100 concurrent executions and Functions only 10. In that case, Lambda is the winner. Let’s get into some details and differences between them:

Languages:

Lambda supports Java, Node.js and Python… for now.

Functions supports C#, F#, Node.js and PHP. They also claim for Java, bash and batch files, but I believe those are still in beta.

Organization:

Functions are organized in something called App Service which is a group of functions that share memory. This is radically different in Lambda, where you allocate memory per function. This concept is important, because in Azure, you pay per time and memory used.

Deployment:

Functions can be deployed using just an FTP client, but, also, you can link your CI environment to the deployment folder easily, including TFS, Git and even OneDrive and others.

One important thing in the CI aspect is the versioning. Functions does not support versioning while Lambda does.

I am no expert in Lambda, but I’ve read about some third party tools to deploy the functions, for instance, here you have something to test and deploy (Node.js) (https://www.npmjs.com/package/aws-lambda-toolkit).

Execution:

Microsoft Azure Functions are open source. Yes, you’ve read right. They are open source, like almost everything new Microsoft is doing, so, yes, you can run it locally. On the other hand, Lambda is not, but I’ve read about some custom tools created to run the functions locally before to deploy.

Wait, no way, Microsoft open source, since when?

Yes, italic voice, since the new CEO took control of Microsoft, a lot of things have changed, like that, for instance, if you search for Microsoft Open Source code in GitHub, you will be amazed…

Functions does not have an execution limit, but Lambda does. Why is this important? Because of billing. With Lambda you can be sure that even though you have a sleepy process that is taking forever to execute (not a normal behavior), that process will be killed in 5 minutes. In Azure, you can be sure your bill will be huge if you are not monitoring the functions closely.

Ok, so after all that literature in favour of Microsoft, you are saying that Lambda is better?

No, italic voice, I am not saying that, in fact, I am not in favour of Microsoft nor Amazon what I say is that, after some research, it seems to me that AWS Lambda is being adopted prior to Functions because:

  • They are Amazon
  • They were there first
  • They are not Microsoft
  • And yes, they are Amazon

And many people are not considering Microsoft seriously and they should. But, that said, that is my opinion and I hope this article can be as a starting poing of a discussion that help me and others to understand better Serverless Architecture, what vendor advice to clients and why.

 

I hope you enjoyed the reading.

 

Victor

Thanks to www.cienciadesofa.com for the italic voice idea.

Anuncios

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s