SlideShare une entreprise Scribd logo
1  sur  88
Télécharger pour lire hors ligne
Developing modular, polyglot applications with Spring




Chris Richardson
Author of POJOs in Action, Founder of the original CloudFoundry.com
  @crichardson chris.richardson@springsource.com
 http://plainoldobjects.com/
Presentation goal
  Modular, polyglot applications:
       what, why and how?


Why Spring is the ideal technology
 for building these applications
About Chris
(About Chris)
About Chris - 1999


CORBA



Enterprise
             WebLogic Server
JavaBeans
About Chris - 2004
Spring programming model
               Dependency Injection




                     POJO


 Portable                               Aspect-
  Service                               Oriented
Abstractions                          Programming
Transformed how I developed
         software!
About Chris()
About Chris - 2006

Oakland
 JUG



    Cloud Computing
Transformed how I deployed
         software!
About Chris
About Chris




http://www.theregister.co.uk/2009/08/19/
       springsource_cloud_foundry/
vmc push About-Chris

   Developer Advocate for
     CloudFoundry.com



Signup at http://cloudfoundry.com
Agenda

• The   (sometimes evil) monolith

• Refactoring   to a modular, polyglot architecture

• Presentation    layer design

• Using   NoSQL databases

• Inter-service   communication options
Let’s imagine you are building an
     e-commerce application
Traditional web application
                  architecture
                             WAR



                                    StoreFrontUI


                                     Accounting
                                      Service

                                                      MySQL
Browser        Apache                                 Database
                                   InventoryService




Simple to                              Shipping
                                       Service


     develop
     test               Tomcat
     deploy
     scale
But there are problems
Users expect a rich, dynamic and
     interactive experience
                                                                   h
                                                                oug
                                                          d   en
                         HTTP Request
                                                        oo
                                                    ’t g
   Browser
                                             e   isn       Java Web Application
                         HTML/Javascript
                                      ec tur
                                    it
                               ar ch
                        e UI
                 s   tyl
             Old


 HTML5/JavaScript browser applications
       Real-time web ≅ NodeJS
Limitations of relational
                    databases

• Scalability

• Distribution

• Schema   updates

• O/R   impedance mismatch

• Handling   semi-structured data
Intimidates developers
Scalability issues


• Different   components have different scalability needs   but
 you can only scale the entire system

• Some   components might not be scalable       can’t scale system
Obstacle to frequent
                    deployments
•   Need to redeploy everything to change one component

•   Increases risk of failure, e.g. interrupts background jobs



                                 Fear of change



•   Extensive test cycle
•   Updates will happen less often, e.g. Makes A/B testing UI really difficult
Overloads your IDE and container




      Slows down development
Obstacle to scaling development
                            But the
      I want to update
                         backend is not
           the UI
                          working yet!




   Lots of coordination and
    communication required
Requires long-term
 commitment to a
 technology stack
Agenda

• The   (sometimes evil) monolith

• Refactoring   to a modular, polyglot architecture

• Presentation    layer design

• Using   NoSQL databases

• Inter-service   communication options
The scale cube


Y axis -
functional
decomposition




                                                           ila g
                                                       sim nin
Scale by




                                                              r
                                                ing ing tio
splitting




                                              th litt r ti
                                                 sp pa
different things



                                              by data

                                                   s
                                           ale -
                                         Sc is
                                             ax
                                           Z

                   X axis - horizontal
                      duplication
Y-axis scaling - application level
          WAR



                 StoreFrontUI


                  Accounting
                   Service


                InventoryService



                    Shipping
                    Service
Y-axis scaling - application level
                                                       accounting application

                                                                     Accounting
                                                                      Service




Store front web application                              inventory application



             StoreFrontUI                                        InventoryService




                                                       shipping application


                                                                      Shipping
                                                                      Service




  Apply X axis cloning and/or Z axis partitioning to each service
Real world examples
        http://techblog.netflix.com/




        Between 100-150 services are accessed to build a
        page.
         http://highscalability.com/amazon-architecture




             http://www.addsimplicity.com/downloads/
                    eBaySDForum2006-11-29.pdf

           http://queue.acm.org/detail.cfm?id=1394128
Drawbacks of Y-axis splits


• Complexity

• Partitioned   databases and transaction management

• Deciding   when to use this approach
But there are many benefits

•   Scales development: develop, deploy and scale each service
    independently

•   Enables frequent deployments

•   Less for each developer to learn

•   Doesn’t overload IDE or container

•   Improves fault isolation

•   Easily adopt new technologies
Two levels of architecture
                         System-level

Services
Inter-service glue: interfaces and communication mechanisms
Slow changing

                         Service-level

Internal architecture of each service
Each service can use a different technology stack
Rapidly evolving - regularly rewrite
Pick the best tool for the job
Modular, polyglot,
  applications
Lots of languages and
frameworks to choose from




     And many more...
But there are lots of awesome,
    and mature Spring projects
• Spring   Framework         • Spring   Integration

• Spring   Security          • Spring AMQP

• Spring   Mobile            • Spring   Social

• Spring   Data              • Spring   Shell

• Spring Web      Services   • ...

• Spring   Batch
Spring works with Scala
@Controller
class TwilioController {

  @Autowired var surveyManagementService: SurveyManagementService = _

  @RequestMapping(value = Array("/begincall.html"))
  @ResponseBody
  def beginCall(@RequestParam("From") callerId: String) = {
    surveyManagementService.findSurveyByCallerId(callerId) match {
      case None =>
        <Response>
          <Say>Sorry don't recognize your number</Say>
          <Hangup/>
        </Response>
      case Some(survey) =>
        <Response>
          <Say>{ survey.prompt }</Say>
          <Gather action="handleresponse.html" method="POST" numDigits="1">
            {
              for ((choice, index) <- survey.choices zipWithIndex)
                yield <Say>Press { index } for { choice }</Say>
            }
          </Gather>
          <Say>We are sorry you could not decide</Say>
          <Hangup/>
        </Response>
    }
  }
The Spring Scala project

                                   class	
  PersonConfiguration	
  
                                   	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  extends	
  FunctionalConfiguration	
  {
                                   	
  	
  	
  	
  val	
  jack	
  =	
  bean()	
  {
                                   	
  	
  	
  	
  	
  	
  	
  	
  new	
  Person("Jack",	
  "Doe")
                                   	
  	
  	
  	
  }
• Scala-style “setters/getters”    	
  	
  	
  	
  val	
  jane	
  =	
  bean()	
  {
                                   	
  	
  	
  	
  	
  	
  	
  	
  new	
  Person("Jane",	
  "Doe")
                                   	
  	
  	
  	
  }
• Bean   configuration DSL          	
  	
  	
  	
  val	
  john	
  =	
  bean()	
  {
                                   	
  	
  	
  	
  	
  	
  	
  	
  val	
  john	
  =	
  new	
  Person("John",	
  "Doe")
                                   	
  	
  	
  	
  	
  	
  	
  	
  john.father	
  =	
  jack()
• Scala-style   template classes   	
  	
  	
  	
  	
  	
  	
  	
  john.mother	
  =	
  jane()
                                   	
  	
  	
  	
  	
  	
  	
  	
  john
                                   	
  	
  	
  	
  }
                                   }




