jueves, 16 de diciembre de 2021

Arun Gupta - Refactor your Java EE application using Microservices and Containers

Arun Gupta - Refactor your Java EE application using Microservices and Containers

 









































 
 
 X-Axis   sclalate clone
 Y-Axis   Functionality
 Z-Axis   shardering stread load from different locations Europe, Asia, America

 
1.- Prepare to Containter

 
User                             show booking                                     database
interface                                 
                                    Add/Delete Movie

                                    Ticket Sales

                                    Movie Points

                                    Chat Room



Web Pages        Classes                Config Files
 
 
2.- WAR--> EAR

3.- EAR  --> WAR

4.- WAR in Container

5.- WAR: Scale on X-axis or Y-axis
 

 NoOps

 
- Service Replication (Kubernets)
- Dependency Resolution (Nexus)
- Failover (Circuit Breaker)
- Resiliency (Hystrix) 
- Service Monitoring, alerts and events (logstash)

Docker


Pocket Once Deploy Anywhere (PODA)
80% written in GO

Uses several linux features
  - Namespaces to provide isolation
  - Control groups to share/limit  hardware resource
  - Union File systems makes it light and fast
 - libcontainer  defines container format

-------------------------------------
FROM fedore:latest
CMD echo "Hello World"
-------------------------------------

-------------------------------------
FROM jboss/wildfly

RUN curl -L https://github.com/javaee-samples/javaee7-hol/raw/master/solution/
movieplex7-1.0-SNAPSHOT.war -o /opt/jboss/wildfly/standalone/deployments/
movieplex7-1.0-SNAPSHOT.war
-------------------------------------

Kubernetes

 
Open source orchestration system for Docker containers
 
"desire state" self-heaing, auto-restarting, schedule across hosts, Replicating
 

Concepts

 
Pods: collocated group of Docker containers that share an IP and storage volume.
 
             - C1 --- C2 -           --- C3 ------
              ---- Pod1----          --- Pod2 ---

              ----------- Docker ----------------
 
Service: Single, stable name for a set of pods, also acts as LB

                          Sevice WEB
                            |         |
                port 8080     port 8080
                           |               |
                    JBoss         JBoss
                    Pod1          Pod2

Replication Controller: manages the lifecycle of pods
 and ensure specified number are running


Label: Uses for organaze and select group of objects

Sample of implementation

OpenShift

                                                               Sevice WEB
                                                                   |         |
                                                       port 80     port 80
                                                                |               |
                                                          Apache      Apache
                                                           Pod1          Pod2
 
                         JavaEE                             DataBase                                  MessageQueue
                            |         |                              |         |                                         |         |
                port 8080     port 8080     port 3306     port 3306                port 8161     port 8161
                           |               |                       |               |                                   |               |
                    JBoss         JBoss             MySql      MySql                   ActiveMQ    ActiveMQ                                           Pod3          Pod4               Pod5          Pod6                       Pod7          Pod8


His Environment
 
            openshift origin
 
            User Experience                OpenShift   WildFly
   
         Cluster Management             Kubernetes
 
            Container                            Docker
 
         Container Host                      RedHat     Atomic Now PodMan



eot