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.
Welcome
Mikrodienste: Patrone and Anti-Patrone
Argitektuele Patrone and Anti-patrone om in ag te
neem met die onwerp van Mikrodien...
Microservices: Patterns and Anti-Patterns
Architectural Patterns and Anti-patterns to
consider with Microservices,
and usi...
Introduction
● Programmer since 1985
● Smallest to very large systems.
● Cobol, Pascal, Algol, C/C++, Java, Scala, Groovy ...
Definitions
● Patterns
● Anti-Patterns
● Cloud computing
● Cloud Native
● Microservice
Patterns & Anti-Patterns
● No pets allowed.
● Nano-services.
● Look mom no hands.
Microservices
● Is it SOA?
● Size?
● Why change?
● Microservice is to SOA what Agile is to Waterfall.
Why software systems?
● In support of a 'business' outcome.
● Reduce cost of feedback
● Provide information to improve dec...
Why traditional containers?
● Application Server
● Portal Server
● Enterprise Service Bus
Why not containers?
● Upgrades
● Deployments
● Scalability
● Lifecycle
Cloud Landscape
Microservice
Configuration
Routing
Security
Service
Registry
Messaging
Binary
Repository
Source
Repository...
Pattern: Immutable service
● Created by build process.
● Managed in Binary repository
● Deployed / Launched as a unit
● Si...
Pattern: Service registration and discovery
● I am here!
● Where are you?
● Who's the boss?
Cloud Landscape
Microservice
Configuration
Routing
Security
Service
Registry
Messaging
Binary
Repository
Source
Repository...
Pattern: Service configuration
● Point the service at configuration
● Broadcast to find config server
● Usually key/value ...
Networking
● Software defined networking
● Routing
● Load balancing
Cloud Landscape
Microservice
Configuration
Routing
Security
Service
Registry
Messaging
Binary
Repository
Source
Repository...
Management
● Logging
● Health check
● Scripting
Pattern: Cluster state
● Cluster
● Members
● Master election
● Global Locks
Service calls
● Synchronous
– JSON or XML over Rest / HTTP
– SOAP over HTTP
● Asynchronous
– SOAP over Message Queue
– XML...
Distributed messaging
● Asynchronous or Synchronous
● Persistent
● Latency
● Queue or Topics
Authentication
● Token based
● Proxies
● OAuth and OAuth2
Size of Microservices
● Questions
– How big is a Microservice?
– What about data?
● Best practice
– Start with a single ap...
Microservices with Spring
● What is Spring?
– The Spring Framework is aimed at improving developer
productivity by providi...
Spring Boot
● Opinionated auto configuration
● Simple configuration
● Single package
● A long list of starters
Spring Cloud
● Abstraction of many cloud native tools / services
● Distributed/versioned configuration
● Service registrat...
Spring Cloud Projects
● Spring Cloud Config
– Centralised config server backed by git
● Spring Cloud Netflix
– Netflix OSS...
Spring Cloud Projects
● Spring Cloud for Cloud Foundry
– Cloud Foundry
– Service Discover
– Security
– Service Broker Foun...
Spring Cloud Projects
● Spring Cloud Consul
– Service Discovery
– Configuration Management
● Spring Cloud Security
– OAuth...
Spring Cloud Projects
● Spring Cloud Contract
– Consumer driven contracts
– Contract Verification
– Contract Definition La...
Spring Cloud Projects
● Spring Cloud Data Flow
– Redesign of Spring XD
– Orchestrate across Cloud Foundry, Yarn, Mesos,
Ku...
Spring Cloud Projects
● Spring Cloud Stream
– Messaging with Kafka, Redis or Rabbit
– Binder Abstraction
– Persistent Publ...
Spring Cloud Projects
● Spring Cloud Stream Modules
– Spring Boot based Spring Integration applications
– Compose with Spr...
Spring Cloud Projects
● Spring Cloud Task
– Spring Boot Application as a Task in Spring Data Flow
– Spring Cloud Task Star...
Spring Cloud Projects
● Spring Cloud Zookeeper
– Service Discovery and Configuration Management
– Service Discovery: insta...
Spring Cloud Projects
● Spring Cloud for Amazon Web Services
– Spring Messaging API implementation for SQS.
– Spring Cache...
Spring Cloud Projects
● Spring Cloud Connectors
– Spring XML and Java Configuration to bind to services and resources
– Ex...
Questions
● More information
– https://cloud.spring.io
● Contact
– @corneil
– corneil@jumpco.io
Upcoming SlideShare
Loading in …5
×

Microservices Patterns and Anti-Patterns

795 views

Published on

A tour through the landscape of Microservices.

Take note the second slide is a local 'gag'

Published in: Software
  • Be the first to comment

Microservices Patterns and Anti-Patterns

  1. 1. Welcome
  2. 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. 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. 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)
  5. 5. Definitions ● Patterns ● Anti-Patterns ● Cloud computing ● Cloud Native ● Microservice
  6. 6. Patterns & Anti-Patterns ● No pets allowed. ● Nano-services. ● Look mom no hands.
  7. 7. Microservices ● Is it SOA? ● Size? ● Why change? ● Microservice is to SOA what Agile is to Waterfall.
  8. 8. Why software systems? ● In support of a 'business' outcome. ● Reduce cost of feedback ● Provide information to improve decision making
  9. 9. Why traditional containers? ● Application Server ● Portal Server ● Enterprise Service Bus
  10. 10. Why not containers? ● Upgrades ● Deployments ● Scalability ● Lifecycle
  11. 11. Cloud Landscape Microservice Configuration Routing Security Service Registry Messaging Binary Repository Source Repository Load Balancing Build Process Audit and Logging Management
  12. 12. Pattern: Immutable service ● Created by build process. ● Managed in Binary repository ● Deployed / Launched as a unit ● Simple externalised configuration
  13. 13. Pattern: Service registration and discovery ● I am here! ● Where are you? ● Who's the boss?
  14. 14. Cloud Landscape Microservice Configuration Routing Security Service Registry Messaging Binary Repository Source Repository Load Balancing Build Process Audit and Logging Management
  15. 15. Pattern: Service configuration ● Point the service at configuration ● Broadcast to find config server ● Usually key/value store
  16. 16. Networking ● Software defined networking ● Routing ● Load balancing
  17. 17. Cloud Landscape Microservice Configuration Routing Security Service Registry Messaging Binary Repository Source Repository Load Balancing Build Process Audit and Logging Management
  18. 18. Management ● Logging ● Health check ● Scripting
  19. 19. Pattern: Cluster state ● Cluster ● Members ● Master election ● Global Locks
  20. 20. Service calls ● Synchronous – JSON or XML over Rest / HTTP – SOAP over HTTP ● Asynchronous – SOAP over Message Queue – XML or JSON over Message Queue
  21. 21. Distributed messaging ● Asynchronous or Synchronous ● Persistent ● Latency ● Queue or Topics
  22. 22. Authentication ● Token based ● Proxies ● OAuth and OAuth2
  23. 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. 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. 25. Spring Boot ● Opinionated auto configuration ● Simple configuration ● Single package ● A long list of starters
  26. 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. 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. 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. 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. 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. 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. 32. Spring Cloud Projects ● Spring Cloud Stream – Messaging with Kafka, Redis or Rabbit – Binder Abstraction – Persistent Publish and Subscribe – Consumer Groups – Durability
  33. 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. 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. 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. 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. 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
  38. 38. Questions ● More information – https://cloud.spring.io ● Contact – @corneil – corneil@jumpco.io

×