Distributed Platform Development with Groovy
description
Transcript of Distributed Platform Development with Groovy
© 2014 SpringOne 2GX. All rights reserved. Do not distribute without permission.
Distributed Platform Development with Groovy
By Dan Woods
Intro
3
What is a Platform?
Intro
4
What is a Platform?
“A broad set of functionality structured in a
common way that exposes one or many
business functions”
Intro
5
What is a Platform?
• A pattern of architecting a “system”
• System is designed to expand and contract as business
needs evolve
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
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
Intro
8
Why is Platform Architecture
Important?
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
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)
11
Why Choose Groovy for
Platform Development?
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
Why Choose Groovy?
13
Important note on Indy support…
http://blog.freeside.co/2014/06/24/enabling-groovys-invokedynamic-support-in-gradle/
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
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!
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)
17
Debunking Groovy Performance
Myths
#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
19
Platform Tools in the Groovy
Ecosystem
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
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
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
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
24
To Summarize…
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