Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

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.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Microservice

No description
by

삼섭 이

on 7 August 2014

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Microservice

Microservice
Architecture

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
Monolithic
Tightly coupled
Explicit call structure
Large deploy unit
for Scale-out, entire instance increase
usually same runtime & standardized technology

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

Component?
"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.
Separation

of data model
and it cause
trasnaction issues
, because it was separated
Balanced!!!
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

Fail!!!
Design for failure
Service can fail anytime.
Automatic
restore microservice
Microservice coordination
Detect
Service
Failures
Heartbeat/Self Check
HA
Monitoring(architectural/business relative)
External Coordinator(for health check)
External Coordinator(for health check)
HA
how we deploy on cloud?
Transaction?
best practice?
reference
architecture?
and then, think about Data....
Start
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.
Candidates
http://microservices.io/patterns/microservices.html
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.. :)

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

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

Hobbit
SMAUG
Bilbo
Dwarf
<< 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
Spring
boot
Considerations.
1. High Availability
Proper number and size
Redundancy
2. In-Memory OO?
share/caching data
store data
3. Service coordination
Zookeeper?
4. Data consistency
MessageQueue
5. Deploy
Service distribution?
10K?
first. we think about SOA
Microservice vs. SOA : Is it Different?
http://www.infoq.com/news/2014/03/microservices-soa
Some people like
SOA
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
SOA
Microservice
architecture
Full transcript