         https://github.com/SpringSource/spring-scala
Coming in 2013
 Java 8 closures = concise code!
List<Album> albums = ...                     Predicate
List<Album> sortedFavorites =
 albums.stream()
    .filter(a -> a.tracks.anyMatch(t -> (t.rating >= 4)))
    .sorted(comparing(a -> a.name))
    .into(new ArrayList<>());
                                                       Parallelism
int sum = shapes.parallel()
        .filter(s -> s.getColor() == BLUE)
        .map(s -> s.getWeight())
        .sum();
  http://cr.openjdk.java.net/~briangoetz/lambda/sotc3.html
Key benefits of Spring are still

            Modularity


            Productivity


            Portability


            Testability
Agenda

• The   (sometimes evil) monolith

• Refactoring   to a modular, polyglot architecture

• Presentation    layer design

• Using   NoSQL databases

• Inter-service   communication options
Presentation layer evolution....
                        WAR

                          StoreFrontUI



          HTML / HTTP         View         Controller
Browser


                                         Model
...Presentation layer evolution
Browser                              Web application


                                                Static
                                               content
  View      Controller   JSON-REST
                                              RESTful
                                             Endpoints
          Model
                          Events               Event
HTML 5 - JavaScript                           publisher

No elaborate, server-side web framework
                 required
How to publish events to
       browser?
NodeJS is the fashionable
      technology
Why NodeJS?
• Familiar   JavaScript

• High-performance, scalable      event-driven, non-blocking I/O
 model

• Compact     runtime, e.g. 64M

• Over   13,000 17,000 modules developed by the community

• ManyJavaScript client frameworks have a NodeJS
 counterpart, e.g. socket.io and SockJS
Why not NodeJS?




           a.k.a. callback hell
Dealing with JavaScript

  “...Still the consequence of this is
      that we must take javascript
seriously as a first-class language and
  concentrate on how to limit the
       damage its flaws cause....”

http://martinfowler.com/bliki/gotoAarhus2012.html
NodeJS as a mediator...

                            Node JS         Service 1
Browser
                             Server app
                           Static content
                   REST                     Service 2
 HTML 5
Application       Events
Socket.io                    Socket.io
  client                      server           ...
...NodeJS as a mediator

REST                  REST
                              Service




          Node JS


Events                AMQP              AMQP
          socket.io          RabbitMQ          Service
Example NodeJS application
var express = require('express')
  , http = require('http')
  , amqp = require(‘amqp’)
  , server = http.createServer(app)
  , io = require('socket.io').listen(server)
  ....;

server.listen(8081);                                        Handle socket.io
...                                                           connection
var amqpCon = amqp.createConnection(...);

io.sockets.on('connection', function (socket) {
                                                                   Republish as
  function amqpMessageHandler(message, headers, deliveryInfo) {
      var m = JSON.parse(message.data.toString());
                                                                  socket.io event
      socket.emit(‘tick’, m);
   };
   amqpCon.queue(“”, {},                                      Subscribe to AMQP
       function(queue) {
         queue.bind(“myExchange”, “myBindingKey”);                  queue
         queue.subscribe(amqpMessageHandler);
   });
});
Example browser application
<html>
<body>

The event is <span data-bind="text: ticker"></span>

<script src="/socket.io/socket.io.js"></script>
<script src="/knockout-2.0.0.js"></script>
<script src="/clock.js"></script>

</body>                            Bind to model        Connect to
</html>
                                                      socket.io server
              clock.js
var socket = io.connect(location.hostname);

function ClockModel() {
  self.ticker = ko.observable(1);                      Subscribe to tick
  socket.on('tick', function (data) {                       event
   self.ticker(data);
 });
};
                                                         Update model
ko.applyBindings(new ClockModel());
About Cujojs & s2js
                Dependency Injection

                                   www.cujojs.com
                                   github.com/s2js

                     JavaScript

 Portable                                Aspect-
  Service                                Oriented
Abstractions                           Programming
Agenda

• The   (sometimes evil) monolith

• Refactoring   to a modular, polyglot architecture

• Presentation    layer design

• Using   NoSQL databases

• Inter-service   communication options
Why NoSQL?

 Benefits                       Drawbacks

• Higher   performance        • Limited   transactions

• Higher   scalability        • Limited   querying

• Richer   data-model         • Relaxed   consistency

• Schema-less                 • Unconstrained    data
Example NoSQL Databases
Database      Key features

Cassandra     Extensible column store, very scalable, distributed

Neo4j         Graph database
              Document-oriented, fast, scalable
MongoDB

Redis         Key-value store, very fast

         http://nosql-database.org/ lists 122+ NoSQL
                           databases
NoSQL and the scale cube




                                    nin a ing
                                itio dr rd
                             r t an ha
                           pa ss s
                               Ca DB


                                       g
                                   go
                                on
                             M
   MongoDB replica sets
   Cassandra replication
The future is polyglot




 IEEE Software Sept/October 2010 - Debasish Ghosh / Twitter @debasishg
Polyglot persistence architecture
                             accounting application

                                 Accounting
                                  Service             MySQL




storefront web application    inventory application


     StoreFrontUI             InventoryService        Redis




                              shipping application



                              ShippingService         Mongo
Spring Data = simplifying data
           access
• Redis

• MongoDB

• Neo4j

• JPA

• REST

• Apache   Hadoop
• Gemfire

 http://www.springsource.org/spring-data
Agenda

• The   (sometimes evil) monolith

• Refactoring   to a modular, polyglot architecture

• Presentation    layer design

• Using   NoSQL databases

• Inter-service   communication options
Inter-service communication
                options

• Synchronous    HTTP      asynchronous AMQP

• Formats: JSON, XML, Protocol    Buffers, Thrift, ...

 • JSON     is fashionable and easier to debug

 • Binary   format is more efficient
Asynchronous message-based communication
                              wgrus-billing.war

                                 Accounting
                                  Service



wgrus-store.war              wgrus-inventory.war
                  RabbitMQ
StoreFrontUI      (Message   InventoryService      MySQL
                   Broker)



                             wgrus-shipping.war


                              ShippingService
Benefits

• Decouples    caller from server

• Caller   unaware of server’s coordinates (URL)

• Message    broker buffers message when server is down/slow

• Supports    a variety of communication patterns
Drawbacks


• Additional   complexity of message broker

• Request/reply    using messaging is more complex

• Firewall   unfriendly
Spring AMQP
• Encapsulates   low-level    Producer          Consumer


 details

• Simplifiessending and         Amqp              Listener
 receiving of messages        Template          Container


                             Spring AMQP




                                         AMQP
Spring Integration
•   Provides the building blocks for a pipes and
    filters architecture

•   Enables development of application
    components that are

    •   loosely coupled

    •   insulated from messaging infrastructure

•   Messaging defined declaratively
Development time: same JVM
@Service
public class OrderServiceImpl {
                                             @Service
                                             public class ShippingServiceImpl {
@Autowired
private ShippingService shippingService;
                                             public void shipOrder(String orderId) {
                                               ....
public void placeOrder() {
                                             }
  String orderId = generateOrderId();
   …
                                             }
  shippingService.shipOrder(orderId);
}

}

                      Order                             Shipping
                     Service                             service


                         shipOrder()

         Messaging
          Gateway

                                   Channel               Service
                                                         Activator
Test and production: distributed
                                Application code is
                                   unchanged

             Order                                                    Shipping
            Service                                                    service




Messaging
 Gateway                                  RabbitMQ

                      Channel      AMQP              AMQP   Channel    Service
                                                                       Activator
Synchronous REST
                               wgrus-billing.war

                                     Accounting
                                      Service




wgrus-store.war       REST   wgrus-shipping.war


