Monday, September 29, 2014

Value proposition of PaaS

It's simple: Bring your own code. What makes it so special then?


Have you ever had a new business idea but hesitate to try it out due to the risk related to the initial investment? If your business is related to internet services, maybe PaaS can help you. 

Perhaps the biggest promise of the Platform as a Service (PaaS) is the user's ability to try new things out with minimum risk. Just take an instance, deploy your code, and pay per use. If it's aint working as a business, then just quit it, and you didn't lost much.

Snapshot of Bluemix service configuration panel.

Let's take a closer look to some key aspects:

Pay per use

Do you know how many users you'll have on your new service? Seldom one can predict that, and it makes ROI calculation difficult. How about having your costs proportional to your user count. That means fixed production cost per production volume.

Modern PaaS services like Bluemix offer innovative payment models. The base charging unit of Bluemix is Gigabytehour (GBh), somewhat similar to kiloWatthours (kWh) you're paing for the electricity. The analogy is obvious: pay per use.

Focus on your code
You do not need to care about hardware, connectivity, or the software platform. Just select the necessary middleware services you need, and put all your energy on your application, which is the one who brings all the added value after all. It's the service provided by your application which matters to your customers, not the underlain infrastructure.

In traditional IaaS approach, you need someone capable of putting it all together and setting it up, and someone to maintain it and keep things rolling. With PaaS, it's all taken care on behalf of you. You only need to understand your application details.

Instantly in service
Just a few clicks to select components and services you need, and you're ready to deploy you code to production use. How about development then? Just use the same PaaS, but developed on your own sandbox. Once it's ready to publish, just deploy it to production by simple mouse click.

Maintenance free
If something is advertised as maintenance free, it usually means you can't fix it. In case of PaaS, you do not need to fix it, as someone is already doing that, and without you even notice it. 


IBM wrote about my thoughts in their blog at Sept. 23rd, 2014 (in Finnish):  Playground for developer - Early birds experiences

One can't avoid discussing about internet services without someone asking for security. That will topic for a next postings.

Wednesday, September 10, 2014

MQTT over WebSocket

MQTT over WebSocket sounds like "tårta på tårta" in the first place, like the Swedes tends to say. But is it really like that, just plain overhead?

All major MQTT brokers do support MQTT over WebSocket nowadays, including Mosquitto, ActiveMQ, HiveMQ, and more. What is it good for? I have already discussed about differences of these two protocols in my earlier posting MQTT vs. WebSocket.

There are at least two scenarios where MQTT over WebSocket does make sense:

a) The first and rather obvious one is use of MQTT directly from script running inside Web browser. WebSocket is called as the TCP socket of the Web. And it is typically the only supported way of exchanging real-time data, in addition to http polling.So, what ever protocol you want to use in your dynamic web page with client side content rendering, tunneling through WebSocket is the only way to go.

Tunneling always causes some extra overhead in data communication, but it can do some good as well. In many organizations, firewall rules may block direct MQTT communication, but WebSocket traffic is usually happily accepted.  So it may be your only way to get through the firewall, even if you're doing no evil.

b) Not only firewalls, but there may be other technical reasons preventing usage of the protocol of your choice. Many cloud environments which are build a top of CloudFoundry standard only accept incoming connections if forms of Http(s) and WebSocket(s). In order to use plain MQTT only, an external server running the broker is needed, and the connection is then created from the Cloud to the server. Many clouds do allow doing so.

But that's a bit against the whole philosophy of cloud services. Better to have the MQTT broker running in the cloud, and let connections to be created from outside world over the WebSocket.

MQTT tunneling over WebSocket
Two or more MQTT brokers may be connected over WebSocket. In a sensor network kind of schenario, it may make sense that not every sensor connects directly to the back-end system (cloud). Instead let there be number of intermediate brokers to reduce the number of direct connections the back-end system must handle.

If sensors are installed in a plant or other controlled environment, they may use unsecured mean of communication to the nearest broker, and then only the inter-broker connection needs to be secured. The broker may also have some local data storage to buffer the data in case of connection interruptions, thus no data is lost permanently.

* "tårta på tårta", direct translation is "cake on cake". Depending on context, it may be interpreted as tautology or recursion.