Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Â
Microservices + Oracle: A Bright Future
1. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Microservices + Oracle | A Bright Future
Kelly Goetsch
Director, Product Management
January 28th 2016
2. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, and timing of any features or
functionality described for Oracleâs products remains at the sole discretion of Oracle.
2
3. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Program Agenda
Introduction
History of Microservices
Non-technical Prerequisites
Architectural Prerequisites
Technical Prerequisites
Implementing Microservices
How Oracle Products Support Microservices
Summary
1
2
3
4
5
3
6
7
8
4. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Introduction
4
5. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved. 5
Monolithic Applications
Single, Monolithic App
Must Deploy Entire App
One Database for Entire App
Organized Around Technology Layers
State In Each Runtime Instance
One Technology Stack for Entire App
In-process Calls Locally, SOAP Externally
Microservices
Many, Smaller Minimal Function Microservices
Can Deploy Each Microservice Independently
Each Microservice Often Has Its Own Datastore
Organized Around Business Capabilities
State is Externalized
Choice of Technology for Each Microservice
REST Calls Over HTTP, Messaging, or Binary
What Are Microservices?
Minimal function services that are deployed separately but can interact together to
achieve a broader use-case
Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
6. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Microservices Are Analogous to Unix Utilities
6
Same concept, different decade
Doug McIlroy
Inventor of the Unix Pipe
âWrite programs that do one thing and do it well. Write
programs to work together. Write programs to handle text
streams, because that is a universal interface.â
curl -v -H "Accept: application/jsonâ -H "Content-type: application/jsonâ -X POST
-d â{"productId":645887","quantity":"1"}'
"http://localhost:8840/rest/ShoppingCart/â
⢠Unix Executable: Does one thing and does it well
⢠Runs independent of other commands
⢠Produces text-based response
⢠Microservice: Does one thing and does it well
⢠Runs independent of other microservices
⢠Produces text-based response to clients
7. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Microservices Apps Are Developed/Deployed Independently
7
User Interface
Application
Datastore
Infrastructure
Status Quo
One Application
Microservices
Many Small Microservices
API
Application
Datastore
Infrastructure
Inventory
Microservice
API
Application
Datastore
Infrastructure
Payment
Microservice
API
Application
Datastore
Infrastructure
Profile
Microservice
API
Application
Datastore
Infrastructure
Product Catalog
Microservice
8. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Owners
Support in
Production
Every Team
Service Has
an Owner
Owners
Implement
Owners
Architect
Owners
Care
Owners Can
Fix Things
Ownership is Key
to the Success of
Microservices
In traditional enterprises, anyone individual
has very low ownership of anything. Itâs classic
tragedy of the commons
8Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
9. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Fundamentally, Microservices is a Tradeoff
9
Easier Deployment/Ops Easier Development
Do you want...
Traditional App Development Microservices
⢠One big block of code,
sometimes broken into semi-
porous modules
⢠Complexity handled inside
the big block of code
⢠Each big block is hard to
develop but easy to deploy
⢠Many small blocks of code,
each developed and deployed
independently
⢠Complexity encapsulated in
each microservice
⢠Each microservice is easy to
develop but hard to deploy
10. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved. 10
1. 100+ developers for an app
2. 5m lines of code for an app
3. Monthly or quarterly releases to production
4. > 1 quarter backlog of development work
5. > 20% developer turnover
Top 5 Signs Itâs Time To Look at Microservices
11. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Common Microservice Adoption Use Cases
11
I want to extendmy existing
monolithic application by adding
microservices on the periphery.
I want to decompose
an existing modular application into
a microservices-style application
I want to build a net new
microservices-style application
from the ground up.
12. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Sometimes Monolithic Applications Are Still a Good Fit
⢠For less complex applications,
monoliths are always better in both the
long and short-run
⢠For moderately complex applications,
monoliths are still probably better in
both the long and short-run
⢠For complex apps, microservices may
pay off over time but it takes a long
time to offset the high up-front
investment required to do it
12
Microservices add complexity
Time
Complexity
Complexity Over Time
13. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Do One Thing and
Do It Well
Focus on Business
Capabilities
Avoid Inter-
dependencies
How Big Should a Microservice Be?
Can have hundreds of microservices for a larger application
Large
Medium
Small
11-15 People
Example: Order Microservice
4-10 People
Example: Inventory Microservice
1-3 People
Example: Order Status Microservice
13
14. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Small Teams = Much Better Communication
14
Low Latency/High Bandwidth Communication
Legacy Microservices
15. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Definitive Guide to Deciding Microservice Size
⢠Bounded Context is a central pattern in
Domain-Driven Design
⢠Deals with designing software based on the
underlying domain
⢠You can't build a big unified domain model for
an entire system
⢠Divides a large system into Bounded Contexts,
each of which can have a unified model
15
Domain-Driven Design: Tackling Complexity in the Heart of Software by Eric Evans
16. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
âMicroâ in Microservices != Runtime Weight
16
Microservices tend to use smaller runtimes but you can use what you have today
Middleware
Module 1 Module 2 Module N
Datastore
Must support the
requirements of
ALL modules
Fully Featured Runtimes
That Support All Use Cases
Middleware
Module 1
Datastore
Must support the
requirements of
one module
Light Runtimes That
Do One Thing
Monoliths Microservices
17. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Youâre Doing Microservices If You...
17
Can build a
microservice
independently
Can release each
microservice
independently
Donât share a
datasource across
microservices
18. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Technical Complexity
⢠Microservices doesn't
eliminate complexity - it
just moves it and often
adds to it
⢠Monolithic applications
allow you to deal with
complexity in one body of
code
⢠Forces move to
distributed computing
Effort
⢠Testing, logging,
monitoring, security,
versioning, etc all become
much harder
⢠Polyglot exponentially
increases the number of
lifecycles required
⢠A lot of duplicated effort
since each team is
independent and goal is
to minimize
dependencies
18
Organization
⢠Most organizations are
organized around
horizontal technology
layers â need to build
small product-focused
teams
⢠Much higher skills
required
⢠Many developers will not
want to do production
support
Microservices Are Not a Panacea
19. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
History of Microservices
Microservices go way back
19
20. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Microservice Principles Have Been With Us For Decades
20
The principles behind microservices are
often just good architecture principles
Loose
Coupling
Focus on Business
Capabilities, Not
Technology Layers
Reduce Complexity
Through
Modularization
Do One Thing and
Do It Well
21. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
History of Microservices as a Term
⢠First Google search of "microservices" occurred in October of 2013
- expanded exponentially from there
⢠Began in the mid to late 2000's as a reaction against monoliths and
against traditional SOA
⢠No one person is credited with inventing the term or popularizing
it. It was an idea whose time had come
21
A trend without a name, until âmicroservicesâ was used in 2013
22. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
SOA vs. Microservices
22
SOA is the general idea, where microservices are a very specific way of achieving it
ď§ Favors centralized orchestration
ď§ Needlessly complicated by SOAP
ď§ âDumb endpoints, smart pipesâ
SOA
Microservices
ď§ Favors distributed choreography
ď§ REST + HTTP/S = simple
ď§ âSmart endpoints, dumb pipesâ
1. Keeping consumption of services separate from the
provisioning of services
2. Separating infra management from the delivery of
application capability
3. Separating teams and decoupling services
Implementation Differences
All of the tenets of SOA also apply to microservices
23. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
SOA vs. Microservices Misconceptions
23
âMicroservices removes the need
for an Enterprise Service Busâ
Donât confuse the product with the pattern
âMicroservices solves the problems
of SOAâ
Donât confuse improper SOA
deployments as problems with SOA
âCompanies like Netflix and
LinkedIn use microservices, so we
should tooâ
Netflix and LinkedIn are in the platform
business. Is that your business too?
âWe must choose microservices, or
SOAâ
Use both
24. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
SOA Still Reigns Supreme
24
SOA isnât going anywhere
âMicroservicesâ
âSOAâ
25. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved. 25
Microservice Principles Are Old; Implementation is New
Microservices is not just rebranded SOA
⢠Teams independently architect, develop, deploy and maintain each microservice
⢠Each microservice often has its own datastore, which may not always be 100% up-to-date
⢠Microservices is fully decentralized - no ESBs, no single database, no top-down anything
⢠Responses from microservices are not manipulated by an intermediary, like an ESB
⢠Microservices favors simple transports - XML or JSON over HTTP/S. No SOAP
⢠Any given instance of a microservice is stateless - state, config, and data pushed externally
⢠Microservices support polyglot - each microservice team is free to pick the best technology
⢠DevOps principles - automated setup and developers owning production support
⢠Use of containers, which allow for simple app packaging and fast startup time
⢠Use of cloud, for the elastic infrastructure, platform and software services
26. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Non-technical Prerequisites
26
27. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Conwayâs Law
27
âAny piece of software reflects
the organizational
structure that produced itâ
Melvin Conway
1968
28. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Conwayâs Law In Action
28
Any piece of software reflects the organizational structure that produced it
User Interface
Application
Datastore
Infrastructure
Resulting SoftwareTypical Enterprise Organization Structure
Head of IT
Head of
Operations
Head of DBAs
Head of
Infrastructure
Head of App
Dev
Head of UI
Head of
Development
An Enormous Monolith
29. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Characteristics of Different Organization Types
29
ď§ Produce microservices
ď§ Small teams can make any change
they want to an individual
microservice
ď§ Architecture clean because
developers have 100% control
ď§ True ownership
ď§ Produce monoliths
ď§ Simple change requires extensive
coordination across all of the
different layers
ď§ Business logic is spread
everywhere because itâs easier to
bury it in the layer you own
ď§ No real ownership
Centralized Organizations
Focused on Technology Layers
Distributed Organizations
Focused on Products
30. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Successful Teams Structure Their Teams Around Products
30
Build small vertical teams
Resulting SoftwareMicroservices Organization Structure
Product
Lead
Developer Sys Admin DBA
JavaScript
Developer
Many Small Microservices
Developer
Developer
Sys Admin
Storage Admin
Graphic ArtistNoSQL Admin
API
Application
Datastore
Infrastructure
API
Application
Datastore
Infrastructure
API
Application
Datastore
Infrastructure
API
Application
Datastore
Infrastructure
31. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Horizontal -> Vertical Teams
Oracle Confidential â Internal/Restricted/Highly Restricted 31
32. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Standardize Where it Makes Sense. Be Pragmatic
32
Teams do not have 100% freedom
Custom Code
Communication Protocol
Data Format
Infrastructure
Datastore
SourceControl
ConfigurationManagement
DevelopmentTooling
Alerting
Monitoring
Standardize on One
Offer a Menu of 2-3 Options
Team Has Complete Choice
Programming Language
Messaging
33. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Each Team Should Treat Other Teams as External Vendors
⢠Clear interfaces
⢠Clear SLAs
⢠Chargeback
33
Good fences make good neighbors
Microservice A Microservice B
34. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
DevOps Must Also Be Adopted Prior to Microservices
34
Mostly a function of culture
Culture Technology
Respect
Discuss
Avoid Blaming
âDoneâ Means
Released
Infra as Code
Shared Version
Control
One Step
Build/Deploy
Donât Fix
Anything
⢠Dev respect for ops
⢠Ops respect for dev
⢠Ops should be in dev discussions
⢠Dev should be in ops discussions
⢠Shared runbooks
⢠No fingerpointing!
⢠Everyone should have some
culpability
⢠Devâs responsibility shouldnât ever
end â production support required
⢠âThrowing it over the wallâ is dead
⢠Donât build envs by hand
⢠Scripts checked in and
managed as src
⢠Single system
⢠Ship trunk
⢠Enable features through flags
⢠One button build/deploy
⢠If verification fails, stop and
alert or take action
⢠If something breaks, re-deploy.
Donât fix
⢠Fix environment setup scripts
35. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved. 35
More About DevOps
http://www.slideshare.net/KellyGoetsch/mastering-devops-with-oracle
36. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Architectural Prerequisites
36
37. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Microservices Forces Move To Distributed Computing
37
Introduces enormous complexity â monoliths donât suffer from this
API
Application
Datastore
Infrastructure
API
Application
Datastore
Infrastructure
API
Application
Datastore
Infrastructure
API
Application
Datastore
Infrastructure
Microservice A Microservice B Microservice C Microservice D
⢠Distributed computing is a natural consequence of microservices
because each microservice has its own datastore
⢠Sharing datastores across microservices introduces coupling â very bad!
⢠There will always be latency between microservices
⢠Latency = eventual consistency
⢠All data exchange between
microservices must be
through API layer or
messaging â no accessing
datastores cross-
microservices
⢠Must implement high-
speed messaging between
microservices. REST + HTTP
probably isnât fast enough
⢠May end up duplicating
data across datastores â
e.g. a customerâs profile
38. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Rules of Distributed Computing
38
Computer science is about tradeoffs
Consistency
Each node shows the same data at all times
Availability
Each node is available for writes at all times
Partition Tolerance
Able to handle network outages
CAP Theorem â Pick Any Two
C
A P
Theory Practice
Pick One
Partition Tolerance is non-negotiable
because we have networks that can
always fail
Enterprise IT Systems: Often CP
Microservice Systems: Often AP
Each microservice can be CP, AP or
CA but the system as a whole is
always CP or APMore Information
Pick
Any
Two
39. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Microservices Usually Forces Eventual Consistency
39
Synchronous communication leads to availability and performance problems
API
Application
Datastore
Infrastructure
API
Application
Datastore
Infrastructure
API
Application
Datastore
Infrastructure
API
Application
Datastore
Infrastructure
Self Service Help Inventory Customer Profile Payment
Initiate
Return
Increment
Inventory
Document
Refund
Refund
Money
Customer Logs in to Self Service.
Accidentally ordered three
widgets, not the two he wanted.
Returns one of the widgets
Each Microservice Receives the Change and Saves it to Its Datastore
OneApplication
40. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Synchronous Calls With Microservices Are Very Bad
40
Product Catalog Product Pricing Inventory
Chaining == coupling == downtime
The availability of microservice A depends on B, B depends on C, etc
41. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Avoid Synchronous Calls for Read-only Data By Copying
41
Product Pricing
Inventory
Promotions
Product Pricing
Inventory
Promotions
Product Pricing
Inventory
Promotions
Product Catalog
⢠Synchronous in-memory calls
⢠Data is 100% consistent
⢠No data is duplicated
Request for
Category Page
Product Catalog
Product
Pricing
Inventory
Promotions
⢠Synchronous calls to product catalog microservice
⢠Product, pricing, inventory and promotions
microservices are systems of record; they publish
asynchronously to Product Catalog microservice when
updated
⢠Product Catalog microservice is not always consistent
⢠Data is duplicated â two or more microservices may
contain the same data
Traditional
Monoliths
New
Microservices
42. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Orchestration
⢠Top-down coordination of
discrete actions
⢠Used in centralized,
monolithic applications
⢠Brittle â centralized by
nature
⢠Each âactionâ registers with
centralized system â single
point of failure that is not
very flexible
Choreography
⢠Bottom-up coordination
of discrete actions
⢠Used in distributed,
microservice applications
⢠Resilient â distributed by
nature
⢠Each microservice
asynchronously throws up a
message that other
microservices can consume
42
Choreography Tends to Be Better Than Orchestration
43. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved. 43
Orchestration vs. Choreography
44. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved. 44
Scenario: eCommerce user returns a widget through web-facing .com
Example of Orchestration
Centralized Workflow
Self Service
Help
Initiate
Return
Workflow
Increment
Inventory
Done
Inventory
Record
Refund
Done
Customer
Profile
Done
Payment
Refund
Money
Brittle | Centralized | Tightly Coupled
45. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved. 45
Scenario: Inventory microservice
Example of Choreography
Inventory
Microservice
All asynchronous
Event Bus
New
Inventory
Events This Microservice Cares About Events This Microservice Emits
Product
Returned
Product Sold
Product
Recalled
Inventory
Incremented
Inventory
Created
Inventory
Decremented
Inventory
Deleted
For Anyone
Who Cares...
46. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Best to Ship Your Applications Headless
Put your front and back ends in different clouds, different geographies
Design, develop, deploy and manage your front and back ends differently
46
API
Application
Datastore
Infrastructure
API
Application
Datastore
Infrastructure
API
Application
Datastore
Infrastructure
API
Application
Datastore
Infrastructure
BackEnd
Add to Cart Inventory Product Details Search
FrontEnd
API Gateway
Web Content
Management System
Custom Application
Very Different
Requirements
⢠Security
⢠Elasticity
⢠Performance
⢠Traffic patterns
or
Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
47. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Make Your Middle Tier Stateless If You Can
47
Push all state and configuration down to highly available cloud services
Application Server
File System
Application Server
File System
Application Server
File System
Application Server
File System
Application
Instance
File System
Load Balancer
Sticky to an
Individual
Instance
Application
InstanceApplication
InstanceApplication
InstanceApplication
Instance
Load Balancer
NOT Sticky to
an Individual
Instance
State
Service
Configuration
Service
Application
Instance
Key to Cloud Native
Session State
Shopping cart contents, page
view data, personalization, etc
Application Configuration
Port numbers, file system
paths, host names, etc
Current Cloud Native
48. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Remove All Hard-coded IPs, Host Names, etc
48
Use service discovery, DNS, etc instead. Everything should be dynamic
49. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
<credit>
<amount>100</amount>
<forAccount>1234</account>
<creditMemoID>4567</creditMemoId>
</credit>
<credit>
<amount>100</amount>
<forAccount>1234</account>
</credit>
Modify Messaging To Be Less Fragile
49
Messages should be constructed to be able to be applied over and over
Not Idempotent Idempotent
⢠Can execute exactly once
⢠Works fine in a monolith
⢠Will break with microservices
⢠Can execute many times
⢠Works fine in monolith and microservices
⢠Allows the pipes to be dumb â message
just needs to be applied once
Best For Microservices
* Idempotent = the outcome doesnât change after the first application
50. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Approaches to Synchronous Network Calls
50
XML/JSON Over HTTP Binary Over Wire
Primary Use
Communicating with clients over
the public internet
Communicating with other
microservices over a private network
Pros
ď§ Universally understood format
ď§ Easy to implement and
understand
ď§ Very fast
Cons ď§ Slow since itâs text-based ď§ Can be hard to implement
Implementations
ď§ No special software required â
natively supported by all major
programming languages
ď§ HTTP is the language of the
web!
ď§ Oracle Portable Object Format
ď§ Google Protocol Buffers
ď§ Apache Avro
ď§ Apache Thrift
51. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
REST: Representational State Transfer
51
Strongly associated with microservices but not a technical requirement
HTTP
REST
XML or JSON
HTTP
Response
Codes
⢠Much simpler alternative to SOAP
⢠Uses GET, POST, PUT, DELETE, etc â just
like web browsers do
⢠Synchronous inter-microservice
communication often occurs over binary
⢠Can version APIs - /v1.2/customer
⢠Can use XML or JSON
â XML is often better - supports XPath, CSS
selectors
⢠Can't generate strongly typed stubs
REST =
52. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Microservices Requires a Higher Level of REST Use
52
Oracle fully supports level 3
⢠Level 0
â Use HTTP as a tunneling mechanism only
â Interact with /OrderService
â Use HTTP GET/POST only
⢠Level 1
â Start requesting individual resources
â Interact with /OrderService/12345
⢠Level 2
â Start using HTTP verbs - HTTP GET/POST/PUT/DELETE/etc
â Responses come back using correct HTTP codes â e.g. HTTP 409 for a conflict
⢠Level 3
â Application itself tells client how to interact with it - similar to hyperlinks in a web page
â <link rel = "delete" uri = "/OrderService/12345/delete"/> under <order id="12345">
53. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Message Compatibility Across Versions
53
Design for backwards compatibility
<product>
<id>329340224</id>
</product>
API
Application
Datastore
Infrastructure
v1.1
API
Application
Datastore
Infrastructure
v1.2
Send update to Product
Catalog microservice
<product>
<id>329340224</id>
<shipToStore>true</shipToStore>
</product>Send update to Product
Catalog microservice but
v1.2 adds a new required
property
Donât make properties required!
Assume any given microservice has two or more different
versions running concurrently. Build for backwards compatibility
54. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Technical Prerequisites
54
55. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Requirements for Microservices Implementation
55
Microservices
Security ScalingMonitoring
Eventing LoggingMessaging
Service Discovery ConfigurationSecurity
Service Registry API GatewayAPI Load Balancer Generally Recommended
for Microservices
56. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Key Microservices Technology â Service Registry
⢠Manages the lifecycle of each
microservice endpoint
â Newly-instantiated endpoints
register with Service Registry
â Service Registry continually polls
each endpointâs health
⢠Aware of tenants, microservice
versions, and environments
â Health checking and selecting the
most appropriate endpoint are
very much dependent upon the
tenant, version, and environment
â Can query for an endpoint based
on those attributes
56
API Load Balancer
Whatâs the best
endpoint to use
for microservice
X?
Client HTTP
request
Service Registry
Java SE Cloud Service
(instances 1...N)
Node Cloud Service
(instances 1...N)
Compute Cloud Service
(instances 1...N)
Runtime X
(instances 1...N)
Just
added a
new
endpoint
Runtime InstancesMicroservice Infrastructure
Java Cloud Service
(instances 1...N)
57. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Key Microservices Technology â API Load Balancer
⢠Matches each request to the
best endpoint
⢠Queries Service Registry to
determine the best endpoint
⢠Ideally stateless â looks up the
best endpoint for each HTTP
request
⢠Uses load balancer or web server
as the core. Typical
implementations are customized
Oracle Traffic Director, Nginx, or
Apache mod_rewrite
⢠Handles logging, request rate
limiting, authentication
57
API Load Balancer
Whatâs the best
endpoint to use
for microservice
X?
Client HTTP
request
Service Registry
Java SE Cloud Service
(instances 1...N)
Node Cloud Service
(instances 1...N)
Compute Cloud Service
(instances 1...N)
Runtime X
(instances 1...N)
Just
added a
new
endpoint
Runtime InstancesMicroservice Infrastructure
Java Cloud Service
(instances 1...N)
58. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
API Gateways Load Balance and Aggregate Responses
58
API gateways provide a "backend for each frontend"
Client
Public Internet
Microservice Microservice Microservice
Microservice Microservice Microservice
Data Center
API Gateway
Microservice Microservice Microservice
⢠Builds a XML or JSON response for each type
of client â web, mobile, etc
⢠Asynchronously calls each of the N
microservices required to build a response
⢠Handles security and hides back-end
⢠Load balances
⢠Applies limited business logic
⢠Meters APIs
⢠Logs centrally
⢠Common solutions: Netty, Vertex, Nginx,
Kong, Apigee
59. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved. 59
API Load Balancer vs. API Gateway
ďź Matches each request to the
best endpoint
API Load Balancer
ďź Queries Service Registry to
determine the best endpoint
ďź Handles logging, request rate
limiting, authentication
ďź Matches each request to the best
endpoint
ďź Queries Service Registry to
determine the best endpoint
ďź Handles logging, request rate
limiting, authentication
ďź Aggregates the responses of many
microservices
API Gateway
API Load Balancers are missing aggregation
but...
Itâs best to build a microservice that does aggregation. Keep the
API Load Balancer or Gateway as free of business logic as possible
60. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Service Discovery â Generally Not a Problem With Monoliths
60
Requirements
ď§ Must resolve:
- Host/port
- Version for each microservice
ď§ Must be discoverable
Because
ď§ Many microservices in an environment
ď§ Many environments
ď§ Many versions of each microservice
ď§ Hosts/ports can change quickly
ď§ Itâs not practical to manage by hand
Approaches Include
ď§ Plain DNS - limited to IP only
ď§ SRV DNS records - gives IP + port
ď§ Hierarchical namespaces
ď§ Instance tagging in the cloud
Solutions Include
ď§ Any DNS provider
ď§ Consul
ď§ Zookeeper
ď§ Custom coding to search instance tags
61. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Microservices Requires Robust Messaging
61
Both traditional durable messaging and non-durable eventing
Microservice
Microservice
Microservice
Microservice
⢠Message broker can buffer
messages until the consumer
is able to process them â
prevents synchronous
coupling which leads to
outages
⢠âSmart endpoints, dumb pipesâ is the
philosophy of microservices â messaging should
just pass messages. Not manipulate them
⢠Should support a variety of communication patterns
including one-way requests and publish-subscribe
Why Use Messaging?
Requirements for Messaging
Types of Messaging
Normal Messaging
⢠Durable, ordered
⢠Relatively low throughput
⢠Usually brokered
⢠Often used to keep the data
across different microservices
in sync, as each microservice
has its own data store
Eventing
⢠Non-durable, un-ordered
⢠Very high throughput
⢠Usually non-brokered
⢠Often used to distribute notification
events â scale up, scale down, etc
62. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Circuit Breakers Prevent Cascading Failures
⢠Rule #1 of microservices â avoid coupling!
â Synchronous = two systems are coupled
â Asynchronous = no coupling
⢠Cascading failures happen when request-handling threads
are waiting on a response from a remote system
⢠Circuit breakers make synchronous calls from another
thread pool to avoid binding up request-handling threads
⢠Hystrix (Java-based) is well-known and solves this problem
62
Cascading failures are more common with microservices
64. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Private Subnet
Security: Requires New Paradigms to Properly Secure
64
More microservices, more principals, more technologies, more everything
Client
Microservice Microservice
API Gateway
Public Internet
Data Center
⢠HTTPS
⢠HTTPS Basic
⢠Client certificates
⢠Public/private keys
⢠SAML
⢠OpenID Connect
Datastore Datastore
Private Subnet
⢠HTTPS
⢠Must authorize and authenticate
every single principal â best to
use common approach
⢠Monolithic apps typically do
authentication and authorization
on their own
⢠Secure every single remote
network call
⢠Use network segmentation to
isolate microservices from each
other
65. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Microservices Complicates Testing
65
More code, more microservices to test
Acceptance Testing Usability Testing Component Testing
Did we build the right
thing? Do business
requirements make
sense?
Performed manually
directly by business
users
Entire system is
tested using end-
clients
How usable is the
system? Will end-
users like it? Is it fast
enough?
Performed manually
by business users
Entire system is
tested using end-
clients
Does each
microservice work in
isolation? Is it fast
enough?
Performed
automatically with
each microservice
release
Each microservice is
tested in isolation.
Dependencies
stubbed out
Does each fragment
of code work in
isolation?
Performed
automatically with
each build
Each method, or
similar fragment is
captured
Unit Testing
Frequency of Testing
66. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
What/How To Monitor
66
Monitoring a monolith is relatively easy â one app. Microservices = many apps
Requirements for Monitoring Microservices
1. Monitor throughput, performance,
and business metrics
2. Trace each end-request through
every microservice â end-to-end
3. Track the health of downstream
dependencies
4. Monitor each process, OS, host, etc Dropwizard Metrics
Popular Tooling
67. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Containers Make Microservices Easier
67
Helpful to microservices but not a requirement
Hardware
Hypervisor
VM 1
OS
App
VM 2
OS
App
Hardware Virtualization
Hardware
Operating System
Hypervisor
VM 1
OS
App
VM 2
OS
App
Para-virtualization
Hardware
Operating System
Container 1
App
Container 2
App
Containers
⢠#1 value â app
packaging
⢠Microservices doesn't
rely on containers but
they do help:
â Higher density
â Easy to start/stop
â Portability
⢠Containers are
lightweight, just like
microservices
themselves
68. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Many See Containers As the Standard
68
Four main use cases
Hardware
Operating System
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Hardware
Operating System
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Hardware
Operating System
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Hardware
Operating System
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Hardware
Operating System
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Hardware
Operating System
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Hardware
Operating System
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Hardware
Operating System
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Application Packaging
Continuous Integration DIY PaaS
Infrastructure Consolidation
Neatly package applications
and supporting environment
in immutable, portable
containers
All changes to an app are
contained in one immutable
container image. Container is tested
and deployed as one atomic unit
Get infrastructure utilization up to
100% (vs 5-10% with VMs) due to
over-subscription of resources and
near bare metal performance.
Build a simple PaaS by wiring up
containers to a load balancer.
New code, patches, etc pushed
as new immutable containers.
69. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Containers Should Be Immutable
69
Patches to
System Software
New Version of
Application
Configuration
Changes
Build and deploy a new container
Never touch a container thatâs already been built
70. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
One Instance Per Container is Typical
⢠Best to run one instance
(unique host/port
combination) per container
⢠Running multiple instances of
the same application or
different applications will
make scheduling very difficult
⢠Expose one port per container
70
Physical Host
Operating System
Container
App
Container
App
Just One Per Container
71. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
How Do You Deploy Containers to Physical Hosts?
71
The emerging space of container orchestration
What Do Container
Orchestration Solutions Do?
⢠Map containers back to physical
hosts, taking into account user-
defined placement rules, the
utilization of each host, and the
needs of each container. Can be
very complex
⢠Set up overlay networking,
firewalls, ensure network QoS, etc
⢠Auto-scaling
⢠Local and external load balancers
⢠Service registry / discovery
Host
Host
Host
Host
Host
Host
Host
Host
Host
Host
Container
⢠Inventory
Microserv
ice
⢠AcmeCo
⢠v1.2
Container
⢠Inventory
Microserv
ice
⢠AcmeCo
⢠v1.2
Container
⢠Inventory
Microserv
ice
⢠AcmeCo
⢠v1.2
Container
⢠Inventory
Microserv
ice
⢠AcmeCo
⢠v1.2
Container
⢠Inventory
Microserv
ice
⢠AcmeCo
⢠v1.2
Container
⢠Inventory
Microserv
ice
⢠AcmeCo
⢠v1.2
Container
⢠Inventory
Microserv
ice
⢠AcmeCo
⢠v1.2
Container
⢠Inventory
Microserv
ice
⢠AcmeCo
⢠v1.2
Container
⢠Inventory
Microserv
ice
⢠AcmeCo
⢠v1.2
Container
App
Container
⢠Inventory
Microserv
ice
⢠AcmeCo
⢠v1.2
Container
⢠Inventory
Microserv
ice
⢠AcmeCo
⢠v1.2
Container
⢠Inventory
Microserv
ice
⢠AcmeCo
⢠v1.2
Container
⢠Inventory
Microserv
ice
⢠AcmeCo
⢠v1.2
Container
⢠Inventory
Microserv
ice
⢠AcmeCo
⢠v1.2
Container
⢠Inventory
Microserv
ice
⢠AcmeCo
⢠v1.2
Container
⢠Inventory
Microserv
ice
⢠AcmeCo
⢠v1.2
Container
⢠Inventory
Microserv
ice
⢠AcmeCo
⢠v1.2
Container
⢠Inventory
Microserv
ice
⢠AcmeCo
⢠v1.2
Container
App
Many Containers
Host
Host
Host
Host
Host
Host
Host
Host
Host
Host
Many Hosts
Docker Swarm
Emerging space. Solutions are very early and lack any real
notion of an application. Still very much infrastructure-focused
72. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Artifacts Are Now Immutable Containers â Not EARs, WARs
72
Containers can have anything in them and are highly portable
Hardware
Operating System
Hypervisor
VM 1 VM 2
Current
Hardware
Operating System
Container 1 Container 2
Cloud Native
⢠No more installing a JVM,
app server, and then
deploying the artifacts to
them
⢠Build the container once,
deploy it anywhere. Can
include complex
environment variables,
scripts, etc
⢠Containers should be free of
state and configuration
⢠Containers should not
assume they are able to
write to a persistent local
file system
OS
App Server
EAR/WAR
OS
App Server
EAR/WAR The Artifact You Deploy
73. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Constantly Deploy Each Microservice
73
No need to batch together many changes to single app
One Application Many Microservices â Deploy Many Times/Day
API
Application
Datastore
Infrastructure
Inventory
Microservice
API
Application
Datastore
Infrastructure
Payment
Microservice
API
Application
Datastore
Infrastructure
Profile
Microservice
API
Application
Datastore
Infrastructure
Product Catalog
Microservice
By definition, each microservice can be
written, built, and deployed independently
User Interface
Application
Datastore
Infrastructure
Deploy Constantly â Even HourlyDeploy Quarterly
Long, serial process to
deploy anything
74. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Run Many Versions of the Same Microservice Concurrently
74
Monolithic
Application
v1.1
Microservice A
Microservice A
Microservice A
Microservice A
Microservice AMicroservice B
v1.1
Microservice A
Microservice A
Microservice A
Microservice A
Microservice A
Microservice A
Microservice A
Microservice A
Microservice A
Microservice AMicroservice B
v1.2
Microservice A
Microservice A
Microservice A
Microservice A
Microservice A
Run only one version of the same
application in the same environment
Run many versions of each
microservice in the same environment
Microservice A
v1.2
Microservice A
v1.1
75. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Application Containers â Use What You Have Today
75
Characteristics of Microservices-
friendly Application Server
Characteristics of Existing
Application Server
⢠Run a smaller, microservice that
does one thing really well
⢠Few features
⢠External dependency
management
⢠Many instances per host
⢠Stateless
⢠Run a very large, complicated
monolithic application
⢠Many advanced features
⢠Integrated dependency
management
⢠Few instances per host
⢠Stateful
Run whatever works best â few firm requirements
76. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
How Oracle Products Support Microservices
76
77. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Oracleâs Microservices Strategy
Oracleâs Microservices Roadmap Today With Oracle Products
Runtime
Management/Logging/Alerting
Messaging
Datastore
API Gateway/Load Balancer
Central Source of Truth
Infrastructure
Build/Deploy
77
Container Orchestration
Service Discovery
Eventing
Configuration
State Planned - Oracle Cloud State Service
Planned - Oracle Cloud Config Service
Planned - Runtime - Jersey + Grizzly
Planned - Oracle Cloud Eventing Service
Oracle Messaging Cloud Service
Oracle Management Cloud Service
Oracle Database or NoSQL Cloud Service
Oracle Cloud
Planned - Oracle Microservices Platform
Oracle Developer Cloud Service
Planned - Oracle Microservices Platform
Planned - Oracle Microservices Platform
Planned - Oracle Microservices Platform
Oracle Coherence or Oracle WebLogic
Oracle Coherence
Oracle WebLogic, Node, Java SE, etc
Oracle Coherence
Oracle Messaging Cloud Service
Oracle Management Cloud Service
Oracle Database or NoSQL Cloud Service
Oracle Cloud
Oracle App Container Cloud Service
Oracle Developer Cloud Service
Oracle App Container Cloud Service
Oracle Coherence
Oracle App Container Cloud Service
78. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
An All-New Microservices Platform From Oracle
Oracle Confidential â Internal/Restricted/Highly Restricted
⢠Config
⢠State
⢠Eventing
⢠Messaging
⢠Logging
⢠Monitoring
⢠Database
⢠NoSQL
⢠Caching
⢠Integration
⢠Big Data
⢠Mobile
⢠Process
⢠Developer
Infrastructure Agnostic High Availability Hybrid Cloud
Placement Constraints High Density Internal Load Balancing
Rolling Upgrades Rollbacks
Blue/Green Releases
Canary Testing
Health MonitoringService DiscoveryStateless Support
Stateful Support
Microservices
Platform
Language-specific Tooling
Install Platform On Any IaaS, On Or Off Premise (future)Consume Platform as PaaS on Oracle Cloud
Oracle Public Cloud
Oracle Public Cloud
Machine
AllNew
Services Available
for Consumption
Inside the Platform
Runtime
Light/fast
Jersey-based
Easy Packaging
Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
New!
78
79. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Using Application Container Cloud Service For Microservices
79
A modern platform for lightweight application development
Database Cloud Service
Oracle Cloud
Application Container Cloud Service NoSQL Cloud Service
Oracle Management Cloud - Management/Logging/Alerting
Messaging Cloud Service
Caching Cloud Service for State
Java SE
Cloud
Service
API Load Balancer
Service Discovery
Configuration
Node
Cloud
Service
Other
Polyglot
Runtimes
Bring
Your Own
Container
Jersey +
Grizzly
Docker Containers
Container Placement
DeveloperCloudService
80. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Introducing Oracle App Container Cloud Service
80
Key Features
⢠Useful for any Java, Node.js, or polyglot runtime
⢠IDE Choice - JDeveloper, Eclipse, NetBeans - and API access
⢠Continuous integration with Oracle Developer Cloud Service
⢠Cloud tooling for lifecycle management
⢠Integrated load balancer, support for service discovery
⢠Bring-your-own-container model supported shortly
Benefits
⢠Self-service application platform with advanced cloud tools
⢠Secure, Highly Available with Clustering
⢠Fully automated provisioning, patching, backup, and recovery
Java SE
Node
Your Own
Container
81. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
JAX-RS: The Java API for RESTful Web Services
81
Oracle is a spec lead
@Path("/atm/{cardId}â)
public class AtmService {
@GET @Path("/balanceâ)
@Produces("text/plainâ)
public String balance(
@PathParam("cardId") String card,
@QueryParam("pin") String pin) {
Client client = ClientFactory.newClient();
String balance =
client.target("http://xxxx/atm/{cardId}/
balance")
.pathParam("cardId", "1234567890123456")
.queryParam("pin", "1111")
.request("text/plain")
.get(String.class);
Server-side Code
Simply annotate Java code to expose as REST
Client-side Code
Use REST without having to parse text
Updated as JSR 339 in 2013 - 2.0
Part of Java EE 7 Spec
|Originally defined in JSR 311 - 1.0
Part of Java EE 6 Spec
82. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Jersey: The Reference Implementation of JAX-RS
⢠Oracle sponsored open source
⢠Implements the JSR 311 specification
⢠Contains
â Standalone server
â Client
â JAXB/JSON support
82
Oracle continues to lead the spec
83. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Grizzly: High Performance I/O
⢠Oracle sponsored open source
⢠Allows developers to take advantage of the
Java NIO to provide very fast inter-process
communication
⢠Brings non-blocking sockets to the protocol
processing layer
â Support for non-blocking HTTP processing
⢠WebSocket Support
⢠APIs make non-blocking interactions simple
83
Great for inter-process communication
84. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved. 84
Using WebLogic + Java EE For Microservices
A proven, enterprise-grade platform for application development
Database Cloud Service
Oracle Cloud
Oracle Compute Cloud Service NoSQL Cloud Service
Oracle Management Cloud - Management/Logging/Alerting
Messaging Cloud Service
Caching Cloud Service
For State, Configuration, Service Discovery
DeveloperCloudService
Oracle Traffic Director
Docker Containers
Container Placement
WebLogic Multi-tenant WebLogic Multi-tenant
Jersey + Grizzly Jersey + Grizzly
WebLogic Partition
85. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Java EE Platform Supports Microservices
⢠Standards based infrastructure
â Prescribed, validated set of APIs and services
â WAR file deployment for service boundary
⢠Enables development of thin Microservices
â Assemble application code and resources only
â APIs and implementation libraries supplied by
platform
⢠Freedom to choose best service topology
â One service per server, multiple services per server
â One server per container/host
â Multiple containers/servers per host
85
JAX-RS
CDI
HTTP/S WebSocket
EJB
JPA
JSON
JDBC
Ď S Ď S
Data
Store
Data
Store
JAX-RS
CDI
HTTP/S WebSocket
EJB
JPA
JSON
JDBC
Ď S Ď S
PDB PDB
86. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
⢠Java EE Platform Support
â With latest Java language support
⢠Fully automatable infrastructure
â Scriptable provisioning, configuration,
deployment supporting code-as-
infrastructure
â REST API, WLST, JMX
â Callable from Maven, Gradle, Arquillian
â Easily incorporated into Continuous
Integration and Delivery workflows
⢠Flexible placement models
â Single server, multiple servers, clusters of
servers
⢠Diverse datastore options
â Traditional multi-vendor relational
database support
â Integrated Oracle Database 12c pluggable
database support as independent data
stores for services
â Simple configuration for Document/Graph
databases
â Container, application, embedded
application scoped database resources
86
WebLogic Supports Microservices (and then some!)
87. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved. 87
Partition is now a first-class object
WebLogic Multi Tenant
WebLogic
JVM
Application
OS Process
WebLogic
JVM
Application
OS Process
WebLogic
JVM
Application
OS Process
WebLogic
JVM
Application
OS Process
Operating System Instance
Standard WebLogic
Single-tenant Multi-tenant â strong isolation between tenants
Multi Tenant WebLogic
WebLogic
JVM
OS Process
WebLogic
JVM
OS Process
Operating System Instance
Application 2 Application 2
Partition 2Partition 2
Application 1 Application 1
Partition 1Partition 1
88. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
WebLogic Multi Tenant is Perfect for Microservices
⢠Each microservice instance can have
its own light-weight WebLogic
container-like partition
⢠Easily move partitions between
WebLogic hosts
⢠Each partition is exceptionally light
⢠Each WebLogic host can support
hundreds of partitions
88
Similar to Oracle Database pluggable/container databases
WebLogic
JVM
Microservice
OS Process
Operating System Instance
Microservice Microservice
Microservice Microservice Microservice
Microservice Microservice Microservice
Microservice Microservice Microservice
Microservice Microservice Microservice
Multi Tenant WebLogic
89. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
WebLogic Runs Great on Docker
⢠Build
oracle/weblogic:12.1.3-
dev image
⢠Start 3 WebLogic Server
Containers in seconds
⢠View status
89
$ docker run âp 17001:7001
oracle/weblogic:12.1.3-dev
1
2
3
90. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Other Supporting
Products from Oracle
90Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
91. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Oracle Coherence â Oracleâs Distributed Data Grid
⢠Reliable in-memory key-value store
â Dynamically scalable
â Scale processing with data
â Flexible topology support
⢠Java, .NET, C++, REST, Memcached,
Jcache client support
⢠In-place distributed processing
⢠Queries & continuous queries
⢠Map-reduce aggregation
⢠Event notification / event programming
model
⢠Distributed Lambdas and Streams
91
Architected for microservice state management
92. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Oracle Messaging Cloud Is Perfect for Microservices
92
Implements AMQP standard
Standardized Interfaces
REST
JMS
Message push over HTTP
Versatile
Oracle Cloud
On Premise
Hybrid
Delivery Choices
Pull
Push
Filter
Reliability Mechanisms
Transactions
Acknowledgements
Durable subscriptions
93. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Oracle Management Cloud Services â Initial Offerings
Application Performance
Monitoring
Improve End-User Experience
and System Performance;
Diagnose Performance Issues
Faster
Log Analytics
Extract Value from Logs by
Collecting, Correlating, and
Searching Any Kind of Log Data;
Quickly Discover Anomalies
IT Analytics
Make Critical Decisions About Your
IT Estate; Plan For Growth, Run
What-If Analyses, Compare
Resource Usage
93
94. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Oracle Datastore Options â Offered On Premise and In Cloud
94
DESCRIPTION
Supports JSON, XML, CLOBs,
BLOBs, and multi-media. Accessible
over client-specific APIs, REST
Distributed key/value pairs, schema-
less, nearly ACID compliant, scale
out. Berkeley DB behind the scenes
Distributed data grid that supports
grid-side processing
PRODUCTS
Fraud Detection
CATEGORY
RDBMS
Key/Value Stores
Object Data Grid
95. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Pluggable Databases
⢠Container Database
â Multi-tenant database that includes zero, one or
many pluggable databases
â Upgrades, etc are performed against container
⢠Pluggable Database
â A full database to the client except that behind the
scenes it doesnât have its own controlfiles, redo logs,
undo, etc
â Just a collection of datafiles and tempfiles to handle
its own objects, including its own data dictionary
â Can easily move Pluggable Databases from one
container to another
95
One Container Database per application, one Pluggable Database per microservice
96. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Oracle Database: Simple Oracle Document Access (SODA)
⢠Enable schemaless development on
top of an Oracle Database
â Provide a simple NoSQL-style API for
working with documents
⢠Make it easy to use Oracle as a
NoSQL-style document store
⢠Supports all common application
development environments
⢠Supports SQL!
⢠Works with Oracle Database tooling
â backup, restore, security, etc
96
NoSQL backed by Oracle Database
POST /DBJSON/SCOTT/CUSTOMERS?action=query HTTP/1.0
Content-Type: application/json
Body: {
"company" : âOracleâ,
"$or" : {"$startsWith" : {"name": "Melissa"}}}
select "JKEY",âVERSION", "LAST_MODIFIEDâ, âCREATEDâ
from "SCOTT".âCUSTOMERS"
where JSON_EXISTS(
"JVALUE",
'$?( $.company == $B0 && ( $.name starts with $B2))'
PASSING âOracleâAS "B0" ,âMelissaâAS âB1â)
{
"items": [ {
"id": "09615A98B2B941AF94D84FD44D04AB9C",
"etag": "D78FBD⌠B879E",
"lastModified": "2015-02-10T01:15:13.631231â,
"created": "2015-02-10T01:15:13.631231â
}, ⌠{more records...}
],
"hasMore": true,
"count": 4,
"offset": 0,
"limit": 4
}
RESTSQLJSON
97. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
SODA For Java
⢠Provides:
â Connection to the database
(replaces JDBC!)
â Collection Management
â CRUD operations
â Query-by-Example
â Utility and control functions
⢠SODA for Java applications can
use a JDBC connection to talk to
the database
⢠SODA for Java is transactional
â Supports Hybrid model with JDBC
and SODA based operations
97
Native library for Java
// Create a Connection
OracleRDBMSClient client = new OracleRDBMSClient();
OracleDatabase database = client.getDatabase(conn);
// Now create a collection
OracleCollection collection =
database.getDatabaseAdmin().createCollection(âMyCollectionâ);
// Create a document
OracleDocument document = database.createDocumentFromString("{
âname" : âAlexanderâ }â);
// Next, insert it into the collection
OracleDocument insertedDocument = collection.insertAndGet(document);
// Get the key of the inserted document
String key = insertedDocument.getKey();
// Get the version of the inserted document
String version = insertedDocument.getVersion();
98. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
SODA For REST
⢠Standard REST based model
⢠CRUD operations map to HTTP Verbs
â Create / Update : PUT / POST
â Retrieve : GET
â Delete : DELETE
⢠Other operations, such as Query by
Example, Bulk Insert and Indexing are
mapped to variants of POST
⢠JSON document forms the payload of
the HTTP Request or Response
⢠Stateless model, no transaction
support
⢠Implemented as a Java Servlet
98
Can be invoked from any programming language
GET /DBSODA/schema List all collections in a schema
GET
/DBSODA/schema/colle
ction
Get all objects in collection
GET
/DBSODA/schema/colle
ction/id
Get specific object in collection
PUT
/DBSODA/schema/colle
ction
Create a collection if necessary
PUT
/DBSODA/schema/colle
ction/id
Update object with id
POST
/DBSODA/schema/colle
ction
Insert object into collection
POST Find objects matching filter in
99. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
SODA For REST Architecture
99
Clean architecture
ď§ Data stored in Oracle Database as JSON documents
ď§ App Developer make standard HTTP(S) calls to SODA for REST API
Oracle DatabaseHTTP(S) client
Oracle REST Data Services
SODA 4 REST Generated SQL
Transform JSONPass thruJSON JSON
URI
JAVA Container
100. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Summary
100
101. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Problems to Solve With Microservices
101
Many, very sticky problems to solve
102. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Microservices Adoption Patterns
102
Start with a monolith
Adopt Microservices
(Only if the monolith gets too big and
youâve met the other prerequisites)
103. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Microservice Takeaways for Enterprises
103
The term âmicroservicesâ is probably a passing fad, but there is real business value
Technical Prerequisites
Ability to Execute
Time | Competency | Resources
Architectural Prerequisites
Non-technical Prerequisites
Constraints:
104. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved.
Remember: Microservices Are Not a Silver Bullet
"There is no single development, in either
technology or management technique, which by
itself promises even one order of magnitude
[tenfold] improvement within a decade in
productivity, in reliability, in simplicity.â
"We cannot expect ever to see two-fold gains every
two years" in software development, like there is in
hardware development (Moore's law)
104
Itâs probably best to stick with monoliths
105. Copyright Š 2016, Oracle and/or its affiliates. All rights reserved. 105
Editor's Notes
Always get the latest copy of this deck from: http://my.oracle.com/content/groups/public/@empl/@pd/@fmw/@appgrid/documents/webcontent/cnt2512053.pptx
v8 ⌠Published January 28th 2016
Questions? Comments? kelly.goetsch@oracle.com
Like the Boeing 787, microservices are designed, built, and tested off-site in many different pieces before being assembled into a single cohesive application
Can use fully featured products, like WebLogic and Oracle DB.
The first three Oracle Management Cloud Services were launched at Oracle OpenWorld 2015. They are the Application Performance Monitoring Cloud Service, the Log Analytics Cloud Service and the IT Analytics Cloud Service.
These services can be consumed individually but are especially powerful when used together.
More IT Operations-focused Oracle Management Cloud services will be introduced over time.