     StoreFrontUI                   Shipping          MySQL
                                    Service



                             wgrus-inventory.war

                       ...
                                   InventoryService
Pros and cons of REST

• Pros                         • Cons

 • Simple   and familiar        • Only    supports request/
                                  reply
 • Request/reply    is easy
                                • Server   must be available
 • Firewall   friendly
                                • Clientneeds to know
 • No    intermediate broker      URL(s) of server(s)
Spring MVC makes REST easy
                                                                            URL matching
           @Controller                                                            &
           public class AccountController {
object                                                                      destructuring
             @Autowired
XML/JSON     private MoneyTransferService moneyTransferService;

             @RequestMapping(value = "/accounts/{accountId}", method = RequestMethod.GET)
             @ResponseBody
             public AccountInfo getAccount(@PathVariable String accountId) {
               Account account = moneyTransferService.findAccountByid(accountId);
               return makeAccountInfo(account);
             }

             @RequestMapping(value = "/accounts", method = RequestMethod.POST)
             @ResponseStatus( HttpStatus.CREATED )
             public void createAccount(@RequestBody AccountInfo accountInfo,
                                       UriComponentsBuilder builder,
                                       HttpServletResponse response) {
                ...
             }          XML/JSON

                          object
Not all APIs are RESTful




From http://martinfowler.com/articles/richardsonMaturityModel.html
About Hypertext As The
       Engine Of Application State


• Single    well known URL

• Entity    representation has typed relationship links

• Client     discovers what it can do to an entity via those links

See http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
About HATEOAS
                                                                                       The well known
                                                                                            URL
$ curl http://cf-auto-scaler.cloudfoundry.com
{"links": [
	

   {"rel":"autoscaledapps", "href":"http://cf-auto-scaler.cloudfoundry.com/autoscaledapps"}
]}

                                                                                              Link
                   link type
$ curl http://cf-auto-scaler.cloudfoundry.com/autoscaledapps
{"content":[
    {"name":"vertx-clock",
      "links":[
          {"rel":"self","href":"http://cf-auto-scaler.cloudfoundry.com/autoscaledapps/vertx-clock"},
          {"rel":"rules","href":"http://cf-auto-scaler.cloudfoundry.com/autoscaledapps/vertx-clock/rules"}
        ]
    }],
...                                                          Links to act on this app
}
Spring HATEOAS
@Controller
@RequestMapping(value = "/autoscaledapps")
public class AutoscaledAppController {

