Farewell Old Application Server The Server Container Anti- Pattern and how to avoid it.

Slides:



Advertisements
Similar presentations
.meetup.com/13 Example application.
Advertisements

Introduction to Java 2 Programming Lecture 10 Applets.
COMPANY LOGO HERE Getting Started 1. Download the setup file: Go to Click on the Visit Setup Page link (includes Java.
©2011 Quest Software, Inc. All rights reserved.. Andrei Polevoi, Tatiana Golubovich Program Management Group ActiveRoles Add-on Manager Overview.
Struts Portlet Adding an Action Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without.
Developing in CAS. Why? As distributed you edit CAS 3 with Eclipse and build with Maven 2 – Best Practice for Release Engineering – Difficult edit-debug.
Choose a category: Install Episys Install Accessories Synergent Confidential Episys Version Synergent 2008Download latest guides from:
MC365 Application Servers: Tomcat. Today We Will: Discuss what application servers are Introduce Tomcat Download and install Tomcat Break up into teams.
18 June 2010 Upgrading Your Geant4 Release J. Perl 1 Upgrading Your Geant4 Release Joseph Perl, SLAC.
14 January 2011 Upgrading Your Geant4 Release J. Perl 1 Upgrading Your Geant4 Release Joseph Perl, SLAC.
CS 2511 Fall  Windows:  Start->Specialized Academic Software- >Programming Languages->NetBeans->NetBeans IDE x.y.z  where x.y.z is a version.
© 2006, Cognizant Technology Solutions. All Rights Reserved. The information contained herein is subject to change without notice. Automation – How to.
1 Agenda Overview Review Roles Lists Libraries Columns.
© 2009 GroundWork Open Source, Inc. PROPRIETARY INFORMATION: Information contained herein is not for use or disclosure outside of GroundWork Open Source,
SEEM4570: XAMPP, Eclipse, Summary of Html Kangfei Zhao Room 711,ERB
#RefreshCache CI - Daily Builds w/Jenkins – an Open Source Continuous Integration Server Nick Airdo Community Developer Advocate Central Christian Church.
Struts 2.0 an Overview ( )
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. M I C R O S O F T ® Preparing for Electronic Distribution Lesson 14.
Unit Testing & Defensive Programming. F-22 Raptor Fighter.
Linux Operations and Administration
GridGain – Java Grid Computing Made Simple Nikita Ivanov
1 Web Based Programming Section 6 James King 12 August 2003.
MAVEN-BLUEMARTINI Yannick Robin. What is maven-bluemartini?  maven-bluemartini is Maven archetypes for Blue Martini projects  Open source project on.
SIMPLE ROUTER The slide made by Salim Malakouti. Next we will create the Router  What do I we mean by a router?  Routers work similar to a map. It receives.
@benday #vslive Automated Build, Test & Deploy with TFS, ASP.NET, and SQL Server Benjamin
What’s new in Stack 3.2 Michael Youngstrom. Disclaimer This IS a presentation – So sit back and relax Please ask questions.
Lesson 14: Installing and Uninstalling Programs how to install a new program what to do if the new program doesn’t work how to uninstall a program © CCI.
SelfDiagnose “who is to blame” ernest micklei, April 2007.
Java: Chapter 1 Computer Systems Computer Programming II.
Application Servers: Tomcat. What is an application server? Servlets are Java’s answer to server-side programming. Servlets are a special type of Java.
JSP Architecture Outline  Model 1 Architecture  Model 2 Architecture.
COMP 321 Week 7. Overview HTML and HTTP Basics Dynamic Web Content ServletsMVC Tomcat in Eclipse Demonstration Lab 7-1 Introduction.
Windows Vista Inside Out Chapter 22 - Monitoring System Activities with Event Viewer Last modified am.
Chapter 3 Servlet Basics. 1.Recall the Servlet Role 2.Basic Servlet Structure 3.A simple servlet that generates plain text 4.A servlet that generates.
1099 Why Use InterBase? Bill Todd The Database Group, Inc.
RMS Importer Status MACS Week March 2011 PP b-ABR_RMSImporterStatus Angela Brett RMS Importer Status 1.
Michael Still Google Inc. October, Managing Unix servers the slack way Tools and techniques for managing large numbers of Unix machines Michael.
Debugging Strategies from Software Carpentry. Agan's Rules Many people make debugging harder than it needs to be by: Using inadequate tools Not going.
Creating PHPs to Insert, Update, and Delete Data CS 320.
SONIC-3: Creating Large Scale Installations & Deployments Andrew S. Neumann Principal Engineer, Progress Sonic.
Documentation Dr. Andrew Wallace PhD BEng(hons) EurIng
AN ASPECT-ORIENTED ARCHITECTURE FOR HANDLING VARIATION ACROSS MOBILE PLATFORMS Proposed by: Chokchai Phatharamalai Advisor: Dr. Paul Janecek.
What is a port The Ports Collection is essentially a set of Makefiles, patches, and description files placed in /usr/ports. The port includes instructions.
Slide 1 Project 1 Task 2 T&N3311 PJ1 Information & Communications Technology HD in Telecommunications and Networking Task 2 Briefing The Design of a Computer.
Overview of the Automated Build & Deployment Process Johnita Beasley Tuesday, April 29, 2008.
Anand Maheshwari Product Highlights GA iWay Data Quality Portal 1.
1 MSTE Visual SourceSafe For more information, see:
Chris (I’m not a ghost) Woods. What went right (with Mongo) Application design Application development and system migration Application debugging MongoDB.
Test it! Unit, mocking and in-container Meet Arquillian! Ivan St. Ivanov.
CIS Intro to JAVA Lecture Notes Set July-05 GUI Programming –TextField Action Listeners, JEditorPane action listeners, HTML in a JEditorPane,
Copyright© ANRITSU Craig Hendricks Sr. Wireless Business Development Manager August 4 th, 2014 SmartStudio Manager (SSM) Operation (For SSM Version 1.2.0)
SPI NIGHTLIES Alex Hodgkins. SPI nightlies  Build and test various software projects each night  Provide a nightlies summary page that displays all.
EGEE is a project funded by the European Union under contract IST Installation and configuration of gLite services Robert Harakaly, CERN,
Google App Engine using Java 1. Outline Getting started Guestbook example Todo example Simplified Madlib 2.
CS 440 Database Management Systems Stored procedures & OR mapping 1.
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
NX Documentation Using Windows IIS (Internet Information Services) as a http server for NX documentation.
CACI Proprietary Information | Date 1 PD² SR13 Client Upgrade Name: Semarria Rosemond Title: Systems Analyst, Lead Date: December 8, 2011.
CACI Proprietary Information | Date 1 PD² v4.2 Increment 2 SR13 and FPDS Engine v3.5 Database Upgrade Name: Semarria Rosemond Title: Systems Analyst, Lead.
Rome 31 January -1 February Team Development in CRM Shan McArthur CEO / CTO Adxstudio, CRM MVP.
Troubleshooting Dashhawk Issues. Here's what you have to do to have the DashHawk run properly Go to the ACTUAL PROGRAM file (not the short cut)
Introduction To Software Development Environment.
The Maven Alfresco SDK™ At the end of a journey, there is always a new beginning…
Unit Testing.
Best Practices for Dynamics NAV Administration and Security
Brian Leonard ブライアン レオナルド
Download 2018 Exact Oracle 1z0-134 Exam Study Guide - Oracle 1z0-134 Exam Dumps
Delivering Business Value Faster
CS 240 – Advanced Programming Concepts
WebSphere & EJB’s Experiences, Deployment & Best Practices
Presentation transcript:

Farewell Old Application Server The Server Container Anti- Pattern and how to avoid it

(Shameless plug)

.meetup.com/13

Why am I standing here?

I believe

that you, as a developer,

should care about deployment.

Two things you will learn:

1. How to create a non-server

2. Practical Configuration Management

My story:

By company decree

we were using a traditional application server.

(WebSphere)

Unhappily.

It was ”somebody else’s problem.”

We couldn’t do what we wanted.

(Continuous deployment!)

Complexity was killing our projects.

We started caring.

We decided to cut the Gordian knot.

Our solution:

Standard Java Maven Jetty

Let’s see how it works.

Example application

Can’t change parent!

A developer has released a new version (1.0.1).

Create a test environment and try it out.

Server: Initial installation

./install.sh 1.0.1

Preproduction environment

Server: Upgrade production

Production environment

Lesson learned: Package everything you need.

Experience: Separate information that should survive upgrades.

Symbolic link

port=9090 shutdown_port=9190 datasource.url=jdbc:mysql://localhost/nocontainer_dev datasource.username=johannes datasource.password=johannes

New requirement: Delete

Testing: Embedded integration test

public void testDeleteCategory() throws Exception { // Insert test data Category category = new Category(uniqueName()); Serializable key = getRepo().insert(category); getRepo().writeChanges(); // Ensure that data is displayed in index beginAt("categories/list.html"); assertTextPresent("Showing all categories"); assertLinkPresentWithText(category.getName()); // Delete it beginAt("categories/edit.html?id=" + key); submit("delete"); // Ensure that after delete, we go to index assertTextPresent("Showing all categories"); // Ensure that the category is no longer there assertLinkNotPresentWithText(category.getName()); }

public void testDeleteCategory() throws Exception { // Insert test data Category category = new Category(uniqueName()); Serializable key = getRepo().insert(category); getRepo().writeChanges(); // Ensure that data is displayed in index beginAt("categories/list.html"); assertTextPresent("Showing all categories"); assertLinkPresentWithText(category.getName()); // Delete it // Ensure that the category is no longer there assertLinkNotPresentWithText(category.getName()); }

public void testDeleteCategory() throws Exception { // Insert test data // Ensure that data is displayed in index // Delete it beginAt("categories/edit.html?id=" + key); submit("delete"); // Ensure that after delete, we go to index assertTextPresent("Showing all categories"); // Ensure that the category is no longer there }

public void testDeleteCategory() throws Exception { // Insert test data // Ensure that data is displayed in index // Delete it beginAt("categories/edit.html?id=" + key); submit("delete"); // Ensure that after delete, we go to index assertTextPresent("Showing all categories"); // Ensure that the category is no longer there }

${category.name} #showErrors("category") Parent: #selectForObject("category.parent" $allCategories) Description: #springFormInput("category.description" "") #springShowErrors(" " "") Type: #selectForEnum("category.type" $categoryTypes) List all

${category.name} #showErrors("category") Parent: #selectForObject("category.parent" $allCategories) Description: #springFormInput("category.description" "") #springShowErrors(" " "") Type: #selectForEnum("category.type" $categoryTypes) List all

public void testDeleteCategory() throws Exception { // Insert test data // Ensure that data is displayed in index // Delete it beginAt("categories/edit.html?id=" + key); submit("delete"); // Ensure that after delete, we go to index assertTextPresent("Showing all categories"); // Ensure that the category is no longer there }

Debugging: Just like a main method

protected ModelAndView onSubmit( HttpServletRequest req, HttpServletResponse resp, Object command, BindException errors) { Category category = (Category)command; if (category.getId() == null) { Serializable key = repository.insert(category); return new ModelAndView(new RedirectView("show.html?id=" + key)); } repository.update(category); // Redirect on post - go back to the same page return new ModelAndView( new RedirectView(req.getRequestURI() + "?" + req.getQueryString())); }

protected ModelAndView onSubmit( HttpServletRequest req, HttpServletResponse resp, Object command, BindException errors) { Category category = (Category)command; if (category.getId() == null) { Serializable key = repository.insert(category); return new ModelAndView(new RedirectView("show.html?id=" + key)); } if (req.getParameter("delete") != null) { repository.delete(Category.class, category.getId()); return new ModelAndView(new RedirectView("list.html")); } repository.update(category); // Redirect on post - go back to the same page return new ModelAndView( new RedirectView(req.getRequestURI() + "?" + req.getQueryString())); }

Continuous integration

(Not demoed)

mvn deploy

Continuous Deployment

The Simplest Thing...

... cron

Mon Sep 10 18:37:02 EDT 2007: Not upgraded, skipping restart Mon Sep 10 18:38:13 EDT 2007: Installed new version Stopping Starting Testing connection (user=johannes, url=jdbc:mysql://localhost/nocontainer_dev)... OK! Deploy 'nocontainer' from /home/nocontainer/test/nocontainer- app/curr/repo/com/b rodwall/nocontainer/nocontainer-web/1.1- SNAPSHOT/nocontainer-web-1.1-SNAPSHOT.wa r Server started on in s Mon Sep 10 18:39:02 EDT 2007: Not upgraded, skipping restart

Experience: Look like a UNIX service

./prod/nocontainer-app/operate.sh start./prod/nocontainer-app/operate.sh stop./prod/nocontainer-app/operate.sh status

Release: mvn release

Upgrading staging server to 1.0.2

Upgrading production server to 1.0.2

Summary

1.Add a test

2. Make it pass

3. Check it in

4. Continuous integration and deployment

5. Run it at test server

6. Deploy to staging

6. Final verifications

7. Deploy to production

Results:

1. Better management

2. Simplicity

3. Isolation

4. Better development support

1: Single commands to...

... Build

... Install

... Upgrade

=> Ease of deployment

2: A simpler environment

... No dependencies between servers

... We own the Main class

Scripted server acts as UNIX service.

Upgrade with ssh, cron

Avoid EJBs, JMS, XA

3: Better isolation between applications

(especially: JVM version)

The ultimate irony:

JPA (EJB 3) via Hibernate on Java SE > 1.5

Our WebSphere servers still don’t support 1.5

Avoid Java EE server to get Java EE features

4: Better development attributes

Embedded integration tests

Easier to debug on server

Exact same software in debugger and server

Same versions of all libraries

Free, low footprint installation on workstation

Challenges:

How ready is Jetty for production?

What is being run in the wild?

Jetty: 221k

(Okay, then)

Load balancing and failover

(No state in application server)

Two week intensive stress testing

We could not make it fail

Organization: Open source procurement process

Organization: Showing this to the WebSphere guys

Support: Per project

Application management shortcomings

”On what servers is this application running?”

”What applications are running on this server”

Making: ”jettyctl”

Requires some documentation

Don’t go overboard with management

YAGNI

Why Anti-pattern

Insufficent isolation means risk

Insufficient isolation means older versions

Outside-in means lack of control

Outside-in means lack of understanding

Outside-in means complexity

Deployment apps means manual work

Conclusion:

In Soviet Russia, Application Server contains you!

We have turned the app server inside out

We choose Jetty, Maven, mod_proxy

These worked for us

(You may prefer glassfish, webstone or whatever)

(Shameless plug)

Q&A