SlideShare ist ein Scribd-Unternehmen logo
1 von 62
Downloaden Sie, um offline zu lesen
Spring into the Cloud
Jennifer Hickey
@jencompgeek
jennifer.hickey@springsource.com
About this session




           Spring and
       the Cloud: a match
         made in heaven
About Jennifer



•Long time SpringSource-er
•Contributed to many Spring and SpringSource projects
•Cloud Foundry Engineer
 •Focused on framework support




                                                        3
Agenda


•Why Cloud? Why PaaS?
•Spring Framework for the Cloud
•Data
 Developing NoSQL applications for the Cloud with Spring

•Integration
 Cloud application integration with RabbitMQ and Spring

•Wrap up




                                                           4
Traditional web application architecture

• Browser client
• Monolithic WAR
• RDBMS
    Desktop                                 MySQL
                   Apache    WAR
    Browser                                Database


                             Tomcat



       Simple to develop
       Simple to test
       Simple to deploy
       Simple to scale: just add Apache + more
       Tomcats

                                                      5
New kinds of clients




      Smart phones overtake PCs in Q4 2010

                                             6
Users expect a rich, dynamic and interactive experience
           on mobile devices and desktop



                                                           gh
                                                         ou
                                                   d   en
                                                 oo
                                             ’t g
                     HTTP Request         isn
     Desktop
                                 ct ure      Java Web
                              e
     Browser
                          hit
                     HTML/Javascript         Application
                         I arc
               ty le U
      Olds




                                                                7
Users expect a rich, dynamic and interactive experience on mobile
                       devices and desktop




     HTML5           WS Request
    Javascript
   Application       XML/JSON response     Web Services


Mobile and Desktop
     Browser         Web Socket/Eventing




                                                                8
Popular social networks

•Applications need to integrate with them
 •Application integration problem
 •Scaling graphs is challenging
•Application go viral through social networks
 •Very rapid growth
 •Capacity planning nightmare




                                                9
Need scalable architectures to handle massive loads

•Application tier
 •Replicated/clustered servers
 •Modular so that components can be scaled differently
 •Asynchronous architecture - communication via a message broker
•Database tier
 •Replication
 •Sharding
 •Polyglot persistence: Relational, NoSQL, NewSQL databases




                                                                   10
Data Explosion: Data Volumes increasing at 60% per year




 Horizontally scalable, distributed NoSQL Databases       20
                                                           11



         Eventual consistency rather than ACID
Scaling development




             WAR
            Front End
                                     Scalable
         User Management
                                  !=
             Search
                                     development
             Ordering




• Forces multiple developers/teams to
  efforts
                                        synchronize development

• Obstacle to frequent, independent deployments
• Increases risk of failure - need to redeploy everything to change one
  thing

                                                                          12
Scaling development

•Need “SOA” approach
 •Partition application into set of services
 •Partition by noun or by verb
•manages their own release schedule. and
 Each team is responsible for a service

 •New code updates frequently
 •Mature services upgrade infrequently
                             User
                                                  User
                          Management
                                               Management
                           Front-end


                            Search
                                                 Search
                           Front-End


                           Ordering
                                                Ordering
                           Front-End


                                                            13
Modern application architecture


                                           User
                                           Management
                                                        MySQL


                                          Tomcat
 Desktop
 Browser




 Native        NodeJS                       Search
                 NodeJS
 Mobile        front-end
                 front-end
 Application   application
                 application
                               RabbitMQ
                                           Tomcat

 HTML5                                                  Mongo
 mobile
 application
                Redis
                                             Ordering




                                           Tomcat
                                                                14
Three layers of cloud computing


                   SaaS




                    PaaS


Need to be here

                    IaaS




                                   15
What you need is PaaS =




       Easy deployment
                                     Services:
   Application management         Database
                              +   Blob storage
   Easy scaling up and down       Messaging
                                  ...




                                                 16
Cloud Foundry: Services, Frameworks and Clouds




                                                 17
Agenda


•Why Cloud? Why PaaS?
•Spring Framework for the Cloud
•Data
 Developing NoSQL applications for the Cloud with Spring

•Integration
 Cloud application integration with RabbitMQ and Spring

•Wrap up




                                                           18
Spring’s aim:
 bring simplicity to java development
                                                               data
  web tier
                                batch       integration &     access
    &        service tier                                                      mobile
                             processing      messaging      / NoSQL /
   RIA
                                                            Big Data


                            The Spring framework
the cloud:                    lightweight                      traditional
      CloudFoundry                                                   WebSphere
                                          tc Server
    Google App Engine                                                 JBoss AS
                                           Tomcat
   Amazon Web Services                                               WebLogic
                                             Jetty
         Heroku                                                  (on legacy versions, too!)




                                                                                              19
At its core, the Spring Framework...

•developing enterprise Java™ applications
 Provides comprehensive infrastructural support for

 •Spring deals with the plumbing
 •So you can focus on solving the domain problem




                                                      20
Spring 3.1 Environment Abstraction

•Bean definitions for a specific environment (Profiles)
 •e.g. development, testing, production
 •Possibly different deployment environments
 •Activate profiles by name
  •spring.profiles.active system property
  •Other means outside deployment unit
  •“default” profile activates if no other profiles specified
•Custom resolution of placeholders
 •Dependent on the actual environment
 •Ordered property sources




                                                                21
Isolating Cloud Configuration


<bean class="org.sf.orm.jpa.LocalContainerEntityManagerFactoryBean">
     <property name="dataSource" ref="dataSource"/>