  @RequestMapping(value = "/{appName}", method = RequestMethod.GET)
  public HttpEntity<AutoscaledAppResource> get(@PathVariable String appName) {
    AutoscaledAppResource ar = new AutoscaledAppResource(appName);
    ar.add(linkTo(AutoscaledAppController.class)
         .slash(appName).withSelfRel());
    ar.add(linkTo(AutoscaledAppController.class)
      .slash(appName).slash("rules").withRel("rules"));
    return new HttpEntity<AutoscaledAppResource>(ar);
  }
  ...                                    public class AutoscaledAppResource
}                                           extends ResourceSupport {

                                                 private String name;


https://github.com/SpringSource/spring-hateoas
Consuming RESTful WS
RestTemplate restTemplate = new RestTemplate();

AccountInfo accountInfo = new AccountInfo(...);
URI accountUrl =
       restTemplate.postForLocation("http://localhost/accounts", accountInfo);

ResponseEntity<AccountInfo> accountInfoResponse =
        restTemplate.getForEntity(accountUrl, AccountInfo.class);

Assert.assertEquals(HttpStatus.SC_OK, accountInfoResponse.getStatusCode());
AccountInfo accountInfo2 = accountInfoResponse.getBody();
...
The Spring REST shell
$ rest-shell
http://localhost:8080:> baseUri http://cf-auto-scaler.cloudfoundry.com
http://cf-auto-scaler.cloudfoundry.com:> discover
rel           href
=======================================================================
autoscaledapps http://cf-auto-scaler.cloudfoundry.com/autoscaledapps

http://cf-auto-scaler.cloudfoundry.com:> follow --rel autoscaledapps

http://cf-auto-scaler.cloudfoundry.com/autoscaledapps:> post --from src/test/resources/examplejson/createapp1.json
                                                                    --follow true
1 files uploaded to the server using POST
http://cf-auto-scaler.cloudfoundry.com/autoscaledapps/vertx-clock:> discover
rel     href
================================================================================
self http://cf-auto-scaler.cloudfoundry.com/autoscaledapps/vertx-clock
rules http://cf-auto-scaler.cloudfoundry.com/autoscaledapps/vertx-clock/rules
http://cf-auto-scaler.cloudfoundry.com/autoscaledapps/vertx-clock:> follow --rel rules
http://cf-auto-scaler.cloudfoundry.com/autoscaledapps/vertx-clock/rules:> post
                               --from src/test/resources/examplejson/createrule1.json --follow true
1 files uploaded to the server using POST
http://cf-auto-scaler.cloudfoundry.com/autoscaledapps/vertx-clock/rules/idle:> up
http://cf-auto-scaler.cloudfoundry.com/autoscaledapps/vertx-clock/rules:> up
Original architecture
                             WAR



                                    StoreFrontUI


                                     Accounting
                                      Service

                                                      MySQL
Browser        Apache                                 Database
                                   InventoryService




Simple to                              Shipping
                                       Service


     develop
     test               Tomcat
     deploy
     scale
Modular, polyglot architecture
                  Desktop Browser             Native Mobile application          HTML5 mobile application




                                                                            oy
                   StoreUI                           StoreUI                     StoreUI




                                                                          pl
                                                      NodeJS




                                                !?! e
Asynchronous,                                           NodeJS                                   Javascript
   scalable




                                              is d
                                                      StoreUI
communication




                                            th we
                                                    RabbitMQ


 Spring/Scala
                                    do
web application                     Inventory                                                                   Standalone
                                      Inventory                           Shipping Service
                                     Service                                   Shipping                          “headless”
                                       Service
                                                                                                                   Spring
            ow


                                                                                                              Integration/Java
                                                                                                                applications
                  Billing Service          Redis Inventory                 Mongo Order
           H




                                             Database                       Database


                     MySQL
                    Customer
                    Database
OSS community




 vFabric
Postgres                            Ap
                                                                       Private	
  
                                                                       Clouds	
  
                                       p
           Data Services
                                      lica
                                         'o
                                           n	
  S


        vFabric
                                                                   Public
                                             erv


      RabbitMQTM
                                                ice



                     Msg Services
                                                                   Clouds
                                                   	
  In
                                                     ter
                                                        fac




                                                               Micro
                                                           e




                                    Other Services
                                                               Clouds
           Additional partners services …
Cloud Foundry simplifies the
deployment of modular, polyglot
        applications
Spring makes it easy to consume
    Cloud Foundry services
Many Spring applications run on
  Cloud Foundry unchanged
Summary

• Modern  applications have a modular, polyglot
 architecture
• Springis the ideal technology for building these
 applications
• Cloud Foundry is the ideal way to deploy these
 applications
@crichardson chris.richardson@springsource.com
           http://plainoldobjects.com




            Thank you!
 www.cloudfoundry.com        @cloudfoundry

Contenu connexe

Tendances

Brian Oliver Pimp My Data Grid
Brian Oliver  Pimp My Data GridBrian Oliver  Pimp My Data Grid
Brian Oliver Pimp My Data Grid
deimos
 
Developing polyglot persistence applications (SpringOne China 2012)
Developing polyglot persistence applications (SpringOne China 2012)Developing polyglot persistence applications (SpringOne China 2012)
Developing polyglot persistence applications (SpringOne China 2012)
Chris Richardson
 
Dave Carroll Application Services Salesforce
Dave Carroll Application Services SalesforceDave Carroll Application Services Salesforce
Dave Carroll Application Services Salesforce
deimos
 
Bertrand Delsart Java R T S
Bertrand Delsart Java R T SBertrand Delsart Java R T S
Bertrand Delsart Java R T S
deimos
 
Randy Shoup eBays Architectural Principles
Randy Shoup eBays Architectural PrinciplesRandy Shoup eBays Architectural Principles
Randy Shoup eBays Architectural Principles
deimos
 
Gregor Hohpe Track Intro The Cloud As Middle Ware
Gregor Hohpe Track Intro The Cloud As Middle WareGregor Hohpe Track Intro The Cloud As Middle Ware
Gregor Hohpe Track Intro The Cloud As Middle Ware
deimos
 
Ari Zilka Cluster Architecture Patterns
Ari Zilka Cluster Architecture PatternsAri Zilka Cluster Architecture Patterns
Ari Zilka Cluster Architecture Patterns
deimos
 
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...LinkedIn - A Professional Network built with Java Technologies and Agile Prac...
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...
LinkedIn
 
Frank Mantek Google G Data
Frank Mantek Google G DataFrank Mantek Google G Data
Frank Mantek Google G Data
deimos
 

Tendances (19)

Brian Oliver Pimp My Data Grid
Brian Oliver  Pimp My Data GridBrian Oliver  Pimp My Data Grid
Brian Oliver Pimp My Data Grid
 
Developing polyglot persistence applications (SpringOne China 2012)
Developing polyglot persistence applications (SpringOne China 2012)Developing polyglot persistence applications (SpringOne China 2012)
Developing polyglot persistence applications (SpringOne China 2012)
 
Cloudfoundry architecture
Cloudfoundry architectureCloudfoundry architecture
Cloudfoundry architecture
 
Acquia Managed Cloud: Highly Available Architecture for Highly Unpredictable ...
Acquia Managed Cloud: Highly Available Architecture for Highly Unpredictable ...Acquia Managed Cloud: Highly Available Architecture for Highly Unpredictable ...
Acquia Managed Cloud: Highly Available Architecture for Highly Unpredictable ...
 
Windows Azure Design Patterns
Windows Azure Design PatternsWindows Azure Design Patterns
Windows Azure Design Patterns
 
Professional Frontend Engineering
Professional Frontend EngineeringProfessional Frontend Engineering
Professional Frontend Engineering
 
Dave Carroll Application Services Salesforce
Dave Carroll Application Services SalesforceDave Carroll Application Services Salesforce
Dave Carroll Application Services Salesforce
 
Bertrand Delsart Java R T S
Bertrand Delsart Java R T SBertrand Delsart Java R T S
Bertrand Delsart Java R T S
 
Building Scalable .NET Apps
Building Scalable .NET AppsBuilding Scalable .NET Apps
Building Scalable .NET Apps
 
Randy Shoup eBays Architectural Principles
Randy Shoup eBays Architectural PrinciplesRandy Shoup eBays Architectural Principles
Randy Shoup eBays Architectural Principles
 
Gregor Hohpe Track Intro The Cloud As Middle Ware
Gregor Hohpe Track Intro The Cloud As Middle WareGregor Hohpe Track Intro The Cloud As Middle Ware
Gregor Hohpe Track Intro The Cloud As Middle Ware
 
Cloud Architecture Tutorial - Running in the Cloud (3of3)
Cloud Architecture Tutorial - Running in the Cloud (3of3)Cloud Architecture Tutorial - Running in the Cloud (3of3)
Cloud Architecture Tutorial - Running in the Cloud (3of3)
 
Ari Zilka Cluster Architecture Patterns
Ari Zilka Cluster Architecture PatternsAri Zilka Cluster Architecture Patterns
Ari Zilka Cluster Architecture Patterns
 
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...LinkedIn - A Professional Network built with Java Technologies and Agile Prac...
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...
 
Cloud Foundry Bootcamp
Cloud Foundry BootcampCloud Foundry Bootcamp
Cloud Foundry Bootcamp
 
Asif
AsifAsif
Asif
 
Frank Mantek Google G Data
Frank Mantek Google G DataFrank Mantek Google G Data
Frank Mantek Google G Data
 
Performance architecture for cloud connect
Performance architecture for cloud connectPerformance architecture for cloud connect
Performance architecture for cloud connect
 
JavaOne 2015 Keynote Presentation
JavaOne 2015 Keynote PresentationJavaOne 2015 Keynote Presentation
JavaOne 2015 Keynote Presentation
 

En vedette

Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC Framework
Guo Albert
 
Developing polyglot persistence applications (SpringOne India 2012)
Developing polyglot persistence applications (SpringOne India 2012)Developing polyglot persistence applications (SpringOne India 2012)
Developing polyglot persistence applications (SpringOne India 2012)
Chris Richardson
 
RESTful OSGi Web Applications Tutorial - Khawaja S Shams & Jeff Norris
RESTful OSGi Web Applications Tutorial - Khawaja S Shams & Jeff NorrisRESTful OSGi Web Applications Tutorial - Khawaja S Shams & Jeff Norris
RESTful OSGi Web Applications Tutorial - Khawaja S Shams & Jeff Norris
mfrancis
 
S01 e01 schema-design
S01 e01 schema-designS01 e01 schema-design
S01 e01 schema-design
MongoDB
 

En vedette (20)

Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC Framework
 
Developing modular Java applications
Developing modular Java applicationsDeveloping modular Java applications
Developing modular Java applications
 
Developing polyglot persistence applications (SpringOne India 2012)
Developing polyglot persistence applications (SpringOne India 2012)Developing polyglot persistence applications (SpringOne India 2012)
Developing polyglot persistence applications (SpringOne India 2012)
 
Decomposing applications for scalability and deployability (devnexus 2013)
Decomposing applications for scalability and deployability (devnexus 2013)Decomposing applications for scalability and deployability (devnexus 2013)
Decomposing applications for scalability and deployability (devnexus 2013)
 
Improving application design with a rich domain model (springone 2007)
Improving application design with a rich domain model (springone 2007)Improving application design with a rich domain model (springone 2007)
Improving application design with a rich domain model (springone 2007)
 
Polygot persistence for Java Developers - August 2011 / @Oakjug
Polygot persistence for Java Developers - August 2011 / @OakjugPolygot persistence for Java Developers - August 2011 / @Oakjug
Polygot persistence for Java Developers - August 2011 / @Oakjug
 
Developing polyglot persistence applications (devnexus 2013)
Developing polyglot persistence applications (devnexus 2013)Developing polyglot persistence applications (devnexus 2013)
Developing polyglot persistence applications (devnexus 2013)
 
Webinar: MongoDB and Polyglot Persistence Architecture
Webinar: MongoDB and Polyglot Persistence ArchitectureWebinar: MongoDB and Polyglot Persistence Architecture
Webinar: MongoDB and Polyglot Persistence Architecture
 
Developing polyglot persistence applications (gluecon 2013)
Developing polyglot persistence applications (gluecon 2013)Developing polyglot persistence applications (gluecon 2013)
Developing polyglot persistence applications (gluecon 2013)
 
NodeJS: the good parts? A skeptic’s view (jax jax2013)
NodeJS: the good parts? A skeptic’s view (jax jax2013)NodeJS: the good parts? A skeptic’s view (jax jax2013)
NodeJS: the good parts? A skeptic’s view (jax jax2013)
 
Microservices pattern language (microxchg microxchg2016)
Microservices pattern language (microxchg microxchg2016)Microservices pattern language (microxchg microxchg2016)
Microservices pattern language (microxchg microxchg2016)
 
Map, Flatmap and Reduce are Your New Best Friends: Simpler Collections, Concu...
Map, Flatmap and Reduce are Your New Best Friends: Simpler Collections, Concu...Map, Flatmap and Reduce are Your New Best Friends: Simpler Collections, Concu...
Map, Flatmap and Reduce are Your New Best Friends: Simpler Collections, Concu...
 
Spring Into the Cloud
Spring Into the CloudSpring Into the Cloud
Spring Into the Cloud
 
Sprint Portlet MVC Seminar
Sprint Portlet MVC SeminarSprint Portlet MVC Seminar
Sprint Portlet MVC Seminar
 
OSGi und Spring MVC - inovex BrownBag
OSGi und Spring MVC - inovex BrownBag OSGi und Spring MVC - inovex BrownBag
OSGi und Spring MVC - inovex BrownBag
 
RESTful OSGi Web Applications Tutorial - Khawaja S Shams & Jeff Norris
RESTful OSGi Web Applications Tutorial - Khawaja S Shams & Jeff NorrisRESTful OSGi Web Applications Tutorial - Khawaja S Shams & Jeff Norris
RESTful OSGi Web Applications Tutorial - Khawaja S Shams & Jeff Norris
 
S01 e01 schema-design
S01 e01 schema-designS01 e01 schema-design
S01 e01 schema-design
 
Java SE 8 & EE 7 Launch
Java SE 8 & EE 7 LaunchJava SE 8 & EE 7 Launch
Java SE 8 & EE 7 Launch
 
MongoSF 2012
MongoSF 2012MongoSF 2012
MongoSF 2012
 
SECON'2016. Алексеев Олег, Живой API
SECON'2016. Алексеев Олег, Живой APISECON'2016. Алексеев Олег, Живой API
SECON'2016. Алексеев Олег, Живой API
 

Similaire à Developing modular, polyglot applications with Spring (SpringOne India 2012)

Guy Nirpaz Next Gen App Servers
Guy Nirpaz Next Gen App ServersGuy Nirpaz Next Gen App Servers
Guy Nirpaz Next Gen App Servers
deimos
 
Resource Oriented Architecture in Wireless Sensor Network
Resource Oriented Architecture in Wireless Sensor NetworkResource Oriented Architecture in Wireless Sensor Network
Resource Oriented Architecture in Wireless Sensor Network
Thomas Pham
 
SPEC INDIA Java Case Study
SPEC INDIA Java Case StudySPEC INDIA Java Case Study
SPEC INDIA Java Case Study
SPEC INDIA
 
No More Hops Towards A Linearly Scalable Application Infrastructure
No More Hops Towards A Linearly Scalable Application InfrastructureNo More Hops Towards A Linearly Scalable Application Infrastructure
No More Hops Towards A Linearly Scalable Application Infrastructure
ConSanFrancisco123
 
Chris meyer gl wand - financial reporting in excel
Chris meyer   gl wand - financial reporting in excelChris meyer   gl wand - financial reporting in excel
Chris meyer gl wand - financial reporting in excel
Berry Clemens
 
A scalable server environment for your applications
A scalable server environment for your applicationsA scalable server environment for your applications
A scalable server environment for your applications
GigaSpaces
 
Nitin_Krishna_Resume
Nitin_Krishna_ResumeNitin_Krishna_Resume
Nitin_Krishna_Resume
Nitin Krishna
 

Similaire à Developing modular, polyglot applications with Spring (SpringOne India 2012) (20)

Decomposing applications for deployability and scalability (cfopentour india)
Decomposing applications for deployability and scalability (cfopentour india)Decomposing applications for deployability and scalability (cfopentour india)
Decomposing applications for deployability and scalability (cfopentour india)
 
Decomposing applications for deployability and scalability #springone2gx #s12gx
Decomposing applications for deployability and scalability #springone2gx #s12gxDecomposing applications for deployability and scalability #springone2gx #s12gx
Decomposing applications for deployability and scalability #springone2gx #s12gx
 
Guy Nirpaz Next Gen App Servers
Guy Nirpaz Next Gen App ServersGuy Nirpaz Next Gen App Servers
Guy Nirpaz Next Gen App Servers
 
Spring into the Cloud - JDC2012 Cairo, Egypt
Spring into the Cloud - JDC2012 Cairo, EgyptSpring into the Cloud - JDC2012 Cairo, Egypt
Spring into the Cloud - JDC2012 Cairo, Egypt
 
(ARC309) Getting to Microservices: Cloud Architecture Patterns
(ARC309) Getting to Microservices: Cloud Architecture Patterns(ARC309) Getting to Microservices: Cloud Architecture Patterns
(ARC309) Getting to Microservices: Cloud Architecture Patterns
 
Designing microservices
Designing microservicesDesigning microservices
Designing microservices
 
App Mod 01: Moving existing apps to the cloud
App Mod 01: Moving existing apps to the cloudApp Mod 01: Moving existing apps to the cloud
App Mod 01: Moving existing apps to the cloud
 
MongoDB World 2018: MongoDB and Cloud Foundry – A Match Made for the Cloud
MongoDB World 2018: MongoDB and Cloud Foundry – A Match Made for the CloudMongoDB World 2018: MongoDB and Cloud Foundry – A Match Made for the Cloud
MongoDB World 2018: MongoDB and Cloud Foundry – A Match Made for the Cloud
 
Decoupled web applications (with AppFabric)
Decoupled web applications (with AppFabric)Decoupled web applications (with AppFabric)
Decoupled web applications (with AppFabric)
 
Resource Oriented Architecture in Wireless Sensor Network
Resource Oriented Architecture in Wireless Sensor NetworkResource Oriented Architecture in Wireless Sensor Network
Resource Oriented Architecture in Wireless Sensor Network
 
SPEC INDIA Java Case Study
SPEC INDIA Java Case StudySPEC INDIA Java Case Study
SPEC INDIA Java Case Study
 
No More Hops Towards A Linearly Scalable Application Infrastructure
No More Hops Towards A Linearly Scalable Application InfrastructureNo More Hops Towards A Linearly Scalable Application Infrastructure
No More Hops Towards A Linearly Scalable Application Infrastructure
 
Convertigo Mobile Application Development platform for Enterprises
Convertigo Mobile Application Development platform for EnterprisesConvertigo Mobile Application Development platform for Enterprises
Convertigo Mobile Application Development platform for Enterprises
 
Chris meyer gl wand - financial reporting in excel
Chris meyer   gl wand - financial reporting in excelChris meyer   gl wand - financial reporting in excel
Chris meyer gl wand - financial reporting in excel
 
Linking Services and Linked Data: Keynote for AIMSA 2012
Linking Services and Linked Data: Keynote for AIMSA 2012Linking Services and Linked Data: Keynote for AIMSA 2012
Linking Services and Linked Data: Keynote for AIMSA 2012
 
Microservices - Hitchhiker's guide to cloud native applications
Microservices - Hitchhiker's guide to cloud native applicationsMicroservices - Hitchhiker's guide to cloud native applications
Microservices - Hitchhiker's guide to cloud native applications
 
Evolving Mobile Architectures
Evolving Mobile ArchitecturesEvolving Mobile Architectures
Evolving Mobile Architectures
 
Cloud-Native Modernization or Death? A false dichotomy. | DevNation Tech Talk
Cloud-Native Modernization or Death? A false dichotomy. | DevNation Tech TalkCloud-Native Modernization or Death? A false dichotomy. | DevNation Tech Talk
Cloud-Native Modernization or Death? A false dichotomy. | DevNation Tech Talk
 
A scalable server environment for your applications
A scalable server environment for your applicationsA scalable server environment for your applications
A scalable server environment for your applications
 
Nitin_Krishna_Resume
Nitin_Krishna_ResumeNitin_Krishna_Resume
Nitin_Krishna_Resume
 

Plus de Chris Richardson

Plus de Chris Richardson (20)

The microservice architecture: what, why, when and how?
The microservice architecture: what, why, when and how?The microservice architecture: what, why, when and how?
The microservice architecture: what, why, when and how?
 
More the merrier: a microservices anti-pattern
More the merrier: a microservices anti-patternMore the merrier: a microservices anti-pattern
More the merrier: a microservices anti-pattern
 
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
 
Dark Energy, Dark Matter and the Microservices Patterns?!
Dark Energy, Dark Matter and the Microservices Patterns?!Dark Energy, Dark Matter and the Microservices Patterns?!
Dark Energy, Dark Matter and the Microservices Patterns?!
 
Dark energy, dark matter and microservice architecture collaboration patterns
Dark energy, dark matter and microservice architecture collaboration patternsDark energy, dark matter and microservice architecture collaboration patterns
Dark energy, dark matter and microservice architecture collaboration patterns
 
Scenarios_and_Architecture_SkillsMatter_April_2022.pdf
Scenarios_and_Architecture_SkillsMatter_April_2022.pdfScenarios_and_Architecture_SkillsMatter_April_2022.pdf
Scenarios_and_Architecture_SkillsMatter_April_2022.pdf
 
Using patterns and pattern languages to make better architectural decisions
Using patterns and pattern languages to make better architectural decisions Using patterns and pattern languages to make better architectural decisions
Using patterns and pattern languages to make better architectural decisions
 
iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...
iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...
iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...
 
Events to the rescue: solving distributed data problems in a microservice arc...
Events to the rescue: solving distributed data problems in a microservice arc...Events to the rescue: solving distributed data problems in a microservice arc...
Events to the rescue: solving distributed data problems in a microservice arc...
 
A pattern language for microservices - June 2021
A pattern language for microservices - June 2021 A pattern language for microservices - June 2021
A pattern language for microservices - June 2021
 
QConPlus 2021: Minimizing Design Time Coupling in a Microservice Architecture
QConPlus 2021: Minimizing Design Time Coupling in a Microservice ArchitectureQConPlus 2021: Minimizing Design Time Coupling in a Microservice Architecture
QConPlus 2021: Minimizing Design Time Coupling in a Microservice Architecture
 
Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...
Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...
Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...
 
Designing loosely coupled services
Designing loosely coupled servicesDesigning loosely coupled services
Designing loosely coupled services
 
Microservices - an architecture that enables DevOps (T Systems DevOps day)
Microservices - an architecture that enables DevOps (T Systems DevOps day)Microservices - an architecture that enables DevOps (T Systems DevOps day)
Microservices - an architecture that enables DevOps (T Systems DevOps day)
 
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
 
Decompose your monolith: Six principles for refactoring a monolith to microse...
Decompose your monolith: Six principles for refactoring a monolith to microse...Decompose your monolith: Six principles for refactoring a monolith to microse...
Decompose your monolith: Six principles for refactoring a monolith to microse...
 
TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...
TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...
TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...
 
Overview of the Eventuate Tram Customers and Orders application
Overview of the Eventuate Tram Customers and Orders applicationOverview of the Eventuate Tram Customers and Orders application
Overview of the Eventuate Tram Customers and Orders application
 
An overview of the Eventuate Platform
An overview of the Eventuate PlatformAn overview of the Eventuate Platform
An overview of the Eventuate Platform
 
#DevNexus202 Decompose your monolith
#DevNexus202 Decompose your monolith#DevNexus202 Decompose your monolith
#DevNexus202 Decompose your monolith
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Dernier (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Developing modular, polyglot applications with Spring (SpringOne India 2012)

  • 1. Developing modular, polyglot applications with Spring Chris Richardson Author of POJOs in Action, Founder of the original CloudFoundry.com @crichardson chris.richardson@springsource.com http://plainoldobjects.com/
  • 2. Presentation goal Modular, polyglot applications: what, why and how? Why Spring is the ideal technology for building these applications
  • 5. About Chris - 1999 CORBA Enterprise WebLogic Server JavaBeans
  • 7. Spring programming model Dependency Injection POJO Portable Aspect- Service Oriented Abstractions Programming
  • 8. Transformed how I developed software!
  • 10. About Chris - 2006 Oakland JUG Cloud Computing
  • 11. Transformed how I deployed software!
  • 14. vmc push About-Chris Developer Advocate for CloudFoundry.com Signup at http://cloudfoundry.com
  • 15. Agenda • The (sometimes evil) monolith • Refactoring to a modular, polyglot architecture • Presentation layer design • Using NoSQL databases • Inter-service communication options
  • 16. Let’s imagine you are building an e-commerce application
  • 17. Traditional web application architecture WAR StoreFrontUI Accounting Service MySQL Browser Apache Database InventoryService Simple to Shipping Service develop test Tomcat deploy scale
  • 18. But there are problems
  • 19. Users expect a rich, dynamic and interactive experience h oug d en HTTP Request oo ’t g Browser e isn Java Web Application HTML/Javascript ec tur it ar ch e UI s tyl Old HTML5/JavaScript browser applications Real-time web ≅ NodeJS
  • 20. Limitations of relational databases • Scalability • Distribution • Schema updates • O/R impedance mismatch • Handling semi-structured data
  • 22. Scalability issues • Different components have different scalability needs but you can only scale the entire system • Some components might not be scalable can’t scale system
  • 23. Obstacle to frequent deployments • Need to redeploy everything to change one component • Increases risk of failure, e.g. interrupts background jobs Fear of change • Extensive test cycle • Updates will happen less often, e.g. Makes A/B testing UI really difficult
  • 24. Overloads your IDE and container Slows down development
  • 25. Obstacle to scaling development But the I want to update backend is not the UI working yet! Lots of coordination and communication required
  • 26. Requires long-term commitment to a technology stack
  • 27. Agenda • The (sometimes evil) monolith • Refactoring to a modular, polyglot architecture • Presentation layer design • Using NoSQL databases • Inter-service communication options
  • 28.
  • 29. The scale cube Y axis - functional decomposition ila g sim nin Scale by r ing ing tio splitting th litt r ti sp pa different things by data s ale - Sc is ax Z X axis - horizontal duplication
  • 30. Y-axis scaling - application level WAR StoreFrontUI Accounting Service InventoryService Shipping Service
  • 31. Y-axis scaling - application level accounting application Accounting Service Store front web application inventory application StoreFrontUI InventoryService shipping application Shipping Service Apply X axis cloning and/or Z axis partitioning to each service
  • 32. Real world examples http://techblog.netflix.com/ Between 100-150 services are accessed to build a page. http://highscalability.com/amazon-architecture http://www.addsimplicity.com/downloads/ eBaySDForum2006-11-29.pdf http://queue.acm.org/detail.cfm?id=1394128
  • 33. Drawbacks of Y-axis splits • Complexity • Partitioned databases and transaction management • Deciding when to use this approach
  • 34. But there are many benefits • Scales development: develop, deploy and scale each service independently • Enables frequent deployments • Less for each developer to learn • Doesn’t overload IDE or container • Improves fault isolation • Easily adopt new technologies
  • 35. Two levels of architecture System-level Services Inter-service glue: interfaces and communication mechanisms Slow changing Service-level Internal architecture of each service Each service can use a different technology stack Rapidly evolving - regularly rewrite Pick the best tool for the job
  • 36. Modular, polyglot, applications
  • 37. Lots of languages and frameworks to choose from And many more...
  • 38. But there are lots of awesome, and mature Spring projects • Spring Framework • Spring Integration • Spring Security • Spring AMQP • Spring Mobile • Spring Social • Spring Data • Spring Shell • Spring Web Services • ... • Spring Batch
  • 39. Spring works with Scala @Controller class TwilioController { @Autowired var surveyManagementService: SurveyManagementService = _ @RequestMapping(value = Array("/begincall.html")) @ResponseBody def beginCall(@RequestParam("From") callerId: String) = { surveyManagementService.findSurveyByCallerId(callerId) match { case None => <Response> <Say>Sorry don't recognize your number</Say> <Hangup/> </Response> case Some(survey) => <Response> <Say>{ survey.prompt }</Say> <Gather action="handleresponse.html" method="POST" numDigits="1"> { for ((choice, index) <- survey.choices zipWithIndex) yield <Say>Press { index } for { choice }</Say> } </Gather> <Say>We are sorry you could not decide</Say> <Hangup/> </Response> } }
  • 40. The Spring Scala project class  PersonConfiguration                            extends  FunctionalConfiguration  {        val  jack  =  bean()  {                new  Person("Jack",  "Doe")        } • Scala-style “setters/getters”        val  jane  =  bean()  {                new  Person("Jane",  "Doe")        } • Bean configuration DSL        val  john  =  bean()  {                val  john  =  new  Person("John",  "Doe")                john.father  =  jack() • Scala-style template classes                john.mother  =  jane()                john        } } https://github.com/SpringSource/spring-scala
  • 41. Coming in 2013 Java 8 closures = concise code! List<Album> albums = ... Predicate List<Album> sortedFavorites = albums.stream() .filter(a -> a.tracks.anyMatch(t -> (t.rating >= 4))) .sorted(comparing(a -> a.name)) .into(new ArrayList<>()); Parallelism int sum = shapes.parallel() .filter(s -> s.getColor() == BLUE) .map(s -> s.getWeight()) .sum(); http://cr.openjdk.java.net/~briangoetz/lambda/sotc3.html
  • 42. Key benefits of Spring are still Modularity Productivity Portability Testability
  • 43. Agenda • The (sometimes evil) monolith • Refactoring to a modular, polyglot architecture • Presentation layer design • Using NoSQL databases • Inter-service communication options
  • 44. Presentation layer evolution.... WAR StoreFrontUI HTML / HTTP View Controller Browser Model
  • 45. ...Presentation layer evolution Browser Web application Static content View Controller JSON-REST RESTful Endpoints Model Events Event HTML 5 - JavaScript publisher No elaborate, server-side web framework required
  • 46. How to publish events to browser?
  • 47. NodeJS is the fashionable technology
  • 48. Why NodeJS? • Familiar JavaScript • High-performance, scalable event-driven, non-blocking I/O model • Compact runtime, e.g. 64M • Over 13,000 17,000 modules developed by the community • ManyJavaScript client frameworks have a NodeJS counterpart, e.g. socket.io and SockJS
  • 49. Why not NodeJS? a.k.a. callback hell
  • 50. Dealing with JavaScript “...Still the consequence of this is that we must take javascript seriously as a first-class language and concentrate on how to limit the damage its flaws cause....” http://martinfowler.com/bliki/gotoAarhus2012.html
  • 51. NodeJS as a mediator... Node JS Service 1 Browser Server app Static content REST Service 2 HTML 5 Application Events Socket.io Socket.io client server ...
  • 52. ...NodeJS as a mediator REST REST Service Node JS Events AMQP AMQP socket.io RabbitMQ Service
  • 53. Example NodeJS application var express = require('express') , http = require('http') , amqp = require(‘amqp’) , server = http.createServer(app) , io = require('socket.io').listen(server) ....; server.listen(8081); Handle socket.io ... connection var amqpCon = amqp.createConnection(...); io.sockets.on('connection', function (socket) { Republish as function amqpMessageHandler(message, headers, deliveryInfo) { var m = JSON.parse(message.data.toString()); socket.io event socket.emit(‘tick’, m); }; amqpCon.queue(“”, {}, Subscribe to AMQP function(queue) { queue.bind(“myExchange”, “myBindingKey”); queue queue.subscribe(amqpMessageHandler); }); });
  • 54. Example browser application <html> <body> The event is <span data-bind="text: ticker"></span> <script src="/socket.io/socket.io.js"></script> <script src="/knockout-2.0.0.js"></script> <script src="/clock.js"></script> </body> Bind to model Connect to </html> socket.io server clock.js var socket = io.connect(location.hostname); function ClockModel() { self.ticker = ko.observable(1); Subscribe to tick socket.on('tick', function (data) { event self.ticker(data); }); }; Update model ko.applyBindings(new ClockModel());
  • 55. About Cujojs & s2js Dependency Injection www.cujojs.com github.com/s2js JavaScript Portable Aspect- Service Oriented Abstractions Programming
  • 56. Agenda • The (sometimes evil) monolith • Refactoring to a modular, polyglot architecture • Presentation layer design • Using NoSQL databases • Inter-service communication options
  • 57. Why NoSQL? Benefits Drawbacks • Higher performance • Limited transactions • Higher scalability • Limited querying • Richer data-model • Relaxed consistency • Schema-less • Unconstrained data
  • 58. Example NoSQL Databases Database Key features Cassandra Extensible column store, very scalable, distributed Neo4j Graph database Document-oriented, fast, scalable MongoDB Redis Key-value store, very fast http://nosql-database.org/ lists 122+ NoSQL databases
  • 59. NoSQL and the scale cube nin a ing itio dr rd r t an ha pa ss s Ca DB g go on M MongoDB replica sets Cassandra replication
  • 60. The future is polyglot IEEE Software Sept/October 2010 - Debasish Ghosh / Twitter @debasishg
  • 61. Polyglot persistence architecture accounting application Accounting Service MySQL storefront web application inventory application StoreFrontUI InventoryService Redis shipping application ShippingService Mongo
  • 62. Spring Data = simplifying data access • Redis • MongoDB • Neo4j • JPA • REST • Apache Hadoop • Gemfire http://www.springsource.org/spring-data
  • 63. Agenda • The (sometimes evil) monolith • Refactoring to a modular, polyglot architecture • Presentation layer design • Using NoSQL databases • Inter-service communication options
  • 64. Inter-service communication options • Synchronous HTTP asynchronous AMQP • Formats: JSON, XML, Protocol Buffers, Thrift, ... • JSON is fashionable and easier to debug • Binary format is more efficient
  • 65. Asynchronous message-based communication wgrus-billing.war Accounting Service wgrus-store.war wgrus-inventory.war RabbitMQ StoreFrontUI (Message InventoryService MySQL Broker) wgrus-shipping.war ShippingService
  • 66. Benefits • Decouples caller from server • Caller unaware of server’s coordinates (URL) • Message broker buffers message when server is down/slow • Supports a variety of communication patterns
  • 67. Drawbacks • Additional complexity of message broker • Request/reply using messaging is more complex • Firewall unfriendly
  • 68. Spring AMQP • Encapsulates low-level Producer Consumer details • Simplifiessending and Amqp Listener receiving of messages Template Container Spring AMQP AMQP
  • 69. Spring Integration • Provides the building blocks for a pipes and filters architecture • Enables development of application components that are • loosely coupled • insulated from messaging infrastructure • Messaging defined declaratively
  • 70. Development time: same JVM @Service public class OrderServiceImpl { @Service public class ShippingServiceImpl { @Autowired private ShippingService shippingService; public void shipOrder(String orderId) { .... public void placeOrder() { } String orderId = generateOrderId(); … } shippingService.shipOrder(orderId); } } Order Shipping Service service shipOrder() Messaging Gateway Channel Service Activator
  • 71. Test and production: distributed Application code is unchanged Order Shipping Service service Messaging Gateway RabbitMQ Channel AMQP AMQP Channel Service Activator
  • 72. Synchronous REST wgrus-billing.war Accounting Service wgrus-store.war REST wgrus-shipping.war StoreFrontUI Shipping MySQL Service wgrus-inventory.war ... InventoryService
  • 73. Pros and cons of REST • Pros • Cons • Simple and familiar • Only supports request/ reply • Request/reply is easy • Server must be available • Firewall friendly • Clientneeds to know • No intermediate broker URL(s) of server(s)
  • 74. Spring MVC makes REST easy URL matching @Controller & public class AccountController { object destructuring @Autowired XML/JSON private MoneyTransferService moneyTransferService; @RequestMapping(value = "/accounts/{accountId}", method = RequestMethod.GET) @ResponseBody public AccountInfo getAccount(@PathVariable String accountId) { Account account = moneyTransferService.findAccountByid(accountId); return makeAccountInfo(account); } @RequestMapping(value = "/accounts", method = RequestMethod.POST) @ResponseStatus( HttpStatus.CREATED ) public void createAccount(@RequestBody AccountInfo accountInfo, UriComponentsBuilder builder, HttpServletResponse response) { ... } XML/JSON object
  • 75. Not all APIs are RESTful From http://martinfowler.com/articles/richardsonMaturityModel.html
  • 76. About Hypertext As The Engine Of Application State • Single well known URL • Entity representation has typed relationship links • Client discovers what it can do to an entity via those links See http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
  • 77. About HATEOAS The well known URL $ curl http://cf-auto-scaler.cloudfoundry.com {"links": [ {"rel":"autoscaledapps", "href":"http://cf-auto-scaler.cloudfoundry.com/autoscaledapps"} ]} Link link type $ curl http://cf-auto-scaler.cloudfoundry.com/autoscaledapps {"content":[ {"name":"vertx-clock", "links":[ {"rel":"self","href":"http://cf-auto-scaler.cloudfoundry.com/autoscaledapps/vertx-clock"}, {"rel":"rules","href":"http://cf-auto-scaler.cloudfoundry.com/autoscaledapps/vertx-clock/rules"} ] }], ... Links to act on this app }
  • 78. Spring HATEOAS @Controller @RequestMapping(value = "/autoscaledapps") public class AutoscaledAppController { @RequestMapping(value = "/{appName}", method = RequestMethod.GET) public HttpEntity<AutoscaledAppResource> get(@PathVariable String appName) { AutoscaledAppResource ar = new AutoscaledAppResource(appName); ar.add(linkTo(AutoscaledAppController.class) .slash(appName).withSelfRel()); ar.add(linkTo(AutoscaledAppController.class) .slash(appName).slash("rules").withRel("rules")); return new HttpEntity<AutoscaledAppResource>(ar); } ... public class AutoscaledAppResource } extends ResourceSupport { private String name; https://github.com/SpringSource/spring-hateoas
  • 79. Consuming RESTful WS RestTemplate restTemplate = new RestTemplate(); AccountInfo accountInfo = new AccountInfo(...); URI accountUrl = restTemplate.postForLocation("http://localhost/accounts", accountInfo); ResponseEntity<AccountInfo> accountInfoResponse = restTemplate.getForEntity(accountUrl, AccountInfo.class); Assert.assertEquals(HttpStatus.SC_OK, accountInfoResponse.getStatusCode()); AccountInfo accountInfo2 = accountInfoResponse.getBody(); ...
  • 80. The Spring REST shell $ rest-shell http://localhost:8080:> baseUri http://cf-auto-scaler.cloudfoundry.com http://cf-auto-scaler.cloudfoundry.com:> discover rel href ======================================================================= autoscaledapps http://cf-auto-scaler.cloudfoundry.com/autoscaledapps http://cf-auto-scaler.cloudfoundry.com:> follow --rel autoscaledapps http://cf-auto-scaler.cloudfoundry.com/autoscaledapps:> post --from src/test/resources/examplejson/createapp1.json --follow true 1 files uploaded to the server using POST http://cf-auto-scaler.cloudfoundry.com/autoscaledapps/vertx-clock:> discover rel href ================================================================================ self http://cf-auto-scaler.cloudfoundry.com/autoscaledapps/vertx-clock rules http://cf-auto-scaler.cloudfoundry.com/autoscaledapps/vertx-clock/rules http://cf-auto-scaler.cloudfoundry.com/autoscaledapps/vertx-clock:> follow --rel rules http://cf-auto-scaler.cloudfoundry.com/autoscaledapps/vertx-clock/rules:> post --from src/test/resources/examplejson/createrule1.json --follow true 1 files uploaded to the server using POST http://cf-auto-scaler.cloudfoundry.com/autoscaledapps/vertx-clock/rules/idle:> up http://cf-auto-scaler.cloudfoundry.com/autoscaledapps/vertx-clock/rules:> up
  • 81. Original architecture WAR StoreFrontUI Accounting Service MySQL Browser Apache Database InventoryService Simple to Shipping Service develop test Tomcat deploy scale
  • 82. Modular, polyglot architecture Desktop Browser Native Mobile application HTML5 mobile application oy StoreUI StoreUI StoreUI pl NodeJS !?! e Asynchronous, NodeJS Javascript scalable is d StoreUI communication th we RabbitMQ Spring/Scala do web application Inventory Standalone Inventory Shipping Service Service Shipping “headless” Service Spring ow Integration/Java applications Billing Service Redis Inventory Mongo Order H Database Database MySQL Customer Database
  • 83. OSS community vFabric Postgres Ap Private   Clouds   p Data Services lica 'o n  S vFabric Public erv RabbitMQTM ice Msg Services Clouds  In ter fac Micro e Other Services Clouds Additional partners services …
  • 84. Cloud Foundry simplifies the deployment of modular, polyglot applications
  • 85. Spring makes it easy to consume Cloud Foundry services
  • 86. Many Spring applications run on Cloud Foundry unchanged
  • 87. Summary • Modern applications have a modular, polyglot architecture • Springis the ideal technology for building these applications • Cloud Foundry is the ideal way to deploy these applications
  • 88. @crichardson chris.richardson@springsource.com http://plainoldobjects.com Thank you! www.cloudfoundry.com @cloudfoundry