Next in the series on series of IoT considerations is the varied landscape of infrastructure in the cloud — Infrastructure as a Service, Platform as a Service and Software as a Service.
Server side needs
Regardless of what you’re doing, you’ll need a place to run your backend server code. This will generally do everything from allowing the hardware to connect, authentication and access control, security, provide the API and web services, serve frontend resources, run some logic, etc etc.
In the real world, these may not all come out of the same piece of server code. By using services or micro-services you can split up the code into more logical chunks. But for now, we’re looking at ways of running code in the cloud instead of how it is architectured, so let’s assume a single chunk of code and move on! We’ll talk micro-services (and containers) another time.
Self hosted -vs- IaaS -vs- PaaS -v- SaaS
There’s, er, a lot of *aaS on the scene these days. No, i’m not intentionally being crude — the “aaS” stands for “as-a-service” and it can be prefixed by nearly anything.
Infrastructure-, Platform-, Software-, Whatever you’re having- as a service. You usually pay a monthly fee and get a service, be it a piece of software you can use, a platform or service on which to run an application, or a virtual server, with which you can do what you want.
And don’t forget — you could always just put some servers on a rack in a datacentre yourself! So, there are a lot of options, let’s take a look through them.
Using cloud services
Cloud services can greatly reduce time to market, take the hassle out of managing infrastructure and generally make things easier, usually at a price.
Cloud services can broadly be broken down into three categories.
SaaS (Software) is something you simply sign up for and generally start using with little or no customisation. For example, Google Apps, Office 365, Basecamp, etc. You simply consume SaaS.
PaaS (Platform) is something which you use to help build or run your own applications more easily — e.g. a managed environment for running code or a DB as a service — examples are Google Compute Engine, Amazon RDS database server, Michrosoft SQL Azure, Amazon Elasticsearch, Heroku. You can build your applications on these platforms.
IaaS (Infrastructure) is core IT infrastructure — e.g either rent a virtual server and do with it as you will, or to provide solutions for file storage, load balancing or some other “network type” problem. Examples are Amazon EC2, Amazon S3, Google Compute Engine, Azure Virtual Machines. These things can replace existing IT infrastructure — e.g. migrate to it.
So, let’s start from the deepest level and work our way up.
Infrastructure as a Service
Infrastructure as a Service is like the nuts and bolts. It doesn’t tell you how to do things, it just gives you the infrastructure to do it.
For example, Amazon AWS, Google Cloud and Microsoft Azure (among many others) all provide many of the traditional “IT” or operational functions as a service.
The most widely used case is that instead of building a new server from scratch and loading windows or linux, you can just click your mouse a few times and spin up a virtual machine, to your specs, pre-loaded with the OS of your choice.
There is no capital cost, instead you pay as you use it. If it is only running for one hour of the day this is what you pay for. Or, if you commit to running the server for multiple years and upfront you can get substantial discounts on running costs.
Other services, like load balancing, cloud file storage, administration, caching and security/firewall/ddos prevention are also available from many vendors.
IaaS is completely non-opinionated — that is, they provide a service to you to do whatever you wish with it.
It’s an evolution of what happened physically over the last 20 years of the web — but instead of deploying physical products you can now purchase a service in just a few clicks.
Platform as a Service
A Platform as a Service is a little higher level than IaaS. You leverage the platform to build your own applications — but by and large the reality of what is underlying the platform is abstracted away from you.
For running web applications in various languages, platforms such as Google Compute Engine, Heroku, Azure App Service or AppFog let you write and upload your code and just set it running. AppFog have a nice tagline which sums the concept up quite well - “Work on Code, Not Infrastructure Management”.
This is the key to a PaaS — purists might argue that you are losing control — and this is true to an extent — but the counter argument is that when building a new product or startup, surely you should focus 100% of your energy on your product, not building the infrastructure to run it?
But — and it’s a big one — there is one proviso. I’m not completely sold on using a DBaaS (DB as a service). Like the platforms for running code, DBaaS gives you a platform in which to put your data.
You can buy DBaaS in nearly any format (SQL, DocumentDB, BigTable, GraphDB, etc) which behave identically and are API and query equivalent to their product equivalents (e.g. Sql Server / PostgreSQL / MongoDB / Cassandra / Neo4J etc)
The downside of running your DB in a hosted environment alongside thousands or millions of other people’s DBs is one of threat — these services are prime targets for malicious attacks which could give others access to your account or data — and possibly lead to the comprimise or destruction of data. See an example from 2013 here.
Of course, this could happen on a code-hosting PaaS too — but if something happens there you just redirect the domain to an identical copy running on a different host, or spin up your own VM and self-host it. But when you have terabytes of user data, it’s more difficult to just “spin up” another DB.
That’s not to say that hosting it yourself or on a virtual server is much more secure — in fact, if mis-configured, it could be much worse. But at least you are the arbiter of your own data’s destiny.
Software as a Service
Software as a service is an interesting one. You may use it for your core business functions — or you may use something which is a mix of SaaS/PaaS in one to build applications on too.
Straight SaaS soultions will help you run your day-to-day business (Office 365, Google Apps, Gmail, Basecamp, Zoho), manage your development (Github, Bitbucket, Jira, Bamboo, Slack), automate your processes or tasks (Zapier, Workato, etc), help you track application logs (Loggly) or application/server performance (New Relic)
Using these is pretty much a given for any startup on non-enterprise customer, unless you absolutely *must* run your own local software.
But there are more powerful SaaS offerings which blur the line between SaaS and PaaS. Anyone who has worked in a medium sized organisation will be familiar with CRM. Incumbent enterprise solutions are Salesforce and Microsoft Dynamics.
Salesforce is a good example — you pay your money, you use your CRM. But it actually goes far beyond that — allowing custom “objects” (like tables) in the database, fully customised UI layouts and custom logic. Even further, it lets you build custom html5 based pages, and even apps.
So utilising SaaS can go far beyond just productivity — you could even build your business on it.
Alternative — Build your own
Of course, the is the decades-old approach where you buy some servers, put them in a rack, build your own server environment, infrastructure and code, and put it live.
If you have certain requirements — extreme security, heavy processing, a need not to have multi-tenancy code running in your stack, then it’s worth considering.
If not, then this is generally not the favoured approach to getting up and running quickly today. It takes time and effort to set up, but you do fully “own” the infrastructure, and if this is essential to you, then go with it.
If you’re trying to rapidly push a product to market, it would be foolish not to at least evaluate IaaS/PaaS/SaaS to see if it can speed up your development time. Make sure you consider it carefully before you kick off your IoT project.
Next time, I’ll take a look at the world of Database and storage technology — which has advanced a long way form the days of simple tables and files — and how you can leverage new ways of storing your data.
Update — Part 7 is now available: IoT considerations — storage and database, SQL, NoSQL, historical data
Des Flynn is CTO of Lattice Research, who help companies to design, build, deploy, operate and service innovative and cost-effective IoT control systems to meet their customer’s needs. More information at www.lattice.ie