</bean>
<beans profile="cloud">
	   <cloud:data-source id="dataSource" />
</beans>
	
<beans profile="default">
	   <bean class="org.a.commons.dbcp.BasicDataSource" id="dataSource">
	        <property name="url" value="jdbc:mysql://localhost/my_db" />
	   </bean>
</beans>




                                                                        22
Java Configuration with Profiles


  @Configuration
  @Profile(“local”)
  public class LocalDataSourceConfiguration {

  @Bean public javax.sql.DataSource dataSource() { ... }

  }


  @Configuration
  @Profile(“cloud”)
  public class CloudDataSourceConfiguration {

  @Bean public javax.sql.DataSource dataSource() { ... }

  }




                                                           23
Agenda


•Why Cloud? Why PaaS?
•Spring Framework for the Cloud
•Data
 Developing NoSQL applications for the Cloud with Spring

•Integration
 Cloud application integration with RabbitMQ and Spring

•Wrap up




                                                       24
Data Access Challenge #1: Scale Horizontally




                                               25
Data Access Challenge #2: Heterogeneous data access needs




                                                            26
NoSQL offers several data store categories




Key-Value       Column            Document   Graph




 Redis,          Cassandra,        MongoDB   Neo4J
 Riak            HBase




                                                     27
NoSQL offers several data store categories




Key-Value       Column            Document   Graph




                                   MongoDB




                                                 28
Spring Framework
    built-in data access support

•Transaction abstractions
•Common data access exception hierarchy
•JDBC - JdbcTemplate
•ORM - Hibernate, JPA support
•OXM - Object to XML mapping
•Serializer/Deserializer strategies (Spring 3.0)
•Cache support (Spring 3.1)

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


•Spring Data Key-value
•Spring Data Document
•Spring Data Graph
•Spring Data Column
•Spring Data Blob
•Spring Data JPA Repository / JDBC Extensions
•Spring Gemfire / Spring Hadoop ...
•Grails iNcOnSeQuentiaL
                                                30
Spring Data Building Blocks



•Low level data access APIs
  ✓MongoTemplate, RedisTemplate ...
•Object Mapping (Java and GORM)
•Cross Store Persistence Programming model
•Generic Repository support
•Productivity support in Roo and Grails

                                             31
Spring MongoDB




                 32
Spring Data Document
                 Mongo
•MongoTemplate interface for mapping Mongo documents
  •
  MongoConverter
  •SimpleMongoConverter for basic POJO mapping support
  •Leverage Spring 3.0 TypeConverters and SpEL
  •Exception translation
•Advanced Mapping
  •Annotation based (@Document, @Id, @DbRef)
•MongoRepository for JPA Repositories
  •Built on Hades support

                                                         33
Simple Domain Class




                      34
Mongo Template

Direct Usage of the Mongo Template:




                    Insert into “Person”
                         Collection
            findOne using query: { "name" : "Joe"}
               in db.collection: database.Person
           Dropped collection [database.person]




                                                     35
Generic Repository

Interface for generic CRUD operations on a repository for a specific type




                                                                            36
Paging and Sorting Repository


Paging and Sorting Repository:   Extends “CrudRepository”




 Usage:




                                                            37
Custom Repository

Custom Repository:




Keywords :
Keyword       Sample                               Logical result

GreaterThan   findByAgeGreaterThan(int age)        {"age" : {"$gt" : age}}

LessThan      findByAgeLessThan(int age)           {"age" : {"$lt" : age}}

Between       findByAgeBetween(int from, int to)   {"age" : {"$gt" : from, "$lt" : to}}

