Building a multi-tenanted Cloud-native AppServer

56
Building a scalable multi-tenanted Cloud- native Application Server using Tomcat, Axis2 & Synapse

description

Apache Tomcat is one of most popular & widely used Application Servers, and Apache Axis2 is one of most widely used Java Web services servers. Apache Synapse is one of the popular, high performant ESBs widely used in the industry.In this session, we will look at how we combine these great projects from the ASF into building a scalable, elastic,multi-tenanted Application Server, which allows you to deploy cloud-native webapps on the Cloud, and benefit from all the advantages that Cloud Computing brings in. We will also see how easy it is to deploy any standard webapp on the Cloud, and seamlessly integrate with the authentication, authorization & management infrastructure provided by the underlying Platform-as-a-Service (PaaS).

Transcript of Building a multi-tenanted Cloud-native AppServer

Page 1: Building a multi-tenanted Cloud-native AppServer

Building a scalable multi-tenanted Cloud-nativeApplication Server

using Tomcat, Axis2 & Synapse

Page 2: Building a multi-tenanted Cloud-native AppServer

Building a scalable multi-tenanted Cloud-native

Application Server using

Tomcat, Axis2 & Synapse

Afkham Azeez

azeez@{apache.org , wso2.com}

WSO2 Inc

Selvaratnam Uthaiyashankar

shankar@{apache.org, wso2.com}

WSO2 Inc

Page 3: Building a multi-tenanted Cloud-native AppServer

© WSO2 2011

About the Presenters• Afkham Azeez

– PMC member Apache Axis, Committer Synapse & Web Services– Member, Apache Software Foundation– Co-author, Axis2 Web Services– Director of Architecture, WSO2 Inc– Blog: http://blog.afkham.org

• Selvaratnam Uthaiyashankar– PMC member Apache Axis & committer Web Services– Member, Apache Software Foundation– Senior Manager & Senior Architect, WSO2 Inc

Page 4: Building a multi-tenanted Cloud-native AppServer

Agenda

• Overall Architecture• Elastic Load Balancer• AppServer• Logging• Data & storage• Metering & billing

Page 5: Building a multi-tenanted Cloud-native AppServer

Cloud Nativity

Page 6: Building a multi-tenanted Cloud-native AppServer

Overall Architecture

ELB AS1 AS2 AS3 ASn

Application Server - Elastic Cluster

Clients

Page 7: Building a multi-tenanted Cloud-native AppServer

Elastic Load Balancer

- Based on Apache Synapse & Apache Tribes

Page 8: Building a multi-tenanted Cloud-native AppServer

Highlevel Architecture

Page 9: Building a multi-tenanted Cloud-native AppServer

Service Cluster Aware Load Balancing

Page 10: Building a multi-tenanted Cloud-native AppServer

Practical Example

Page 11: Building a multi-tenanted Cloud-native AppServer

Configuration

Page 12: Building a multi-tenanted Cloud-native AppServer

Proxy Port to Real Port Mapping

Page 13: Building a multi-tenanted Cloud-native AppServer

Proxy Port to Real Port Mapping

Page 14: Building a multi-tenanted Cloud-native AppServer

Synapse Message Flow

Page 15: Building a multi-tenanted Cloud-native AppServer

Membership Channels

Page 16: Building a multi-tenanted Cloud-native AppServer

AppServer

- Based on Apache Tomcat, Apache Tribes & Apache Axis2

Page 17: Building a multi-tenanted Cloud-native AppServer

Features

• Webapp hosting• Uses embedded Tomcat

• Services hosting• Axis2 AAR services• JAXWS services• Data services• etc…

Page 18: Building a multi-tenanted Cloud-native AppServer

Tomcat

Page 19: Building a multi-tenanted Cloud-native AppServer

Tomcat

• Stuck thread detection valve• Multi-tenant access log• Webapp lazy loader valve• Tenant-aware Tomcat realm• Tenant-aware management console• Tenant-aware webapp contexts• Tenant-aware session manager

Page 20: Building a multi-tenanted Cloud-native AppServer

Request Interception

Acce

ss L

og V

alve

Lazy

Loa

der V

alve

Stuc

k Th

read

Det

ecto

r Val

ve

Clients WebApp

Ten

ant

Ide

ntif

ica

tion

&

Ten

ant

Co

nte

xt C

rea

tion

Page 21: Building a multi-tenanted Cloud-native AppServer

Management Console

Page 22: Building a multi-tenanted Cloud-native AppServer

Management Console

Page 23: Building a multi-tenanted Cloud-native AppServer

Tomcat Sample Webapp

Page 24: Building a multi-tenanted Cloud-native AppServer

Tenant-aware Session Manager

Page 25: Building a multi-tenanted Cloud-native AppServer

User & Role Management

Page 26: Building a multi-tenanted Cloud-native AppServer

web.xml - Integrating Identity into WebApps

Automatically ties into Identity Management infrastructure

