2. Mikrodienste: Patrone and Anti-Patrone
Argitektuele Patrone and Anti-patrone om in ag te
neem met die onwerp van Mikrodienste en die
gebruik van Spring Boot en Spring Cloud.
Corneil du Plessis
3. Microservices: Patterns and Anti-Patterns
Architectural Patterns and Anti-patterns to
consider with Microservices,
and using Spring Boot and Spring Cloud to build
Microservices
Corneil du Plessis
4. Introduction
â Programmer since 1985
â Smallest to very large systems.
â Cobol, Pascal, Algol, C/C++, Java, Scala, Groovy and
other JVM languages.
â Scientific instrumentation, Sports event management,
Mining, Banking, Treasury and Insurance.
â Software Architect (coding included)
12. Pattern: Immutable service
â Created by build process.
â Managed in Binary repository
â Deployed / Launched as a unit
â Simple externalised configuration
20. Service calls
â Synchronous
â JSON or XML over Rest / HTTP
â SOAP over HTTP
â Asynchronous
â SOAP over Message Queue
â XML or JSON over Message Queue
23. Size of Microservices
â Questions
â How big is a Microservice?
â What about data?
â Best practice
â Start with a single application
â Only split when it will benefit runtime or development.
â Don't split prematurely
24. Microservices with Spring
â What is Spring?
â The Spring Framework is aimed at improving developer
productivity by providing best-practice patterns for
implementing Dependency Injection, Transaction
Management, Data-Access Messaging, Aspect-
Oriented-Programming and more...
â Projects that support Microservices
â Spring Boot
â Spring Cloud
25. Spring Boot
â Opinionated auto configuration
â Simple configuration
â Single package
â A long list of starters
26. Spring Cloud
â Abstraction of many cloud native tools / services
â Distributed/versioned configuration
â Service registration and discovery
â Routing
â Service-to-service calls
â Load balancing
â Circuit Breakers
â Global locks
â Leadership election and cluster state
â Distributed messaging
27. Spring Cloud Projects
â Spring Cloud Config
â Centralised config server backed by git
â Spring Cloud Netflix
â Netflix OSS projects
â Eureka, Hystrix, Zuul, Archais
â Spring Cloud Bus
â State and Configuration changes over AMQP
28. Spring Cloud Projects
â Spring Cloud for Cloud Foundry
â Cloud Foundry
â Service Discover
â Security
â Service Broker Foundation
â Spring Cloud Cluster
â Leadership election and common stateful patterns with
an abstraction and implementation for Zookeeper,
Redis, Hazelcast, Consul
29. Spring Cloud Projects
â Spring Cloud Consul
â Service Discovery
â Configuration Management
â Spring Cloud Security
â OAuth2
â Common Patterns for SSO
â Token Relay and Token Exchange
30. Spring Cloud Projects
â Spring Cloud Contract
â Consumer driven contracts
â Contract Verification
â Contract Definition Language (DSL)
â Stubs and Tests
â Spring Cloud Sleuth
â Distributed Tracing
â Zipkin, HTrace
â Log based like ELK
31. Spring Cloud Projects
â Spring Cloud Data Flow
â Redesign of Spring XD
â Orchestrate across Cloud Foundry, Yarn, Mesos,
Kubernetes
â Stream and Batch
â Develop using DSL, Shell, REST APIs, Dashboard or
Flo
â Manage and scale without interruption
32. Spring Cloud Projects
â Spring Cloud Stream
â Messaging with Kafka, Redis or Rabbit
â Binder Abstraction
â Persistent Publish and Subscribe
â Consumer Groups
â Durability
33. Spring Cloud Projects
â Spring Cloud Stream Modules
â Spring Boot based Spring Integration applications
â Compose with Spring Data Flow
â Source â file, ftp, http, jdbc, jms, rabbit and more
â Sink â file, ftp, cassandra, redis, websocket, hdfs
â Processor â groovy-transform, groovy-filter, httpclient,
splitter, scriptable-transform
â Task â timestamp
34. Spring Cloud Projects
â Spring Cloud Task
â Spring Boot Application as a Task in Spring Data Flow
â Spring Cloud Task Starters provide a base and samples
show how to start a Spark Application locally or in a
cluster.
35. Spring Cloud Projects
â Spring Cloud Zookeeper
â Service Discovery and Configuration Management
â Service Discovery: instances can be registered with
Zookeeper and clients can discover the instances using
Spring-managed beans
â Supports Ribbon, the client side load-balancer via Spring
Cloud Netflix
â Supports Zuul, a dynamic router and filter via Spring Cloud
Netflix
â Distributed Configuration: using Zookeeper as a data store
36. Spring Cloud Projects
â Spring Cloud for Amazon Web Services
â Spring Messaging API implementation for SQS.
â Spring Cache API implementation for ElastiCache.
â Annotation-based mapping of SNS endpoints (HTTP).
â Access the resources by their logical name defined in a
CloudFormation stack.
â Automatic JDBC DataSource creation based on the logical
name of an RDS instance.
â Ant-style path matching ResourceLoader for S3 buckets.
37. Spring Cloud Projects
â Spring Cloud Connectors
â Spring XML and Java Configuration to bind to services and resources
â Extensible Connectors for various Cloud Platforms
â Cloud Foundry and Heroku in the box
â Community projects:
â Pivotal Cloud Fountry
â IBM Bluemix
â SAP HANA Cloud Platform
â Amazon S3
â Pivotal Gemfire
â Spring Cloud CLI
â Spring Boot CLI plugin for Spring Cloud projects
â Build quick projects with Groovy for Spring Cloud