NotNull       findByFirstnameNotNull()             {”firstname" : {"$ne" : null}}

Null          findByFirstnameNull()                {”firstname" : null}

Like          findByFirstnameLike(String name)     "firstname" : firstname} (regex)
                                                                                  38
Cross Store




              39
JPA and MongoDB

 JPA “Customer” with a “SurveyInfo” Document




                                               40
Using a Cross-Store

  Saving a Customer with a SurveryInfo
                            Create Customer

                               Create SurveyInfo


              Assign Survey to Customer
                           Save




  Mongo Document:




                                                   41
Demo
Cross-Store Persistence with Mongo




                                     42
Agenda


•Why Cloud? Why PaaS?
•Spring Framework for the Cloud
•Data
 Developing NoSQL applications for the Cloud with Spring

•Integration
 Cloud application integration with RabbitMQ and Spring

•Wrap up




                                                           43
wgrus-monolithic.war

                                     @Controller
                                     StoreFront




     Widget                  Gadget                Accounting   Shipping
InventoryService        InventoryService            Service     Service




                                           RDBMS


                                                                           44
It’s simple to develop but ....

•Lack of scalability
 •Scale through replication
 •Non-replicable component => nothing can be replicated
 •Can’t scale different parts of the application differently
•Lack of deployability
 •Deploy it all in one go
 •Increased risk of something breaking
•Applications are brittle
 •Store can’t accept orders unless all services are available
 •Failure (e.g. memory leak) in one component can take down every other
•Monolingual
 •Can’t use non-JVM server-side technologies: NodeJS, Rails


                                                                          45
Solution:
Asynchronous Architecture




                            46
wgrus-billing.war

                                     Accounting
                                      Service




                            wgrus-inventory.war
wgrus-store.war                        Widget
                                  InventoryService
                  Message
     StoreFront   Broker                             MySQL
                            wgrus-inventory.war

                                       Gadget
                                  InventoryService




                            wgrus-shipping.war
                                   Shipping
                                   Service
                                                             47
RabbitMQ – Messaging that Just Works




                       Robust
                  High-performance
                     Easy to use
                   AMQP LEADER
Spring AMQP

• Encapsulates low-level details     Producer          Consumer
• Simplifies sending and receiving
  of messages


                                      Amqp               Listener
                                     Template           Container


                                            Spring AMQP




                                                AMQP
Spring Integration

• Builds on Spring framework
• High-level of abstraction for building message
  based applications
• Implements EAI patterns
• Provides applicationfor exchanging messages
  between
           plumbing
                       components
• Promotes loosely coupled components
• Integrates with JMS, AMQP, HTTP, Email, File
  infrastructure:
                  external messaging

 transfer




                                                   50
Spring Integration concepts

•Message channel
 •Virtual pipe connecting producer and consumer
•Message endpoints
 •The filter of a pipes-and-filter architecture
 •Read from and/or write to channel
•Endpoint types
 •Transformer
 •Filter
 •Router
 •Splitter
 •Aggregator
 •ServiceActivator
 •Inbound channel adapter - read from external source, writes to channel
 •destinationchannel adapter - read from channel write to external
  Outbound


                                                                           51
Example of reconfigurability - local

 @Service
 public class OrderServiceImpl {                      @Service
                                                      public class ShippingServiceImpl {
 @Autowired
 private ShippingService shippingService;             public void shipOrder(String orderId) {
                                                        System.out.println("shipped order: " +
 public void placeOrder() {                                        orderId);
 String orderId = generateOrderId();                  }
 …
 shippingService.shipOrder(orderId);                  }
 }

 }



                      Order                                       Shipping
                     Service                                       service




         Messaging
          Gateway

                                            Channel                 Service
                                                                    Activator




                                                                                                 52
Example of reconfigurability - distributed



                      Code unchanged in new deployment




             Order                                                        Shipping
            Service                                                        service




Messaging
 Gateway                                   RabbitMQ

                        Channel    AMQP                  AMQP   Channel    Service
                                                                           Activator




                                                                                       53
Using Spring Integration with the web
          store application




                                        54
wgrus-store.war                                       wgrus-shipping.war

      StoreFront                                              Shipping
                                                              Service




wgrus-billing.war     wgrus-inventory.war

     Credit Service        Spring Integration Logic



                                   Widget
                              InventoryService

                                   Gadget
                              InventoryService

                                                                           55
Store front flow




StoreUI

                                            object to
          Message Endpoint   orderChannel               amqpOut   AMQP
                                             JSON




                                                                         56
Inventory flow


                                      Json to    credit check      inventory               inventory    Object to
 AMQP     inventory                                                                                                 AMQP
                                      Object       enricher        encricher              AMQP Out       JSON




                                                                                            inventory
                                                                                              router
                      credit check




                       credit check                                      Content Based
                          service                                           Router
                         activator




                                       Credit
                                       Service




                                                                  widget                  gadget
                                                                inventory                inventory
                                                                 service                  service
                                                                                                                           57
Shipping flow




                                                 shipping
                                                  service
                           Json to
   AMQP         shipping             Service
                           Object
                 order               Activator
                channel




                                                            58
Demo
WGRUS in the Cloud




                     59
Agenda


•Why Cloud? Why PaaS?
•Spring Framework for the Cloud
•Data
 Developing NoSQL applications for the Cloud with Spring

•Integration
 Cloud application integration with RabbitMQ and Spring

•Wrap up




                                                           60
Summary

•Cloud? Good.
•Spring? Good.
•Spring and the Cloud is a match made in heaven




                                                  61
Where to Find More

•http://bit.ly/spring-data
 Spring Data Project:

•http://www.springsource.org/spring-integration
 Spring Integration Project:

•https://github.com/jencompgeek/cloudfoundry-samples/tree/master/cross-
 Mongo Cross Store Sample:
 store
•https://github.com/markfisher/springone-wgrus
 WGRUS Sample:

•http://bit.ly/cloudfoundry-samples
 CloudFoundry Samples:

• Sign up for (free) Cloud Foundry
 http://www.cloudfoundry.com
•http://bit.ly/mcf4spring for Spring Developers
 MicroCloud Foundry

•Cloud Foundry and Spring YouTube Channels
                                                                      62

Weitere ähnliche Inhalte

Was ist angesagt?

micro services architecture (FrosCon2014)
micro services architecture (FrosCon2014)micro services architecture (FrosCon2014)
micro services architecture (FrosCon2014)smancke
 
Extending Windows Admin Center to manage your applications and infrastructure...
Extending Windows Admin Center to manage your applications and infrastructure...Extending Windows Admin Center to manage your applications and infrastructure...
Extending Windows Admin Center to manage your applications and infrastructure...Microsoft Tech Community
 
Powering Microservices with MongoDB, Docker, Kubernetes & Kafka – MongoDB Eur...
Powering Microservices with MongoDB, Docker, Kubernetes & Kafka – MongoDB Eur...Powering Microservices with MongoDB, Docker, Kubernetes & Kafka – MongoDB Eur...
Powering Microservices with MongoDB, Docker, Kubernetes & Kafka – MongoDB Eur...Andrew Morgan
 
Designing For Multicloud, CF Summit Frankfurt 2016
Designing For Multicloud, CF Summit Frankfurt 2016Designing For Multicloud, CF Summit Frankfurt 2016
Designing For Multicloud, CF Summit Frankfurt 2016Mark D'Cunha
 
Microservices with Kafka Ecosystem
Microservices with Kafka EcosystemMicroservices with Kafka Ecosystem
Microservices with Kafka EcosystemGuido Schmutz
 
Kafka Connect & Kafka Streams/KSQL - the ecosystem around Kafka
Kafka Connect & Kafka Streams/KSQL - the ecosystem around KafkaKafka Connect & Kafka Streams/KSQL - the ecosystem around Kafka
Kafka Connect & Kafka Streams/KSQL - the ecosystem around KafkaGuido Schmutz
 
Cisco's MultiCloud Strategy
Cisco's MultiCloud StrategyCisco's MultiCloud Strategy
Cisco's MultiCloud StrategyMaulik Shyani
 
Resilient microservices with Kubernetes - Mete Atamel
Resilient microservices with Kubernetes - Mete AtamelResilient microservices with Kubernetes - Mete Atamel
Resilient microservices with Kubernetes - Mete AtamelITCamp
 
Event Streaming CTO Roundtable for Cloud-native Kafka Architectures
Event Streaming CTO Roundtable for Cloud-native Kafka ArchitecturesEvent Streaming CTO Roundtable for Cloud-native Kafka Architectures
Event Streaming CTO Roundtable for Cloud-native Kafka ArchitecturesKai Wähner
 
Apache Flink, AWS Kinesis, Analytics
Apache Flink, AWS Kinesis, Analytics Apache Flink, AWS Kinesis, Analytics
Apache Flink, AWS Kinesis, Analytics Araf Karsh Hamid
 
Big Data Redis Mongodb Dynamodb Sharding
Big Data Redis Mongodb Dynamodb ShardingBig Data Redis Mongodb Dynamodb Sharding
Big Data Redis Mongodb Dynamodb ShardingAraf Karsh Hamid
 
Kafka Connect & Kafka Streams/KSQL - powerful ecosystem around Kafka core
Kafka Connect & Kafka Streams/KSQL - powerful ecosystem around Kafka coreKafka Connect & Kafka Streams/KSQL - powerful ecosystem around Kafka core
Kafka Connect & Kafka Streams/KSQL - powerful ecosystem around Kafka coreGuido Schmutz
 
DevNexus 2015: Kubernetes & Container Engine
DevNexus 2015: Kubernetes & Container EngineDevNexus 2015: Kubernetes & Container Engine
DevNexus 2015: Kubernetes & Container EngineKit Merker
 
Building hybrid cloud with cloudify (public)
Building hybrid cloud with cloudify (public)Building hybrid cloud with cloudify (public)
Building hybrid cloud with cloudify (public)Nati Shalom
 
Stay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolithStay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolithMarkus Eisele
 
Oracle Code Keynote with Thomas Kurian
Oracle Code Keynote with Thomas KurianOracle Code Keynote with Thomas Kurian
Oracle Code Keynote with Thomas KurianOracle Developers
 
Kafka summit apac session
Kafka summit apac sessionKafka summit apac session
Kafka summit apac sessionChristina Lin
 

Was ist angesagt? (20)

micro services architecture (FrosCon2014)
micro services architecture (FrosCon2014)micro services architecture (FrosCon2014)
micro services architecture (FrosCon2014)
 
Extending Windows Admin Center to manage your applications and infrastructure...
Extending Windows Admin Center to manage your applications and infrastructure...Extending Windows Admin Center to manage your applications and infrastructure...
Extending Windows Admin Center to manage your applications and infrastructure...
 
Powering Microservices with MongoDB, Docker, Kubernetes & Kafka – MongoDB Eur...
Powering Microservices with MongoDB, Docker, Kubernetes & Kafka – MongoDB Eur...Powering Microservices with MongoDB, Docker, Kubernetes & Kafka – MongoDB Eur...
Powering Microservices with MongoDB, Docker, Kubernetes & Kafka – MongoDB Eur...
 
Designing For Multicloud, CF Summit Frankfurt 2016
Designing For Multicloud, CF Summit Frankfurt 2016Designing For Multicloud, CF Summit Frankfurt 2016
Designing For Multicloud, CF Summit Frankfurt 2016
 
Microservices with Kafka Ecosystem
Microservices with Kafka EcosystemMicroservices with Kafka Ecosystem
Microservices with Kafka Ecosystem
 
Kafka Connect & Kafka Streams/KSQL - the ecosystem around Kafka
Kafka Connect & Kafka Streams/KSQL - the ecosystem around KafkaKafka Connect & Kafka Streams/KSQL - the ecosystem around Kafka
Kafka Connect & Kafka Streams/KSQL - the ecosystem around Kafka
 
Micro service architecture
Micro service architectureMicro service architecture
Micro service architecture
 
Cisco's MultiCloud Strategy
Cisco's MultiCloud StrategyCisco's MultiCloud Strategy
Cisco's MultiCloud Strategy
 
Resilient microservices with Kubernetes - Mete Atamel
Resilient microservices with Kubernetes - Mete AtamelResilient microservices with Kubernetes - Mete Atamel
Resilient microservices with Kubernetes - Mete Atamel
 
Event Streaming CTO Roundtable for Cloud-native Kafka Architectures
Event Streaming CTO Roundtable for Cloud-native Kafka ArchitecturesEvent Streaming CTO Roundtable for Cloud-native Kafka Architectures
Event Streaming CTO Roundtable for Cloud-native Kafka Architectures
 
Con3036 soaring-through-the-clouds-oow2016-160920214845
Con3036 soaring-through-the-clouds-oow2016-160920214845Con3036 soaring-through-the-clouds-oow2016-160920214845
Con3036 soaring-through-the-clouds-oow2016-160920214845
 
Apache Flink, AWS Kinesis, Analytics
Apache Flink, AWS Kinesis, Analytics Apache Flink, AWS Kinesis, Analytics
Apache Flink, AWS Kinesis, Analytics
 
Big Data Redis Mongodb Dynamodb Sharding
Big Data Redis Mongodb Dynamodb ShardingBig Data Redis Mongodb Dynamodb Sharding
Big Data Redis Mongodb Dynamodb Sharding
 
Kafka Connect & Kafka Streams/KSQL - powerful ecosystem around Kafka core
Kafka Connect & Kafka Streams/KSQL - powerful ecosystem around Kafka coreKafka Connect & Kafka Streams/KSQL - powerful ecosystem around Kafka core
Kafka Connect & Kafka Streams/KSQL - powerful ecosystem around Kafka core
 
DevNexus 2015: Kubernetes & Container Engine
DevNexus 2015: Kubernetes & Container EngineDevNexus 2015: Kubernetes & Container Engine
DevNexus 2015: Kubernetes & Container Engine
 
Building hybrid cloud with cloudify (public)
Building hybrid cloud with cloudify (public)Building hybrid cloud with cloudify (public)
Building hybrid cloud with cloudify (public)
 
Stay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolithStay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolith
 
Oracle Code Keynote with Thomas Kurian
Oracle Code Keynote with Thomas KurianOracle Code Keynote with Thomas Kurian
Oracle Code Keynote with Thomas Kurian
 
Kafka summit apac session
Kafka summit apac sessionKafka summit apac session
Kafka summit apac session
 
IBM Cloud Direct Link 2.0
IBM Cloud Direct Link 2.0IBM Cloud Direct Link 2.0
IBM Cloud Direct Link 2.0
 

Ähnlich wie Spring Into the Cloud

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, EgyptChris Richardson
 
Cloud Foundry Bootcamp
Cloud Foundry BootcampCloud Foundry Bootcamp
Cloud Foundry BootcampJoshua Long
 
CloudFest Denver When Worlds Collide: HTML5 Meets the Cloud
CloudFest Denver When Worlds Collide: HTML5 Meets the CloudCloudFest Denver When Worlds Collide: HTML5 Meets the Cloud
CloudFest Denver When Worlds Collide: HTML5 Meets the CloudDavid Pallmann
 
V fabricoverveiw telkom
V fabricoverveiw telkomV fabricoverveiw telkom
V fabricoverveiw telkomAbdul Zaelani
 
Leverage An Intelligent Application Infrastructure for Competitive Advantage.
Leverage An Intelligent Application Infrastructure for Competitive Advantage.Leverage An Intelligent Application Infrastructure for Competitive Advantage.
Leverage An Intelligent Application Infrastructure for Competitive Advantage.Eric D. Schabell
 
vFabric - Ideal Platform for SaaS Apps
vFabric - Ideal Platform for SaaS AppsvFabric - Ideal Platform for SaaS Apps
vFabric - Ideal Platform for SaaS AppsVMware vFabric
 
Keynote | Middleware Everywhere - Ready for Mobile and Cloud | Dr. Mark Little
Keynote | Middleware Everywhere - Ready for Mobile and Cloud | Dr. Mark LittleKeynote | Middleware Everywhere - Ready for Mobile and Cloud | Dr. Mark Little
Keynote | Middleware Everywhere - Ready for Mobile and Cloud | Dr. Mark LittleJAX London
 
Programatori cu capul in nori
Programatori cu capul in noriProgramatori cu capul in nori
Programatori cu capul in noriAlex Popescu
 
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 CloudMongoDB
 
VMware - Snapshot sessions - Deploy and manage tomorrow's applications today
VMware - Snapshot sessions  - Deploy and manage tomorrow's applications todayVMware - Snapshot sessions  - Deploy and manage tomorrow's applications today
VMware - Snapshot sessions - Deploy and manage tomorrow's applications todayAnnSteyaert_vmware
 
Inaugural address manjusha - Indicthreads cloud computing conference 2011
Inaugural address manjusha -  Indicthreads cloud computing conference 2011Inaugural address manjusha -  Indicthreads cloud computing conference 2011
Inaugural address manjusha - Indicthreads cloud computing conference 2011IndicThreads
 
.NET Cloud-Native Bootcamp- Los Angeles
.NET Cloud-Native Bootcamp- Los Angeles.NET Cloud-Native Bootcamp- Los Angeles
.NET Cloud-Native Bootcamp- Los AngelesVMware Tanzu
 
Nadeus Education Services session on Google Apps and Google App Engine
Nadeus Education Services session on Google Apps and Google App EngineNadeus Education Services session on Google Apps and Google App Engine
Nadeus Education Services session on Google Apps and Google App EngineNadeus Education Services
 
Jornada Desarrolladores: WAC: 'Wholesale Applications Community'
Jornada Desarrolladores: WAC: 'Wholesale Applications Community' Jornada Desarrolladores: WAC: 'Wholesale Applications Community'
Jornada Desarrolladores: WAC: 'Wholesale Applications Community' videos
 
The PaaS Landscape
The PaaS LandscapeThe PaaS Landscape
The PaaS LandscapeJim O'Neil
 
Cloud computingjun28
Cloud computingjun28Cloud computingjun28
Cloud computingjun28korusamol
 
0812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part2
0812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part20812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part2
0812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part2Raul Chong
 

Ähnlich wie Spring Into the Cloud (20)

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
 
Cloud Foundry Bootcamp
Cloud Foundry BootcampCloud Foundry Bootcamp
Cloud Foundry Bootcamp
 
CloudFest Denver When Worlds Collide: HTML5 Meets the Cloud
CloudFest Denver When Worlds Collide: HTML5 Meets the CloudCloudFest Denver When Worlds Collide: HTML5 Meets the Cloud
CloudFest Denver When Worlds Collide: HTML5 Meets the Cloud
 
Cloud computing
Cloud computingCloud computing
Cloud computing
 
Cloud computing
Cloud computingCloud computing
Cloud computing
 
V fabricoverveiw telkom
V fabricoverveiw telkomV fabricoverveiw telkom
V fabricoverveiw telkom
 
Leverage An Intelligent Application Infrastructure for Competitive Advantage.
Leverage An Intelligent Application Infrastructure for Competitive Advantage.Leverage An Intelligent Application Infrastructure for Competitive Advantage.
Leverage An Intelligent Application Infrastructure for Competitive Advantage.
 
vFabric - Ideal Platform for SaaS Apps
vFabric - Ideal Platform for SaaS AppsvFabric - Ideal Platform for SaaS Apps
vFabric - Ideal Platform for SaaS Apps
 
Keynote | Middleware Everywhere - Ready for Mobile and Cloud | Dr. Mark Little
Keynote | Middleware Everywhere - Ready for Mobile and Cloud | Dr. Mark LittleKeynote | Middleware Everywhere - Ready for Mobile and Cloud | Dr. Mark Little
Keynote | Middleware Everywhere - Ready for Mobile and Cloud | Dr. Mark Little
 
Programatori cu capul in nori
Programatori cu capul in noriProgramatori cu capul in nori
Programatori cu capul in nori
 
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
 
VMware - Snapshot sessions - Deploy and manage tomorrow's applications today
VMware - Snapshot sessions  - Deploy and manage tomorrow's applications todayVMware - Snapshot sessions  - Deploy and manage tomorrow's applications today
VMware - Snapshot sessions - Deploy and manage tomorrow's applications today
 
Inaugural address manjusha - Indicthreads cloud computing conference 2011
Inaugural address manjusha -  Indicthreads cloud computing conference 2011Inaugural address manjusha -  Indicthreads cloud computing conference 2011
Inaugural address manjusha - Indicthreads cloud computing conference 2011
 
.NET Cloud-Native Bootcamp- Los Angeles
.NET Cloud-Native Bootcamp- Los Angeles.NET Cloud-Native Bootcamp- Los Angeles
.NET Cloud-Native Bootcamp- Los Angeles
 
Nadeus Education Services session on Google Apps and Google App Engine
Nadeus Education Services session on Google Apps and Google App EngineNadeus Education Services session on Google Apps and Google App Engine
Nadeus Education Services session on Google Apps and Google App Engine
 
Jornada Desarrolladores: WAC: 'Wholesale Applications Community'
Jornada Desarrolladores: WAC: 'Wholesale Applications Community' Jornada Desarrolladores: WAC: 'Wholesale Applications Community'
Jornada Desarrolladores: WAC: 'Wholesale Applications Community'
 
The PaaS Landscape
The PaaS LandscapeThe PaaS Landscape
The PaaS Landscape
 
Cloud computingjun28
Cloud computingjun28Cloud computingjun28
Cloud computingjun28
 
Cloud computingjun28
Cloud computingjun28Cloud computingjun28
Cloud computingjun28
 
0812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part2
0812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part20812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part2
0812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part2
 

Kürzlich hochgeladen

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 

Kürzlich hochgeladen (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 

Spring Into the Cloud

  • 1. Spring into the Cloud Jennifer Hickey @jencompgeek jennifer.hickey@springsource.com
  • 2. About this session Spring and the Cloud: a match made in heaven
  • 3. About Jennifer •Long time SpringSource-er •Contributed to many Spring and SpringSource projects •Cloud Foundry Engineer •Focused on framework support 3
  • 4. Agenda •Why Cloud? Why PaaS? •Spring Framework for the Cloud •Data Developing NoSQL applications for the Cloud with Spring •Integration Cloud application integration with RabbitMQ and Spring •Wrap up 4
  • 5. Traditional web application architecture • Browser client • Monolithic WAR • RDBMS Desktop MySQL Apache WAR Browser Database Tomcat Simple to develop Simple to test Simple to deploy Simple to scale: just add Apache + more Tomcats 5
  • 6. New kinds of clients Smart phones overtake PCs in Q4 2010 6
  • 7. Users expect a rich, dynamic and interactive experience on mobile devices and desktop gh ou d en oo ’t g HTTP Request isn Desktop ct ure Java Web e Browser hit HTML/Javascript Application I arc ty le U Olds 7
  • 8. Users expect a rich, dynamic and interactive experience on mobile devices and desktop HTML5 WS Request Javascript Application XML/JSON response Web Services Mobile and Desktop Browser Web Socket/Eventing 8
  • 9. Popular social networks •Applications need to integrate with them •Application integration problem •Scaling graphs is challenging •Application go viral through social networks •Very rapid growth •Capacity planning nightmare 9
  • 10. Need scalable architectures to handle massive loads •Application tier •Replicated/clustered servers •Modular so that components can be scaled differently •Asynchronous architecture - communication via a message broker •Database tier •Replication •Sharding •Polyglot persistence: Relational, NoSQL, NewSQL databases 10
  • 11. Data Explosion: Data Volumes increasing at 60% per year Horizontally scalable, distributed NoSQL Databases 20 11 Eventual consistency rather than ACID
  • 12. Scaling development WAR Front End Scalable User Management != Search development Ordering • Forces multiple developers/teams to efforts synchronize development • Obstacle to frequent, independent deployments • Increases risk of failure - need to redeploy everything to change one thing 12
  • 13. Scaling development •Need “SOA” approach •Partition application into set of services •Partition by noun or by verb •manages their own release schedule. and Each team is responsible for a service •New code updates frequently •Mature services upgrade infrequently User User Management Management Front-end Search Search Front-End Ordering Ordering Front-End 13
  • 14. Modern application architecture User Management MySQL Tomcat Desktop Browser Native NodeJS Search NodeJS Mobile front-end front-end Application application application RabbitMQ Tomcat HTML5 Mongo mobile application Redis Ordering Tomcat 14
  • 15. Three layers of cloud computing SaaS PaaS Need to be here IaaS 15
  • 16. What you need is PaaS = Easy deployment Services: Application management Database + Blob storage Easy scaling up and down Messaging ... 16
  • 17. Cloud Foundry: Services, Frameworks and Clouds 17
  • 18. Agenda •Why Cloud? Why PaaS? •Spring Framework for the Cloud •Data Developing NoSQL applications for the Cloud with Spring •Integration Cloud application integration with RabbitMQ and Spring •Wrap up 18
  • 19. Spring’s aim: bring simplicity to java development data web tier batch integration & access & service tier mobile processing messaging / NoSQL / RIA Big Data The Spring framework the cloud: lightweight traditional CloudFoundry WebSphere tc Server Google App Engine JBoss AS Tomcat Amazon Web Services WebLogic Jetty Heroku (on legacy versions, too!) 19
  • 20. At its core, the Spring Framework... •developing enterprise Java™ applications Provides comprehensive infrastructural support for •Spring deals with the plumbing •So you can focus on solving the domain problem 20
  • 21. Spring 3.1 Environment Abstraction •Bean definitions for a specific environment (Profiles) •e.g. development, testing, production •Possibly different deployment environments •Activate profiles by name •spring.profiles.active system property •Other means outside deployment unit •“default” profile activates if no other profiles specified •Custom resolution of placeholders •Dependent on the actual environment •Ordered property sources 21
  • 22. Isolating Cloud Configuration <bean class="org.sf.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="dataSource" ref="dataSource"/> </bean> <beans profile="cloud"> <cloud:data-source id="dataSource" /> </beans> <beans profile="default"> <bean class="org.a.commons.dbcp.BasicDataSource" id="dataSource"> <property name="url" value="jdbc:mysql://localhost/my_db" /> </bean> </beans> 22
  • 23. Java Configuration with Profiles @Configuration @Profile(“local”) public class LocalDataSourceConfiguration { @Bean public javax.sql.DataSource dataSource() { ... } } @Configuration @Profile(“cloud”) public class CloudDataSourceConfiguration { @Bean public javax.sql.DataSource dataSource() { ... } } 23
  • 24. Agenda •Why Cloud? Why PaaS? •Spring Framework for the Cloud •Data Developing NoSQL applications for the Cloud with Spring •Integration Cloud application integration with RabbitMQ and Spring •Wrap up 24
  • 25. Data Access Challenge #1: Scale Horizontally 25
  • 26. Data Access Challenge #2: Heterogeneous data access needs 26
  • 27. NoSQL offers several data store categories Key-Value Column Document Graph Redis, Cassandra, MongoDB Neo4J Riak HBase 27
  • 28. NoSQL offers several data store categories Key-Value Column Document Graph MongoDB 28
  • 29. Spring Framework built-in data access support •Transaction abstractions •Common data access exception hierarchy •JDBC - JdbcTemplate •ORM - Hibernate, JPA support •OXM - Object to XML mapping •Serializer/Deserializer strategies (Spring 3.0) •Cache support (Spring 3.1) 29
  • 30. http://www.springsource.org/spring-data •Spring Data Key-value •Spring Data Document •Spring Data Graph •Spring Data Column •Spring Data Blob •Spring Data JPA Repository / JDBC Extensions •Spring Gemfire / Spring Hadoop ... •Grails iNcOnSeQuentiaL 30
  • 31. Spring Data Building Blocks •Low level data access APIs ✓MongoTemplate, RedisTemplate ... •Object Mapping (Java and GORM) •Cross Store Persistence Programming model •Generic Repository support •Productivity support in Roo and Grails 31
  • 33. Spring Data Document Mongo •MongoTemplate interface for mapping Mongo documents • MongoConverter •SimpleMongoConverter for basic POJO mapping support •Leverage Spring 3.0 TypeConverters and SpEL •Exception translation •Advanced Mapping •Annotation based (@Document, @Id, @DbRef) •MongoRepository for JPA Repositories •Built on Hades support 33
  • 35. Mongo Template Direct Usage of the Mongo Template: Insert into “Person” Collection findOne using query: { "name" : "Joe"} in db.collection: database.Person Dropped collection [database.person] 35
  • 36. Generic Repository Interface for generic CRUD operations on a repository for a specific type 36
  • 37. Paging and Sorting Repository Paging and Sorting Repository: Extends “CrudRepository” Usage: 37
  • 38. Custom Repository Custom Repository: Keywords : Keyword Sample Logical result GreaterThan findByAgeGreaterThan(int age) {"age" : {"$gt" : age}} LessThan findByAgeLessThan(int age) {"age" : {"$lt" : age}} Between findByAgeBetween(int from, int to) {"age" : {"$gt" : from, "$lt" : to}} NotNull findByFirstnameNotNull() {”firstname" : {"$ne" : null}} Null findByFirstnameNull() {”firstname" : null} Like findByFirstnameLike(String name) "firstname" : firstname} (regex) 38
  • 40. JPA and MongoDB JPA “Customer” with a “SurveyInfo” Document 40
  • 41. Using a Cross-Store Saving a Customer with a SurveryInfo Create Customer Create SurveyInfo Assign Survey to Customer Save Mongo Document: 41
  • 43. Agenda •Why Cloud? Why PaaS? •Spring Framework for the Cloud •Data Developing NoSQL applications for the Cloud with Spring •Integration Cloud application integration with RabbitMQ and Spring •Wrap up 43
  • 44. wgrus-monolithic.war @Controller StoreFront Widget Gadget Accounting Shipping InventoryService InventoryService Service Service RDBMS 44
  • 45. It’s simple to develop but .... •Lack of scalability •Scale through replication •Non-replicable component => nothing can be replicated •Can’t scale different parts of the application differently •Lack of deployability •Deploy it all in one go •Increased risk of something breaking •Applications are brittle •Store can’t accept orders unless all services are available •Failure (e.g. memory leak) in one component can take down every other •Monolingual •Can’t use non-JVM server-side technologies: NodeJS, Rails 45
  • 47. wgrus-billing.war Accounting Service wgrus-inventory.war wgrus-store.war Widget InventoryService Message StoreFront Broker MySQL wgrus-inventory.war Gadget InventoryService wgrus-shipping.war Shipping Service 47
  • 48. RabbitMQ – Messaging that Just Works Robust High-performance Easy to use AMQP LEADER
  • 49. Spring AMQP • Encapsulates low-level details Producer Consumer • Simplifies sending and receiving of messages Amqp Listener Template Container Spring AMQP AMQP
  • 50. Spring Integration • Builds on Spring framework • High-level of abstraction for building message based applications • Implements EAI patterns • Provides applicationfor exchanging messages between plumbing components • Promotes loosely coupled components • Integrates with JMS, AMQP, HTTP, Email, File infrastructure: external messaging transfer 50
  • 51. Spring Integration concepts •Message channel •Virtual pipe connecting producer and consumer •Message endpoints •The filter of a pipes-and-filter architecture •Read from and/or write to channel •Endpoint types •Transformer •Filter •Router •Splitter •Aggregator •ServiceActivator •Inbound channel adapter - read from external source, writes to channel •destinationchannel adapter - read from channel write to external Outbound 51
  • 52. Example of reconfigurability - local @Service public class OrderServiceImpl { @Service public class ShippingServiceImpl { @Autowired private ShippingService shippingService; public void shipOrder(String orderId) { System.out.println("shipped order: " + public void placeOrder() { orderId); String orderId = generateOrderId(); } … shippingService.shipOrder(orderId); } } } Order Shipping Service service Messaging Gateway Channel Service Activator 52
  • 53. Example of reconfigurability - distributed Code unchanged in new deployment Order Shipping Service service Messaging Gateway RabbitMQ Channel AMQP AMQP Channel Service Activator 53
  • 54. Using Spring Integration with the web store application 54
  • 55. wgrus-store.war wgrus-shipping.war StoreFront Shipping Service wgrus-billing.war wgrus-inventory.war Credit Service Spring Integration Logic Widget InventoryService Gadget InventoryService 55
  • 56. Store front flow StoreUI object to Message Endpoint orderChannel amqpOut AMQP JSON 56
  • 57. Inventory flow Json to credit check inventory inventory Object to AMQP inventory AMQP Object enricher encricher AMQP Out JSON inventory router credit check credit check Content Based service Router activator Credit Service widget gadget inventory inventory service service 57
  • 58. Shipping flow shipping service Json to AMQP shipping Service Object order Activator channel 58
  • 59. Demo WGRUS in the Cloud 59
  • 60. Agenda •Why Cloud? Why PaaS? •Spring Framework for the Cloud •Data Developing NoSQL applications for the Cloud with Spring •Integration Cloud application integration with RabbitMQ and Spring •Wrap up 60
  • 61. Summary •Cloud? Good. •Spring? Good. •Spring and the Cloud is a match made in heaven 61
  • 62. Where to Find More •http://bit.ly/spring-data Spring Data Project: •http://www.springsource.org/spring-integration Spring Integration Project: •https://github.com/jencompgeek/cloudfoundry-samples/tree/master/cross- Mongo Cross Store Sample: store •https://github.com/markfisher/springone-wgrus WGRUS Sample: •http://bit.ly/cloudfoundry-samples CloudFoundry Samples: • Sign up for (free) Cloud Foundry http://www.cloudfoundry.com •http://bit.ly/mcf4spring for Spring Developers MicroCloud Foundry •Cloud Foundry and Spring YouTube Channels 62