Loading presentation...

Present Remotely

Send the link below via email or IM


Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.



No description

삼섭 이

on 7 August 2014

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Microservice


Micro : tiny, small
Microservice : small services, each running in
its own process and communicating with
lightweight mechanisms, often an HTTP resource API.
Service : provide something
Tightly coupled
Explicit call structure
Large deploy unit
for Scale-out, entire instance increase
usually same runtime & standardized technology

Loosely coupled
complicated call structure
Small deploy unit
for Scale-out, individual service instance increase
different runtime & technology available

"Component is a unit of software that is independently replaceable and upgradeable"
And in Microservice architecture, “Service” is Component
Microservice must have
communication mechanism
Why make service as a component?
Can be deployed indepdently than libraries(usually services will contains all libraries that needs)
Service's Interface is more clear & easy to define(Not a program language interface)

usually remote call costs are expensive than in-memory function call.

so we choose proper API size(Coarser-grained? Fine-grained?) & API Design

Every single services can be runes by itself.
and, every single services communicate each other
Smart endpoints and dumb pipes
: we know target, but we don't need to know the exact passage
RESTFul API : small, light-weight, easy
Queue : reliable asynchronus process
It is not ESB
Concentrate on services's activites
Do not coordinates by central something
Do not control the flow by outer functions(ex : ESB, BPM)
Micro Data?
Decentralized Data Management
DB #1
DB #2
DB #3
DB #4
Microservices recommended every service has individual database
- case 1 : Services use different database instance over same database system
- case 2 : Services use different database system

akka. Polyglot Persistence
So.. we meet a issue.

of data model
and it cause
trasnaction issues
, because it was separated
Transaction control on separated database system was difficult
Transaction condition may change by business requirements
Higher cost for maintain data consistency
So... we accept the INCONSISTENCY.

but, we try to reduce inconsistency.
reduce the times, the cases
if this two microservices combined transaction, the former service was not ended, till latter's transaction successfully ended. this may cause scalability problem
Exception Handling : In synchronous case, when transactional exception caught, that transaction was roll-backed
Write-off : Do Nothing, accept the fails (in case, error restore cost was more expensive than costs caused by ignore the errors. )
Retry : When transactional exception caught, do not roll-back transaction and retry the errors
Compensating Action : When transactional exception caught, reset datas the most recent stable state

Design for failure
Service can fail anytime.
restore microservice
Microservice coordination
Heartbeat/Self Check
Monitoring(architectural/business relative)
External Coordinator(for health check)
External Coordinator(for health check)
how we deploy on cloud?
best practice?
and then, think about Data....
Amazon.com originally had a two-tier architecture. In order to scale they migrated to a service-oriented architecture consisting of hundreds of backend services. Several applications call these services including the applications that implement the Amazon.com website and the web service API.
The Amazon.com website application calls 100-150 services to get the data that used to build a web page.
The auction site ebay.com also evolved from a monolithic architecture to a service-oriented architecture.
The application tier consists of multiple independent applications. Each application implements the business logic for a specific function area such as buying or selling.
Each application uses X-axis splits and some applications such as search use Z-axis splits. Ebay.com also applies a combination of X-, Y- and Z-style scaling to the database tier.
Netflix , which is a very popular video streaming service that’s responsible for up to 30% of internet traffic, has a large scale, service-oriented architecture. They handle over a billion calls per day to their video streaming API from over 800 different kinds of devices.
Each API call fans out to an average of six calls to backend services.
Spring Boot
: Spring's stand-alone application development standard

Automatic configuration
Useful Spring module & plug-in
Embed Tomcat or Jetty
Easy to use - if u know Spring framework well.. :)

: Lightweight, high performance application platform for the JVM that's designed for modern mobile, web, and enterprise applications

Java, JavaScript, Ruby, Pyhton, Groovy available
Netty based

<< steal gold >>
<< steal gold >>
<< give back gold >>
it has it's own database
it has it's own database
it has it's own database
: 8081
: 8080
: 8082
1. request Gold
2. steal Gold
3. give back
@Scheduled : he always steal gold
1. High Availability
Proper number and size
2. In-Memory OO?
share/caching data
store data
3. Service coordination
4. Data consistency
5. Deploy
Service distribution?
first. we think about SOA
Microservice vs. SOA : Is it Different?
Some people like
Some people like
Microservice architecture
And others think..
is it different -_-?
in my opinion

it's concept is about the same, but service derivation and deploy unit are different
Full transcript