Using Microservices To Build Cloud Native Applications – Part 1

In my previous post I described at a high level what it means to build a cloud native application and hopefully gave you an idea of why building applications in the cloud can be different than you may be used to.  One thing many cloud native applications have in common is that they are often built using a microservices architecture.  But before we talk about microservices lets talk about the types of applications most people are familiar with building today.

Building Cloud Native Applications

The nature of my job forces me to build quick simple sample applications that are easy to understand and demonstrate a single concept.  After all I am trying to enable developers, and making something overly complex generally turns developers off when they are trying to learn something new.  However I often hear questions about how to build real world production grade applications that run in the cloud.  This is something that is very hard to demonstrate simply because, lets face it, no production quality application has ever been considered simple to understand.  However, I do think it is an important topic to address because if you are serious about building an application in the cloud you should understand how cloud applications are different from your everyday app that everyone is familiar with building.

Using Bluemix and The IBM IoT Foundation To Control A Drone

Drones have been getting a lot of attention lately for both good and bad reasons.  Regardless of what the reason may be the bottom line is there are a lot of untapped uses for drones. Everything from delivering your online packages to helping first responders at the scene of an accident.  Whatever the use case may be there needs to be a robust infrastructure behind these drones to manage them.  The cloud is an ideal choice in this use case because you will more than likely have many many drones and need a dynamic infrastructure to handle the varying needs of the drones and the applications controlling them.  Obviously Bluemix is my cloud of choice :)but in addition to the infrastructure Bluemix provides we also have the IoT Foundation which provides you with the ability to manage your connected devices.  I recently had the opportunity to work with some drones for a couple of weeks and decided to use Bluemix and IBM’s IoT foundation to see how you can control drones.  Check out the short video below of what I have done so far :)

An Introduction To The New IBM Containers Service

If you logged into Bluemix late last week you might have noticed some changes.  Probably the biggest change you might have noticed is that the IBM Containers service has moved out of beta and is now generally available.  If you are not familiar with the IBM Container service in Bluemix let me spend a minute describing what it does.  The Containers service gives you the option of deploying your application as a Docker container to Bluemix.  If you are not familiar with Docker you can read more about it on the Docker website.  Docker has become increasingly popular as a way of distributing and running applications because of the portability it provides.  It is similar to VMs but much more light weight and flexible, making it easy to package your application in a Docker container and have it run exactly the same in any environment.

Build A Translation REST API With Watson, Node-RED, and Bluemix

Today I was looking at some of the new Watson nodes for Node-RED created by my colleague James Thomas and was presently surprised how easy it was to start using the Watson services in Node-RED.  (I am not sure why, I was surprised everything in Node-RED seems to be easy)  For one of my upcoming presentations I put together a simple flow for a REST API that uses the Watson Machine Translation service in order to translate text POSTed to an API endpoint.  Below is a video I created of how easy this was to do.

 

 

If you are interested in adding the flow to your Node-RED instance copy the below JSON and import into a sheet.  Note: you will need a Watson Machine Translation service bound to your Node-RED app in order for the flow to work.

[
    {
        "id": "e317bb59.6978a",
        "type": "http in",
        "name": "",
        "url": "/translate",
        "method": "post",
        "x": 216,
        "y": 115,
        "z": "be5832fc.ca9ca8",
        "wires": [
            [
                "e7f0c9c6.0a838"
            ]
        ]
    },
    {
        "id": "e7f0c9c6.0a838",
        "type": "function",
        "name": "",
        "func": "msg.payload = msg.req.body.txt;\nmsg.lang = msg.req.body.lang;\nreturn msg;",
        "outputs": 1,
        "valid": true,
        "x": 454,
        "y": 113,
        "z": "be5832fc.ca9ca8",
        "wires": [
            [
                "8b9210eb.1de0e8"
            ]
        ]
    },
    {
        "id": "8b9210eb.1de0e8",
        "type": "watson-translate",
        "name": "",
        "language": "",
        "x": 665,
        "y": 106,
        "z": "be5832fc.ca9ca8",
        "wires": [
            [
                "1f345415.c4af44"
            ]
        ]
    },
    {
        "id": "1f345415.c4af44",
        "type": "http response",
        "name": "",
        "x": 892,
        "y": 101,
        "z": "be5832fc.ca9ca8",
        "wires": []
    }
]

 

Performing Zero Downtime Deployments From IBM DevOps Services To Bluemix

In my previous blog post I showed how to setup a deployment pipeline in IBM DevOps Services for a Maven project.  The problem with that pipeline was that while the deployment is happening your application is unavaialable.  Obviously in a production situation this is unacceptable, we need our application to be available 100% of the time (or as close to that number as possible).  Luckily Bluemix allows us to map the same route to multiple applications allowing us to take advantage of the Cloud Foundry Router to load balance requests between multiple applications.  This allows us to keep the old version of our application running while deploying the new version.  Once the new version is deployed requests to the route will be sent to both versions of the application.  After we have verified that the new version of the application is working we can delete the old version or if the new version is not behaving as anticipated we can delete the new version and direct all users back to the old version until we can fix the problem.  This process is referred to as blue/green deployments.

Building and Deploying Maven Projects To Bluemix With IBM DevOps Services

Recently I had gotten a couple questions regarding how to build and deploy a Maven project to IBM Bluemix using IBM DevOps Services.  It is actually very simple to do, especially if you are familiar with the Maven and Cloud Foundry CLIs.  Below are two videos on how to setup a build and deploy stage for your Maven projects.

IBM Bluemix Keynote From The O’Reilly Software Architecture Conference

Yesterday during the keynote at the O’Reilly Software Architecture Conference in Boston MA, my colleague Mark Vanderwiele gave a 5 minute keynote talk on IBM Bluemix, Watson, and IoT.  Mark demoed an app our team had put together using IBM Watson’s speech to text and text to speech services to control a Sphero Ball using the IBM IoT Foundation.   You can watch a replay of the keynote below.

Easily Secure Your Bluemix Apps With Auth0

A topic that often comes up when I speak to other developers building apps on Bluemix is authentication.  Many developers are comfortable with securing their apps in traditional development models.  In the cloud, authentication is often slightly different.  For example, you must store session data in an external data store instead of relying on what the app container provides.  When you want to connect to an existing LDAP, Active Directory, or SAML service, that is even more daunting

Bluemix Java Developers: Your life just got a little easier!

….well I hope anyways 😉