crafting software

Choosing the Cloud is more difficult now as vendors regularly drop prices and offer new features. I’m sure there is no clear winner and each will have each own strength and weakness. So, it is better to set the context before we compare.

Context

Team is small but all are seasoned developer.

Going to release multiple times per day.

At least two environments. Dev, Production.

At least need to develop one web application and one mobile app.

PaaS is always preferred than IaaS.

Only AWS, Azure or Google.

Main development platform will be either .Net Core or Golang.

Basic Architecture

This is very typical architecture for public facing web application. Of course, it could be split into many micro services - it would be multiple API services calling each other.I think this diagram is good enought for the very high level architecture.

The following table describes the components and related cloud features.

AWS

Azure

Google Cloud Platform

Web API

Elastic Beanstalk

Azure WebSites

AppEngine

Database

Amazon RDS

Azure SQL

Datastore/Cloud SQL

Storage

Amazon S3

Azure Storage

Cloud Storage

Jobs

Amazon Lambda

Azure Functions

AppEngine/Cloud Functions

CI

third-party

VsTeam Services

third-party

Web API

Elastic Beanstalk

Azure WebSites

AppEngine

Managed

3

4

5

Price*

$70.08

$204

$25.55

Managed services mean server is maintained by provider. The higher number, the better. I gave Azure WebSites to 4 because it doesn’t have other features compare to AppEngine such as version splitting, no downtime deployment, no free centralize cache (memcache/redis), etc.

Container

How about Container?

Container has been very porpular in recent years and many company bet on that as future software packing. Even Microsoft partner with Docker to bring Docker to Windows (Nano Server). It won’t be too long for Microsoft own Container Service will land to Azure. Anyway, for now - there is only two horses (AWS and GCP) in this race.

I personally haven’t tried but both of them are just sit on top of VMs. If comparing VMs, Google Cloud Platform has some edge on that and their container engine is K8 is opensource - that will bring portability if you need to host in on-premise servers.

BizSpark

You may notice that Azure is a bit more expensive than others but they have nice BizSpark program. With that, you will get $150/month credit for 3 years.

That will help you to run without spending money for 3 years but after that you still need to pay.

Conclusion

If you have reach this far, I believe you notice that I’m a bit toward Google Cloud Platform because of their pricing model (Per-Minute Billing and Automatic Discounts) and their PaaS offering such as AppEngine, StackDriver and Container Engine.

But. You will never wrong for choosing one because each has their own strength. The real pros and cons is depends on YOU. (Your Team, Skillset, Business deal/startup accelerator, etc.).

The best way to choose is draw your architecture and do some research on that with all three providers.

Run the jekyll

If you are on windows, cloning with https may be a better option for you. You don’t have to set up ssh agent (which sounds alien for most windows user). You also don’t have to enter password every time you use, you can cache your password by following github’s article. In short, make sure you have msysgit 1.8.1 and above and set credential helper as follows:

git config --global credential.helper wincred

Two factors authentication

But after you enable 2FA, the above method doesn’t work anymore. We need a few more steps to make https url work with 2FA.

I was playing with squid to set up as forward proxy. If you are not sure about proxy, there a great answer at stackoverflow. In this post, I will use Azure as Cloud platform, but it should also work on Amazon as well.

Set up a Linux VM

We will first create a linux VM using Azure portal and later we use PuTTy to access.

I will just choose user name with password. If you prefer SSH key, you can also use that too.

I’ll create new CLOUD SERVICE as well - if you are wondering what cloud service is, it is just the container of one or more virtual machines. Please note that there is CLOUD SERVICE DNS NAME - we will use that name to connect the vm.

Now, I’ll use PuTTy to connect the vm (We just need Putty.exe). The host name will be cloud-service-name.cloudapp.net - in my case, the host name is squidpxy.cloudapp.net.

After connect, you should be able to log in with user name and password.

Install and configure squid

Before install anything, we will update the system itself first.

$ sudo apt-get update -y
$ sudo apt-get upgrade -y

We will install Squid and some utilities that we need later.

$ sudo apt-get install squid apache2-utils

We are going to use HTTP Digest authentication to authenticate users using a local password file. Let’s create the password file.

It is the time to configure squid. The default configuration file is in /etc/squid3/squid.conf with thousands of line - because it is heavily documented configuration file. I think it is better to create new file than editing the default config.

Accessing via squid

When the browser prompt the dialog box, enter user name and password. You should be able to browse via proxy now. You could test your IP at http://whatismyipaddress.com/. It should be different if you test your IP with different browser.