Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Spring Boot @ PayPal
Fabio Carvalho and Eduardo Solis
2
Java at PayPal in numbers
3
329
Applications
50
Batch
247
Services
32
Message
Daemons
5.1B
Calls/day
1149
Engineers
develo...
Agenda
4
• History of architecture and Java at PayPal
• Developer needs at PayPal
• The Raptor framework
• Raptor and Spri...
A timeline for Java at PayPal
5
C++
Monolith
2004
C++
Breakout
2007
First Java
frameworks
2008
Modern
Java
development
201...
The PayPal developer challenge
The average PayPal developer has to deliver
• Agile Innovation under extreme tight deadline...
PayPal frameworks to the rescue!!!
7
• Frameworks provide built in support for the concerns that developers deal with
• Th...
Introducing Raptor, a modern Java Framework
8
• Initiative to create a single framework for Java middleware
• Adoption of ...
Raptor design principles
9
• Standards based and open source core
• JSR-330 (@Inject)
• JSR-339 (JAX-RS)
• JSR-303 (Bean V...
Raptor design principles
10
• Dependency injection to produce and weave functionality
@Inject @Endpoint(svc=“myservice”)
W...
Raptor principles
11
• ”A la carte” functionality based on composition of different components (“profiles”)
<dependency>
<...
Success!!!! But…
12
• Although the first Raptor version was an overall success, its adoption
revealed a couple issues:
• T...
So, why should we change, if…
• The current solution is still functional
• It is cheaper in the short term to keep the cur...
Similarities between Raptor and Spring Boot
• Parent project and BOM
• Starters vs Profiles
• Metrics and monitoring
14
Reasons to use Spring Boot
• Because Spring Boot is great!!!
15
More reasons to use Spring Boot
• Lighter container designed and optimized to contain one application only
• Simplified de...
A few rocks on the way
• No RESTEasy Spring Boot starter?
• Servlet container customization
• Initialization order has bee...
No RESTEasy Spring Boot starter?
18
…which JAX-RS implementation should we use?
We want to be JAX-RS based, but…
A few rocks on the way
• No RESTEasy Spring Boot starter?
• Servlet container customization
• Initialization order has bee...
Servlet container customization
20
A few rocks on the way
• No RESTEasy Spring Boot starter?
• Servlet container customization
• Initialization order has bee...
Tomcat
Initialization order has been reversed
22
…so, who is the container now?
Raptor
Spring
App
Spring
Raptor
Tomcat
App
A few rocks on the way
• No RESTEasy Spring Boot starter?
• Servlet container customization
• Initialization order has bee...
Servlet container configuration
24
Servlet container configuration
25
A few rocks on the way
• No RESTEasy Spring Boot starter?
• Servlet container customization
• Initialization order has bee...
A few rocks on the way
• No RESTEasy Spring Boot starter?
• Servlet container customization
• Initialization order has bee...
A few rocks on the way
• No RESTEasy Spring Boot starter?
• Servlet container customization
• Initialization order has bee...
A few rocks on the way
• No RESTEasy Spring Boot starter?
• Servlet container customization
• Initialization order has bee...
A few rocks on the way
• No RESTEasy Spring Boot starter?
• Servlet container customization
• Initialization order has bee...
Results in a few numbers
• Raptor on Spring Boot released on April, 2016
• Total of over 300 Raptor apps, over 100 already...
32
Raptor starters
RESTEasy Spring Boot starter
• Enables RESTEasy for Spring Boot applications
• Supports JAX-RS providers, resources and su...
34
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
import org.springframework.stereotype.Componen...
The future
35
• Raptor “Lite”
• Transition to Spring Boot Ops, Monitoring and Health check features
• Explore and probably...
36
Q&A
Learn More. Stay Connected.
facarvalho@paypal.com
esolis@paypal.com
https://github.com/paypal
https://github.com/paypal/re...
Upcoming SlideShare
Loading in …5
×

Spring Boot @ PayPal

5,532 views

Published on

SpringOne Platform 2016
Speaker: Fabio Carvalho; Sr. Software Engineer, PayPal. Eduardo Solis; MTS Software Engineer, PayPal.

Although PayPal has been using Spring in production for many years, as part of a goal to move towards micro-services, PayPal recently introduced Spring Boot to its Java framework (known as “Raptor”), which includes RESTful services, Batch and Message Daemon applications. Besides Spring Boot, other Spring projects are used, such as Spring framework, Spring Batch and Spring Integration.

PayPal Java RESTful framework provides a microservices architecture and deployment model, relying on a PaaS infrastructure on the cloud, CI, Docker, embedded container and Spring Boot. Additionally, many Spring Boot starters, and Spring based features, were developed to achieve PayPal needs.

A few examples are:

1. A REST client abstraction and DI mechanism
2. Central application logging (abstracting URIs and supporting sub-resources when logging traffic to RESTful endpoints)
3. Application logging to asynchronous activity in Spring Integration channels (for messaging applications)
4. A few Spring Boot starters for automatic initialization and configuration of “opinionated” PayPal components
5. RESTEasy Spring Boot starter

Regarding REST services, RESTEasy is the JAX-RS choice for PayPal. Although there is one Spring Boot starter for Jersey, and one for Spring REST, there was none for RESTEasy. Because of that PayPal also created, and open sourced, a RESTEasy Spring Boot starter.

Published in: Technology
  • Be the first to comment

Spring Boot @ PayPal

  1. 1. Spring Boot @ PayPal Fabio Carvalho and Eduardo Solis
  2. 2. 2
  3. 3. Java at PayPal in numbers 3 329 Applications 50 Batch 247 Services 32 Message Daemons 5.1B Calls/day 1149 Engineers developing
  4. 4. Agenda 4 • History of architecture and Java at PayPal • Developer needs at PayPal • The Raptor framework • Raptor and Spring Boot • Adopting Spring Boot • RESTEasy Spring Boot starter • The future • Q&A
  5. 5. A timeline for Java at PayPal 5 C++ Monolith 2004 C++ Breakout 2007 First Java frameworks 2008 Modern Java development 2014 Microservices 2016 Single, monolithic CGI application made up PayPal Monolith broken into services, SOA is adopted with the use of a proprietary protocol Java is introduced at PayPal. Two frameworks were created one for presentation (Spring MVC) and one for backend services (proprietary) Early Java frameworks deprecated. A modern framework for backend services is introduced Microservice, PaaS, docker, remote config, service discovery, resiliency, etc.
  6. 6. The PayPal developer challenge The average PayPal developer has to deliver • Agile Innovation under extreme tight deadlines • High quality (bugs are very expensive) • Security • Compliance (DSS, PCI, etc.) • Maintainability of applications at scale (upgrade, patches, etc.) • Backwards compatibility to APIs • Great performance • Scalability • Resiliency • Business visibility (KPI) • Operational visibility for monitoring and alerting at scale
  7. 7. PayPal frameworks to the rescue!!! 7 • Frameworks provide built in support for the concerns that developers deal with • They are instrumented to have high visibility into what is going on • They provide common patterns for developers to write code • Make life easier (most of the time)
  8. 8. Introducing Raptor, a modern Java Framework 8 • Initiative to create a single framework for Java middleware • Adoption of modern design principles • Cloud and DevOps model for deployment and maintenance
  9. 9. Raptor design principles 9 • Standards based and open source core • JSR-330 (@Inject) • JSR-339 (JAX-RS) • JSR-303 (Bean Validation) • JPA • … API Implementation • Component driven design for PayPal components
  10. 10. Raptor design principles 10 • Dependency injection to produce and weave functionality @Inject @Endpoint(svc=“myservice”) WebTarget baseTarget; • Pluggability for customers so they can extend or change the behavior of framework provided components • Zero XML configuration but still allow XML for users that want to use it
  11. 11. Raptor principles 11 • ”A la carte” functionality based on composition of different components (“profiles”) <dependency> <groupId>com.paypal.api.platform</groupId> <artifactId>rest-profile-ppaas</artifactId> <type>pom</type> </dependency> • Profiles require minimal or no configuration to bring a feature into the application
  12. 12. Success!!!! But… 12 • Although the first Raptor version was an overall success, its adoption revealed a couple issues: • The framework was based on Tomcat with Spring so other ”flavors” of application had to carry the weight of a tomcat server • WAR was the only packaging mechanism even if the app had nothing to do with the web/http (messaging) • While our profiles were a great way to shrink and grow the functionality of the application there were cases where more granularity of features was needed
  13. 13. So, why should we change, if… • The current solution is still functional • It is cheaper in the short term to keep the current solution • It is less risky in the short term to keep the current solution • All Ops engineers and tools are already used and adapted to the current solution 13
  14. 14. Similarities between Raptor and Spring Boot • Parent project and BOM • Starters vs Profiles • Metrics and monitoring 14
  15. 15. Reasons to use Spring Boot • Because Spring Boot is great!!! 15
  16. 16. More reasons to use Spring Boot • Lighter container designed and optimized to contain one application only • Simplified deployment architecture • Great Improvement in development experience • Operation simplicity, reducing maintenance and cost • Aligns with our Spring based portfolio • Aligns with our goal towards micro-services, docker and hybrid cloud 16
  17. 17. A few rocks on the way • No RESTEasy Spring Boot starter? • Servlet container customization • Initialization order has been reversed • Servlet container configuration • Skinny jar approach (instead of a fat one) • JMX conflict • Nanny process, graceful and proper shutdown • Logging • Upgrading 17
  18. 18. No RESTEasy Spring Boot starter? 18 …which JAX-RS implementation should we use? We want to be JAX-RS based, but…
  19. 19. A few rocks on the way • No RESTEasy Spring Boot starter? • Servlet container customization • Initialization order has been reversed • Servlet container configuration • Skinny jar approach (instead of a fat one) • JMX conflict • Nanny process, graceful and proper shutdown • Logging • Upgrading 19
  20. 20. Servlet container customization 20
  21. 21. A few rocks on the way • No RESTEasy Spring Boot starter? • Servlet container customization • Initialization order has been reversed • Servlet container configuration • Skinny jar approach (instead of a fat one) • JMX conflict • Nanny process, graceful and proper shutdown • Logging • Upgrading 21
  22. 22. Tomcat Initialization order has been reversed 22 …so, who is the container now? Raptor Spring App Spring Raptor Tomcat App
  23. 23. A few rocks on the way • No RESTEasy Spring Boot starter? • Servlet container customization • Initialization order has been reversed • Servlet container configuration • Skinny jar approach (instead of a fat one) • JMX conflict • Nanny process, graceful and proper shutdown • Logging • Upgrading 23
  24. 24. Servlet container configuration 24
  25. 25. Servlet container configuration 25
  26. 26. A few rocks on the way • No RESTEasy Spring Boot starter? • Servlet container customization • Initialization order has been reversed • Servlet container configuration • Skinny jar approach (instead of a fat one) • JMX conflict • Nanny process, graceful and proper shutdown • Logging • Upgrading 26
  27. 27. A few rocks on the way • No RESTEasy Spring Boot starter? • Servlet container customization • Initialization order has been reversed • Servlet container configuration • Skinny jar approach (instead of a fat one) • JMX conflict • Nanny process, graceful and proper shutdown • Logging • Upgrading 27
  28. 28. A few rocks on the way • No RESTEasy Spring Boot starter? • Servlet container customization • Initialization order has been reversed • Servlet container configuration • Skinny jar approach (instead of a fat one) • JMX conflict • Nanny process, graceful and proper shutdown • Logging • Upgrading 28
  29. 29. A few rocks on the way • No RESTEasy Spring Boot starter? • Servlet container customization • Initialization order has been reversed • Servlet container configuration • Skinny jar approach (instead of a fat one) • JMX conflict • Nanny process, graceful and proper shutdown • Logging • Upgrading 29
  30. 30. A few rocks on the way • No RESTEasy Spring Boot starter? • Servlet container customization • Initialization order has been reversed • Servlet container configuration • Skinny jar approach (instead of a fat one) • JMX conflict • Nanny process, graceful and proper shutdown • Logging • Upgrading 30
  31. 31. Results in a few numbers • Raptor on Spring Boot released on April, 2016 • Total of over 300 Raptor apps, over 100 already on Raptor on Spring Boot • 200 million calls per day on Raptor on Spring Boot only (4.2 billion total) • Over 1100 Raptor developers, and many of them are much happier now!! 31
  32. 32. 32 Raptor starters
  33. 33. RESTEasy Spring Boot starter • Enables RESTEasy for Spring Boot applications • Supports JAX-RS providers, resources and sub-resources as Spring beans • Supports automatic discovery and registration of multiple JAX-RS Application classes as Spring beans • Supports optional registration of JAX-RS Application classes via class-path scanning, or manually, via configuration properties • Leverages and supports RESTEasy configuration 33
  34. 34. 34 import javax.ws.rs.ApplicationPath; import javax.ws.rs.core.Application; import org.springframework.stereotype.Component; @Component @ApplicationPath("/v1/myapi/") public class ApplicationConfig extends Application{ } https://github.com/paypal/resteasy-spring-boot
  35. 35. The future 35 • Raptor “Lite” • Transition to Spring Boot Ops, Monitoring and Health check features • Explore and probably introduce – Spring Boot remote shell – Spring Boot DevTools – Spring Boot Groovy DSL – Client side load balancing • Evaluate – Undertow (embedded container) – Spring Reactor and other alternatives to servlet model – Spring Cloud configuration service API (and annotations) – Service discovery – Experiment with protocols gRPC, Aeron, AMQP
  36. 36. 36 Q&A
  37. 37. Learn More. Stay Connected. facarvalho@paypal.com esolis@paypal.com https://github.com/paypal https://github.com/paypal/resteasy-spring-boot/ @springcentral spring.io/blog @pivotal pivotal.io/blog @pivotalcf http://engineering.pivotal.io

×