ibm-cloud-architecture / refarch-cloudnative

This project provides a Reference Implementation for building an OmniChannel Application using a microservices-based architecture.
Apache License 2.0
70 stars 54 forks source link

Digital Applications using a Microservice Architecture

Architecture

This project provides is a Reference Implementation for building a cloud-native OmniChannel Application using a Microservices architecture. The Logical Architecture for this reference implementation is shown in the picture below.

Application Architecture

Application Overview

The application is a simple store front shopping application that displays a catalog of antique computing devices, where users can buy and add review comments. It has Web and Mobile interface, both the Mobile App and Web App rely on separate BFF (Backend for Frontend) services to interact with the backend data.

There are several components of this architecture.

Project repositories:

This project organized itself like a microservice project, as such each component in the architecture has its own Git Repository and tutorial listed below.

This project contains tutorials for setting up CI/CD pipeline for the scenarios. The tutorial is shown below.

This project contains tutorials for setting up Resiliency such as High Availability, Failover, and Disaster Recovery for the above application.

Run the reference applications locally and in IBM Cloud

To run the sample applications you will need to configure your Bluemix enviroment for the API and Microservices runtimes. Additionally you will need to configure your system to run the iOS and Web Application tier as well.

Step 1: Environment Setup

Prerequisites

Install the Bluemix CLI

In order to complete the rest of this tutorial, many commands will require the Bluemix CLI toolkit to be installed on your local environment. To install it, follow these instructions

This walkthrough uses the cf tool.

Create a New Space in Bluemix

  1. Click on the Bluemix account in the top right corner of the web interface.
  2. Click Create a new space.
  3. Enter "cloudnative-dev" for the space name and complete the wizard.

Get application source code

Building Microservices with Docker Containers

Step 2: Deploy Netflix Eureka/Zuul components to Bluemix Container

We used the Netflix OSS stack to provide some of the Microservices foundation services such as service registry and proxy/load balancer.

Please follow the instruction in refarch-cloudnative-netflix-eureka repository to deploy Eureka to Bluemix.

Please follow the instruction in refarch-cloudnative-netflix-zuul repository to deploy Zuul to Bluemix.

Step 3: Deploy Catalog and Inventory microservices to Bluemix Container

After completing this step, you should have the Catalog and Inventory microservices deployed in Bluemix and interacting with ElasticSearch and MySQL database. You can unit test the microservice as documented in the instruction.

Please follow the instruction in refarch-cloudnative-micro-inventory repository to build and deploy Catalog and Inventory microservices.

Step 4: Deploy Customer and Authentication microservices to Bluemix Container

After completing this step, you should have Customer microservice deployed in Bluemix and interacting with hosted Cloudant database as user identity store. And you should have Authentication service deployed to be used API Connect OAuth flow.

Step 5: Provision Watson Analytic services and Deploy SocialReview microservice to Bluemix OpenWhisk runtime

After completing this step, you should have SocialReview microservice deployed in Bluemix OpenWhisk and interacting with hosted Cloudant database. You should also have Watson tone analyzer provisioned.

Please follow the instruction in refarch-cloudnative-micro-socialreview repository to build/deploy the microservice to Bluemix.

Step 6: Deploy Order microservice to Bluemix Container

After completing this step, you should have the Order microservice deployed in Bluemix and interacting with MessageHub and MySQL database. You can unit test the microservice as documented in the instruction.

Please follow the instruction in refarch-cloudnative-micro-orders repository to build and deploy Catalog and Inventory microservices.

Publish APIs and setup API Gateway with Bluemix API Connect

Step 7: Setup your API Connect Gateway

Provision the API Connect Service

  1. Log in to the Bluemix console
  2. From the Bluemix menu, Select Services -> APIs, then click the API Connect tile in the page.
  3. In API Connect creation page, specify the Service name anything you like or keep the default. Then select the free Essentials plan for this walkthrough. Click the "Create" button to provision the service.
  4. After the API Connect service is created, you will be automatically redirected to API Management console.
  5. In the API Manager page, navigate to the API Connect Dashboard and select "Add Catalog" at the top left. You may notice that a sandbox has automatically been generated for you.
    API Info
  6. Name the catalog "BlueCompute" and press "Add".
  7. Select the catalog and then navigate to the Settings tab and click the Portal sub-tab.
  8. To setup a Developer Portal that your consumers can use to explore your API, select the IBM Developer Portal radio button. Then click the "Save" button to top right menu section. This will provision a portal for you. You should receive a message like the one below. API Info
  9. Once the new Developer Portal has been created, you will receive an email.

Installing the IBM API Connect Developer Toolkit

The IBM API Connect Developer Toolkit provides both the API Designer UI and a CLI that developers can use to develop APIs and LoopBack applications, as welll as the tools to publish them to the IBM API Connect runtime.

Before getting started, you will need to install Node.js version 0.12 or version 4.x, follow the link below for more information details. https://www.ibm.com/support/knowledgecenter/en/SSFS6T/com.ibm.apic.toolkit.doc/tapim_cli_install.html

To install the APIC Connect CLI:

$ npm install -g apiconnect
$ apic --version

That should install the tool and print the version number after the last command.

Step 8: Publish application APIs to Bluemix API Connect

Once you have all the backend application (Catalog/Inventory/Customer/Order/SocialReview) deployed, it is time to publish the APIs to the IBM Bluemix API connect and Setup developerPortal to consume the API.

Please follow the instruction in refarch-cloudnative-api repository to publish APIs to Bluemix API Connect runtime.

Building Web and Mobile Applications

Step 9: Deploy the BlueCompute Web app

This step will deploy the Node.js application containing both the Web BFF and the front end AngularJS application.

Please follow the instruction in refarch-cloudnative-bluecompute-web repository to setup and validate your Web application.

Step 10: Integrate the BlueCompute iOS app with IBM Cloud and Mobile Analytics

Time to test the application end-to-end. You can start with running the iOS application to integrate with the APIs as well as monitoring the application using Bluemix Mobile Analytics service.

Please follow the instruction in refarch-cloudnative-bluecompute-mobile repository to setup your iOS application.

DevOps automation, Resiliency and Cloud Management and Monitoring

DevOps

You can setup and enable automated CI/CD for most of the BlueCompute components via the Bluemix DevOps open toolchain. For detail, please check the DevOps project .

Cloud Management and monitoring

For guidance on how to manage and monitor the BlueCompute solution, please check the Management and Monitoring project.

Making Microservices Resilient

Please check this repository on instructions and tools to improve availability and performances of the BlueCompute application.

Secure The Application

Please review this page on how we secure the solution end-to-end.