Page 27: Building a multi-tenanted Cloud-native AppServer

SaaS Mode• One webapp shared amongst all tenants

• One webapp shared amongst selected tenants

Page 28: Building a multi-tenanted Cloud-native AppServer

Axis2

Page 29: Building a multi-tenanted Cloud-native AppServer

Messaging

In

Out

In Fault

Out Fault

Message Receiver

Service Impl

Clie

nt

Messaging Engine

Tra

nspo

rts

Page 30: Building a multi-tenanted Cloud-native AppServer

Multi-tenant Message Receiver

Page 31: Building a multi-tenanted Cloud-native AppServer

Axis2 Configuration & Contexts

Page 32: Building a multi-tenanted Cloud-native AppServer

Tenants & Super Tenant

Super Tenant

Tenant: foo.com

Tenant: bar.com

Page 33: Building a multi-tenanted Cloud-native AppServer

Pluggable Deployers

Deployment Engine

Webapp

Data Services

POJO Services

JAXWSServices

Page 34: Building a multi-tenanted Cloud-native AppServer

Pluggable Deployers

Super Tenant

Tenant: foo.com

Tenant: bar.com

Page 35: Building a multi-tenanted Cloud-native AppServer

Ghost Artifact Deployer

• Lazy loading deployment artifacts• Load the tenant configuration & only the

required artifact• Unload artifacts & tenants after a period of

inactivity

Page 36: Building a multi-tenanted Cloud-native AppServer

Ghost Artifact Deployer - PerformanceInitial Response Time (ms)

Number of artifacts

Page 37: Building a multi-tenanted Cloud-native AppServer

Deployment Synchronizer

Page 38: Building a multi-tenanted Cloud-native AppServer

Tenant-aware Security Manager

• Main security manager delegates security verifications to tenant level security managers

• Different tenants can have different security policies

• Security policies are tied to the multi-tenancy package assigned to the tenant

Page 39: Building a multi-tenanted Cloud-native AppServer

Logging

Page 40: Building a multi-tenanted Cloud-native AppServer

Distributed Logging

• Every service and custom applications logs are captured by the log4j/commons loggings settings

• Logs are partitioned & stored by tenant• Logs are sent to the Manager service via

syslog• Logs are then viewable / downloadable by

tenant admins

Page 41: Building a multi-tenanted Cloud-native AppServer

MT-Logging Deployment Architecture

Page 42: Building a multi-tenanted Cloud-native AppServer

Log Viewer – Stratos Manager {Super-Tenant}

Page 43: Building a multi-tenanted Cloud-native AppServer

Log Viewer – Stratos Data Services Server {Tenant User}

Page 44: Building a multi-tenanted Cloud-native AppServer

AppServer Logs

Page 45: Building a multi-tenanted Cloud-native AppServer

Data & Storage

Page 46: Building a multi-tenanted Cloud-native AppServer

WSO2 Cloud Data Solutions

• WSO2 Data Server• Carbonized Cassandra Cluster

• Database cluster

• Carbonized HDFS Cluster

• <Data> PaaS Offerings• Apache Cassandra as a Service

• Relational Database as a Service

• HDFS as a Service

• We are also planning MapReduce as a Service as Future work.

Page 47: Building a multi-tenanted Cloud-native AppServer

Polyglot Data Architecture

Page 48: Building a multi-tenanted Cloud-native AppServer

Metering & Billing

Page 49: Building a multi-tenanted Cloud-native AppServer

Metering• Each services collects

• Number of service calls• Request/response bandwidth• Registry bandwidth (upload, download)• Total registry space usage

• Send above to BAM publishers, which sends the data to the BAM Service

• BAM summarizes periodically

• Summarized data will be centrally accessible

Page 50: Building a multi-tenanted Cloud-native AppServer

Throttling

• Restrict tenants from using more than the allocated resources, depending on the usage plan

• Number of users per tenant• Storage space• Number of requests to webapps, services etc

Page 51: Building a multi-tenanted Cloud-native AppServer

Usage Metering/Throttling

• Number of users

• Incoming and outgoing bandwidths

• Request Response count

Page 52: Building a multi-tenanted Cloud-native AppServer

Billing• Scheduled invoice generation

• Ability to view past invoices and the current(interim) invoice

• Securely pay the invoice via Paypal

• Notifies the customer via email on received payments

• Notifies the super-admin on customers exceeding the credit limit

• Presents a summary view to the super-admin

Page 53: Building a multi-tenanted Cloud-native AppServer
Page 54: Building a multi-tenanted Cloud-native AppServer

Recap

• Attributes essential for an AppServer running on the Cloud– Elasticity, user management, data, logging,

metering, throttling, billing• How Tomcat, Axis2 & Synapse were used to

build a cloud-native AppServer

Page 55: Building a multi-tenanted Cloud-native AppServer

QUESTIONS?

Page 56: Building a multi-tenanted Cloud-native AppServer

Thank You!