Distributed Platform Development with Groovy
description
Transcript of Distributed Platform Development with Groovy
![Page 1: Distributed Platform Development with Groovy](https://reader036.fdocuments.net/reader036/viewer/2022081401/557d5f41d8b42aba3d8b4f24/html5/thumbnails/1.jpg)
© 2014 SpringOne 2GX. All rights reserved. Do not distribute without permission.
Distributed Platform Development with Groovy
By Dan Woods
![Page 3: Distributed Platform Development with Groovy](https://reader036.fdocuments.net/reader036/viewer/2022081401/557d5f41d8b42aba3d8b4f24/html5/thumbnails/3.jpg)
Intro
3
What is a Platform?
![Page 4: Distributed Platform Development with Groovy](https://reader036.fdocuments.net/reader036/viewer/2022081401/557d5f41d8b42aba3d8b4f24/html5/thumbnails/4.jpg)
Intro
4
What is a Platform?
“A broad set of functionality structured in a
common way that exposes one or many
business functions”
![Page 5: Distributed Platform Development with Groovy](https://reader036.fdocuments.net/reader036/viewer/2022081401/557d5f41d8b42aba3d8b4f24/html5/thumbnails/5.jpg)
Intro
5
What is a Platform?
• A pattern of architecting a “system”
• System is designed to expand and contract as business
needs evolve
![Page 6: Distributed Platform Development with Groovy](https://reader036.fdocuments.net/reader036/viewer/2022081401/557d5f41d8b42aba3d8b4f24/html5/thumbnails/6.jpg)
Intro
6
Distributed Computing & Data
Encapsulation
• Platform service components run in their own process
and memory space
• Services are responsible for their own business logic and
data processing rules
![Page 7: Distributed Platform Development with Groovy](https://reader036.fdocuments.net/reader036/viewer/2022081401/557d5f41d8b42aba3d8b4f24/html5/thumbnails/7.jpg)
Intro
7
Platform as a Service
• Vertically sliced by business function
• Platform-oriented architecture means services are
composable
• Pick-and-choose services as they relate to some
business functionality
![Page 8: Distributed Platform Development with Groovy](https://reader036.fdocuments.net/reader036/viewer/2022081401/557d5f41d8b42aba3d8b4f24/html5/thumbnails/8.jpg)
Intro
8
Why is Platform Architecture
Important?
![Page 9: Distributed Platform Development with Groovy](https://reader036.fdocuments.net/reader036/viewer/2022081401/557d5f41d8b42aba3d8b4f24/html5/thumbnails/9.jpg)
Intro
9
Why is Platform Architecture
Important?
• Enforces modularity of concepts, not just code
• Easy to get a grasp on the “system” and its capabilities
• Allows functionality to scale as complexity grows
• “True” vertical slices
![Page 10: Distributed Platform Development with Groovy](https://reader036.fdocuments.net/reader036/viewer/2022081401/557d5f41d8b42aba3d8b4f24/html5/thumbnails/10.jpg)
Intro
10
Microservice Architecture
• Microservices are great, but don’t speak directly to
Platform Architecture
• Platform Microservices are designed as atomic subsets
of capabilities in the platform
• A collection of microservices comprise a vertical slice of
a system’s business function (encapsulating their own
data domains)
![Page 11: Distributed Platform Development with Groovy](https://reader036.fdocuments.net/reader036/viewer/2022081401/557d5f41d8b42aba3d8b4f24/html5/thumbnails/11.jpg)
11
Why Choose Groovy for
Platform Development?
![Page 12: Distributed Platform Development with Groovy](https://reader036.fdocuments.net/reader036/viewer/2022081401/557d5f41d8b42aba3d8b4f24/html5/thumbnails/12.jpg)
Why Choose Groovy?
12
Groovy Has Come A Long Way…
• Since Groovy 2.0.0 – Static Compilation!
• Since Groovy 2.0.0 – Type Checking!
• Groovy’s Indy support in Java 7 gives near-static-
compilation performance, while still maintaining the
dynamic nature
• Pick-and-choose your compilation strategy
![Page 13: Distributed Platform Development with Groovy](https://reader036.fdocuments.net/reader036/viewer/2022081401/557d5f41d8b42aba3d8b4f24/html5/thumbnails/13.jpg)
Why Choose Groovy?
13
Important note on Indy support…
http://blog.freeside.co/2014/06/24/enabling-groovys-invokedynamic-support-in-gradle/
![Page 14: Distributed Platform Development with Groovy](https://reader036.fdocuments.net/reader036/viewer/2022081401/557d5f41d8b42aba3d8b4f24/html5/thumbnails/14.jpg)
Why Choose Groovy?
14
Groovy Beans are Superior!
• In microservice architecture, components encapsulate
their data, and inherently the model
• Groovy beans cut the verbosity, and get right at the
model of the data
• Rich models are easily built into Groovy beans,
especially when considering the MetaClass
![Page 15: Distributed Platform Development with Groovy](https://reader036.fdocuments.net/reader036/viewer/2022081401/557d5f41d8b42aba3d8b4f24/html5/thumbnails/15.jpg)
Why Choose Groovy?
15
Great Out-of-the-Box Support for
Microservices
• Groovy SQL is a great foundation for data encapsulation
• Groovy String/URL extensions make REST calls a
breeze
• The world’s fastest JSON parser!
![Page 16: Distributed Platform Development with Groovy](https://reader036.fdocuments.net/reader036/viewer/2022081401/557d5f41d8b42aba3d8b4f24/html5/thumbnails/16.jpg)
Why Choose Groovy?
16
Groovy Extensions
• Groovy’s extension framework allows compile-time
analysis driven by business/technical rules
• Annotation collectors can roll-up static compilation, as
well as common service-layer annotations (JAX-RS, for
example)
![Page 17: Distributed Platform Development with Groovy](https://reader036.fdocuments.net/reader036/viewer/2022081401/557d5f41d8b42aba3d8b4f24/html5/thumbnails/17.jpg)
17
Debunking Groovy Performance
Myths
![Page 18: Distributed Platform Development with Groovy](https://reader036.fdocuments.net/reader036/viewer/2022081401/557d5f41d8b42aba3d8b4f24/html5/thumbnails/18.jpg)
#debunk
18
Ratpack Benchmarks
• Ratpack utilizes full Java APIs in the core – no cost to its
Groovy integration
49,000 49,500 50,000 50,500 51,000 51,500 52,000 52,500
Dynamic Groovy
Indy Groovy
Statically Compiled Groovy
Java 8
Requests/sec
https://github.com/Netflix-Skunkworks/WSPerfLab
![Page 19: Distributed Platform Development with Groovy](https://reader036.fdocuments.net/reader036/viewer/2022081401/557d5f41d8b42aba3d8b4f24/html5/thumbnails/19.jpg)
19
Platform Tools in the Groovy
Ecosystem
![Page 20: Distributed Platform Development with Groovy](https://reader036.fdocuments.net/reader036/viewer/2022081401/557d5f41d8b42aba3d8b4f24/html5/thumbnails/20.jpg)
20
Grails
• Groovy-first web framework; full-stack defined
• Run in either container or in a stand-alone fashion
• Abstractions on data encapsulation (GORM)
• Extremely advanced REST support
#platformtools
![Page 21: Distributed Platform Development with Groovy](https://reader036.fdocuments.net/reader036/viewer/2022081401/557d5f41d8b42aba3d8b4f24/html5/thumbnails/21.jpg)
21
#platformtools
Spring Boot
• Opinionated framework for Spring
• Builds on all of the new Spring hotness, including
conditional wirings, and advanced data bindings
• Advanced REST support, enables edge slicing
• Cloud-native, preferable to run in an embedded container
![Page 22: Distributed Platform Development with Groovy](https://reader036.fdocuments.net/reader036/viewer/2022081401/557d5f41d8b42aba3d8b4f24/html5/thumbnails/22.jpg)
22
#platformtools
Ratpack
• JVM web framework, designed for high-throughput, non-
blocking request system
• First class support for Groovy, seamless static
compilation
• Seamless Groovy Sql integration (through the
SqlModule)
• Excellent choice for developing a microservice
![Page 23: Distributed Platform Development with Groovy](https://reader036.fdocuments.net/reader036/viewer/2022081401/557d5f41d8b42aba3d8b4f24/html5/thumbnails/23.jpg)
23
#platformtools
Vert.x
• Vertical slicing of applications, fits very well in the
Platform Architecture concept
• Extremely high throughput
• Asynchronous, event-driven architecture model
• Packaged and run as a fat jar
![Page 24: Distributed Platform Development with Groovy](https://reader036.fdocuments.net/reader036/viewer/2022081401/557d5f41d8b42aba3d8b4f24/html5/thumbnails/24.jpg)
24
To Summarize…
![Page 25: Distributed Platform Development with Groovy](https://reader036.fdocuments.net/reader036/viewer/2022081401/557d5f41d8b42aba3d8b4f24/html5/thumbnails/25.jpg)
25
#summary
Summary
• Platform architecture is important for scaling systems as
business complexity grows
• Platform verticals are defined by business functions
• Microservices can be built to compose the business
functions
• Groovy provides a rich ecosystem for developing a
distributed platform architecture