Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building "Bootiful" Microservices with Spring Boot

Josh Long
September 18, 2014

Building "Bootiful" Microservices with Spring Boot

Microservices? A thing? Or hype? What does it mean in practice? The answer, like so many Facebook statuses, is complicated. In broad strokes, Microservices offer a refreshed approach to application architecture. Microservices are a new way to describe many of the patterns that have fallen out of large-scale applications in practice over the recent years. There is no doubt that the approach works. The question is: how does one build a microservices architecture? Join Josh Long for this webinar introducing the Spring Cloud project to support building cloud-scale and cloud-ready microservices. Spring Cloud builds on Spring Boot and makes building complex distributed systems and and microservices a snap.

Josh Long

September 18, 2014
Tweet

More Decks by Josh Long

Other Decks in Technology

Transcript

  1. Josh Long (⻰龙之春)
    @starbuxman
    [email protected]
    github.com/joshlong
    “ BOOTIFUL”

    MICROSERVICES 

    WITH
    SPRING BOOT
    Spencer Gibb @spencerbgibb
    Dr. Dave Syer @david_syer
    Oliver Gierke @olivergierke
    Phillip Webb @phillip_webb
    with help from:

    View Slide

  2. View Slide

  3. Micro vs Monolithic… is not a new discussion
    From: [email protected] (Ken Thompson)
    Subject: Re: LINUX is obsolete
    Date: 3 Feb 92 23:07:54 GMT
    Organization: Georgia Institute of Technology
    I would generally agree that microkernels are probably the wave of
    the future. However, it is in my opinion easier to implement a
    monolithic kernel. It is also easier for it to turn into a mess in
    a hurry as it is modified.
    Regards,
    Ken

    View Slide

  4. …Didn’t the Monolith win?
    Wait a Minute…

    View Slide

  5. What’s Wrong with a Monolithic Application?
    (does your monolith drive you to drink?)

    View Slide

  6. A More Elegant Alternative

    View Slide

  7. How Much More Micro Do You Go??
    import org.springframework.boot.SpringApplication;
    import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
    import org.springframework.context.annotation.Configuration;
    import org.springframework.web.bind.annotation.*
    !
    // assumes org.springframework.boot:spring-boot-starter-web on CLASSPATH
    @Configuration
    @RestController
    @EnableAutoConfiguration
    public class GreetingsController {
    !
    @RequestMapping("/hi/{name}")
    String hello(@PathVariable String name) {
    return "Hello, " + name + "!";
    }
    !
    public static void main(String[] args) {
    SpringApplication.run(GreetingsController.class, args);
    }
    }

    View Slide

  8. Standing on the Shoulders of
    Spring &

    View Slide

  9. W H Y B O O T

    View Slide

  10. C O N F I G - S E RV E R

    View Slide

  11. R E F R E S H - A B L E
    C O N F I G U R AT I O N

    View Slide

  12. S E RV I C E R E G I S T R AT I O N
    & D I S C O V E RY
    W I T H E U R E K A
    http://techblog.netflix.com/2012/09/eureka.html

    View Slide

  13. M A N A G I N G
    FA I L U R E S W I T H
    H Y S T R I X
    http://techblog.netflix.com/2012/11/hystrix.html

    View Slide

  14. D Y N A M I C R O U T I N G
    W I T H Z U U L
    http://techblog.netflix.com/2012/11/hystrix.html

    View Slide

  15. The Impact of the Cloud &
    § Spring Boot makes it dead simple to stand up services.

    (Where do they live? Who runs them?)
    § Things get Distributed REALLY quickly! CF provides a way to simplify
    !
    !
    § Manifests are are the ultimate installer. 

    (cf push an entire distributed system!)
    !
    § Spring Cloud PaaS connectors simplify service-consumption
    > cf push hystrix.jar
    > cf push …

    View Slide

  16. Spring Integration and Spring XD
    § Both make it easy to setup alternative-protocol endpoints
    !
    § Spring Integration can even handle orchestration and messaging
    !
    § Spring XD makes it super-simple to build big-data pipelines

    View Slide

  17. Spring Security and Spring Security OAuth
    § Spring Security OAuth is a natural way to build REST-centric services with
    federated identity
    !
    § Whatever else you want, Spring Security provides a solution
    !
    § Spring Session is a turnkey session binding that lets you plugin alternative HTTP
    session implementations. Can be valuable in scaling out your access-tokens or
    other ephemeral security state.

    View Slide

  18. Bookmark..
    § Former Netflix DevOps Guru Adrian Cockroft on DevOps + MS

    http://www.infoq.com/interviews/adrian-cockcroft-microservices-devops
    § Bootiful Applications with Spring Boot

    http://http://www.youtube.com/watch?v=eCos5VTtZoI
    § Chris Richardson’s http://microservices.io site and his 

    Decomposing Applications for Scalability talks
    § The Netflix Techblog http://techblog.netflix.com
    § Fred Georges on Programmer Anarchy 

    http://www.infoq.com/news/2012/02/programmer-anarchy
    § Matt Stine’s CF + Microservices: a Mutualistic Symbiotic Relationship 

    http://www.youtube.com/watch?v=RGZefc92tZs
    § Martin Fowler’s article - http://martinfowler.com/articles/microservices.html

    View Slide

  19. Josh Long (⻰龙之春)
    @starbuxman
    @springcentral
    [email protected]
    github.com/joshlong
    References
    spring.io/guides
    github.com/spring-cloud/
    github.com/spring-cloud-samples/
    github.com/joshlong/spring-doge
    github.com/joshlong/spring-doge-microservice
    docs.spring.io/spring-boot/
    Questions?

    View Slide