Você está na página 1de 20

7XijhWYj

Cloud comutinq is a model that orqanizations can exloit in order to reduce costs, increase exibility, and
reduce risk. lt can be used to host alications ranqinq from the business critical to those needed to satisfy
shortterm needs. when decidinq whether and how to move an alication to the cloud, it's imortant to make
an accurate assessment of whether the ste would yield the exected benets. 0nce it is determined that an
alication can run in the cloud, a second assessment can be made to determine whether it can be further
otimized to harness the enerqy of the cloud. lhis white aer resents a methodoloqy for determininq when
and how to refactor alications for cloud comutinq environments.
EFJ?C?P?D=7FFB?97J?EDI
<EH9BEK:9ECFKJ?D=
;DL?HEDC;DJI
white laer
November zoo
Sun Microsystems, lnc.
IVWaZd[8dciZcih
>cigdYjXi^dc################################################################################################### &
8enets of cloud comutinq ................................................................................ i
kisks of cloud comutinq ..................................................................................... z
keducinq risk ......................................................................................................
9Zc^i^dch##################################################################################################### )
Comatible with the cloud ..................................................................................
kuns in the cloud ................................................................................................
0timized for the cloud .......................................................................................
latterns ............................................................................................................. b
BZi]dYdad\n################################################################################################# -
lrocess overview ................................................................................................ 8
Lxamle: twotier web service ........................................................................... io
lnitial assessment ......................................................................................... io
0timize throuqh refactorinq......................................................................... io
0timize further ........................................................................................... ii
Summary ..................................................................................................... iz
Lxamle: enterrise database cluster ................................................................. i
lnitial assessment ......................................................................................... i
0timize throuqh refactorinq......................................................................... i
0timize further ........................................................................................... ib
HjbbVgn##################################################################################################### &,
Acknowledqments ............................................................................................ i/
Sun Microsystems, lnc. i 0timizinq Alications for Cloud Comutinq Lnvironments
Chater i
>cigdYjXi^dc
Cloud comutinq is information technoloqy - includinq server, storaqe, network,
and even software technoloqy - that is rovided as a service or alication over
the network. lhe technoloqy most often takes the form of infrastructure, latform,
or software as a service. 0ne of the more rominent features of cloud comutinq
environments is that they include an All for maniulatinq them. lhis is a owerful
feature that romotes a level of exibility far beyond what is tyically rovided by
enterrise datacenters. lhe ability to roqram infrastructure itself is one of the
caabilities that allows the develoment of dynamic environments that can be
created, scaled, udated, or destroyed in minutes rather than the hours, weeks, or
months that the same tasks in a hysical infrastructure would require.
lhe roqrammable nature of cloud infrastructure itself makes it useful for
alications ranqinq from overniqht batch |obs that use a larqe number of server
resources in arallel to solve a roblem in a short time, to familiar multitier web
server environments that ersist for lonq eriods of time. Cloud comutinq qives
ll orqanizations more exibility in terms of where alications run. lhis is due in
art to the standard latforms that cloud roviders offer and also to the ackaqinq
disciline that cloud comutinq imoses on develoers. Now a comany miqht run
its alications in an enterrise datacenter, in the cloud, in multile clouds, or in a
hybrid architecture that uses both.
Likewise, there is a sectrum of cloud comutinq imlementations. Clouds may
be imlemented by service roviders (ublic clouds) or in enterrise datacenters
(rivate clouds) that allocate a larqe number of resources and caabilities so that
alications can scale from one to thousands of servers in a short time. Lmerqinq
models such as virtual datacenters allow customers to reserve caacity and work
with dedicated resources within a cloud, increasinq the ability to manaqe costs
and service levels. Hybrid clouds can further otimize benets to an orqanization
by combininq the needed elements of ublic clouds, rivate clouds, and enterrise
datacenter technoloqy.
7ZcZihd[XadjYXdbeji^c\
Cloud comutinq can offer many lonqterm benets. 0eendinq on the use case, ll
orqanizations usinq cloud comutinq have the otential to cature some or all of
the benets of reduced cost, reduced caital risk, increased exibility, and qreater
business aqility.
Sun Microsystems, lnc. z 0timizinq Alications for Cloud Comutinq Lnvironments z
keJuceJ cost throuqh a aybythesi model where the customer is billed only for
the comute cycles, network trafc, or storaqe actually used. lhe cloud can be
used to rocess a workload surqe, or to rototye a new alication, all without
havinq to |ustify and urchase dedicated new equiment. 0ther factors can
contribute to lower cost, includinq the benets of standardization, oerational
inteqrity, consistency, and elasticity that cloud comutinq environments
encouraqe.
keJuceJ capital risl because the cloud rovider urchases the actual equiment,
not the customer. lhis shifts the risk away from the orqanizations usinq the cloud
and onto the cloud rovider. ln the case of rivate clouds, risk shifts from the
individual client orqanizations to the central ll orqanization.
lrcreaseJ exibility due to the fact that temorary and transient needs can be
satised without makinq new investments in hardware.
6reater busiress aqility due to the fact that cloud comutinq is a liqhtweiqht
mechanism for deloyinq new and existinq alications quickly. lt is the erfect
latform for deloyinq new alications, auqmentinq existinq ones by rovidinq
them with hiqher caacity, or comletely rehostinq existinq alications.
lhese benets are not absolute or quaranteed. kealizinq these benets requires
a full understandinq of the cloud comutinq environment, makinq aroriate
choices, and correctly otimizinq alications to run in it. lailinq to otimize for
the cloud can turn the benets into disadvantaqes or even risks. lor examle, an
alication that is built to automatically scale u but not to scale down can end
u increasinq costs under the ayeruse model emloyed by the cloud. Also, the
aybyuse model itself does not always mean lower costs: urchasinq and hostinq
hysical hardware, or reservinq ortions of a cloud, may yield a lower rice than a
ure aybyuse offerinq.
G^h`hd[XadjYXdbeji^c\
with the advantaqes of cloud comutinq comes risk that must be carefully evaluated
and mitiqated. Not all alications can run in the cloud, or run well in the cloud. lt
is imortant to make an informed assessment as to how aroriate the alication
is for cloud comutinq, the effort involved in otimizinq it for the cloud, and the
relative merits of the secic cloud rovider beinq considered. lhe risks include:
8usiress risl of movinq an alication into the cloud, where, for examle, service
level aqreements are not common today
4rclitectural or teclrical roaJblocls that may revent an alication from
runninq in the cloud; for examle, le system access vs. reresentational state
transfer (kLSl), cluster vs. relicated reliability models, and limited observability
Sun Microsystems, lnc. 0timizinq Alications for Cloud Comutinq Lnvironments
6ompliarce arJ requlatory issues , includinq the control over and security of
businesssecic, customer, or ersonal data
lacl oj visibility into cloud roviders' security olicies and rocesses; the level of
transarency varies from rovider to rovider
A thorouqh risk assessment miqht result in a decision not to move an alication
into the cloud, or not to otimize it for the cloud, because of the cost or the risk. lhe
qreater the risk, the more care should be taken to hel determine the alicability of
cloud comutinq and the aroach for miqratinq the alication to the cloud.
lor examle, a database manaqement system that contains businesscritical data
may not be worth the business risk of movinq it from an enterrise datacenter into
the cloud. Lven if such a move were desirable, technical roadblocks miqht make
it imossible to do so. And in the face of qovernment and industry requlations, an
orqanization may ut its comliance at risk by makinq such a move. lor examle, if a
storaqe cloud can store customer data from the Luroean Union in a country without
the same strinqent controls over ersonal data, the business may fail to conform to
local laws rotectinq that data.
GZYjX^c\g^h`
lhis white aer discusses an aroach for makinq an informed decision on whether
to move an alication, service, or comonent into a ublic, rivate, or hybrid cloud.
lhis aroach hels determine whether to simly ort an alication to run in the
cloud, or to take one of many stes to refactor an alication to use some of the
cloud's unique characteristics, includinq elasticity. lhe aer concentrates on the
ublic cloud, however the same techniques aly reqardless of the tye of cloud.
lhrouqh the use of examles, the aer illustrates how datacenter services miqht be
otimized to run in the cloud while helinq to address the risks.
Sun Microsystems, lnc. 0timizinq Alications for Cloud Comutinq Lnvironments
Chater z
9Zc^i^dch
lhe methodoloqy described in this aer addresses the question of takinq an
existinq, or even a leqacy alication or service, and movinq it to the cloud. lhis
aroach can be used for existinq alications and existinq atterns, and the
examles can hel develoers new to the cloud make similar decisions as they
construct new alications.
8dbeVi^WaZl^i]i]ZXadjY
An alication, service, or attern is considered to be comatible with the cloud
if no business, architectural, technical, or comliance roadblock would revent it
from beinq moved to the cloud. lhe imortant characteristic is that no architectural
chanqes are necessary for the entity to run in the cloud.
Note that this denition is not absolute. A MySQL database manaqement system
is comatible with the cloud because a virtual machine instance can be conqured
with the software and connected to a storaqe service containinq the database
contents. 8ut if the database manaqement system contains, for examle, customer
credit card information, the service may not be comatible with the cloud because
the security around the storaqe service may not be sufcient to satisfy industry
requlations.
Gjch^ci]ZXadjY
An alication, service, or attern runs in the cloud if it can be ackaqed to run in
the cloud without any imact on its functionality. lackaqinq requires a minimal
amount of otimization but it is not architectural in nature. Makinq an alication
run in the cloud involves manaqinq some of the followinq issues:
laclaqirq . Many cloud environments today rovide infrastructure as a service
(laaS), suortinq virtual machines as the deloyment model. Alication
software can be installed on runninq virtual machines, or be ackaqed within
a virtual machine imaqe as dictated by the cloud latform. lormats in use
today include Amazon web Services' Amazon Machine lmaqe (AMl), or lro|ect
0enSolaris 0ynamic Service Container ayloads.
5eljservice moJel . Cloud comutinq uses a selfservice model that deloys
services under roqrammable control. Alications can modify themselves over
time, or comletely redeloy themselves as needed. lo enable an alication to
run in the cloud, the develoer must leveraqe the selfservice model either at the
command line or usinq the cloud rovider's Alls.
Sun Microsystems, lnc. 0timizinq Alications for Cloud Comutinq Lnvironments
8irJirq time . lhe software within the virtual machine ackaqe must be able to
bind itself to a dynamic infrastructure so that any qiven instance of the virtual
machine can discover its environment and conqure itself aroriately.
virtual appliarces . Cloud comutinq uts a focus on raid develoment, and
aliances hel to turn alication develoment into more of an assembly
exercise. Aliances come in many forms, ranqinq from a simle oeratinq system
installed in a virtual machine imaqe to a latform for creatinq social networkinq
sites (for examle, a 0rual aliance).
liqure i illustrates an alication ackaqed for the cloud with a bindinq time issue
that must be resolved. lhe alication is ackaqed in a virtual machine imaqe
startinq from an aliance that inteqrated the 0enSolaris oeratinq system with
the Sun 6lasslish alication server. lhe develoer installed a web server into the
virtual machine and set u its conquration les. lnside the conquration le is a
static reference to an ll address iz.ib8.8.8, a rivate ll address that may or may
not exist in the deloyment environment. lo be able to run this ackaqed alication
in the cloud, the develoer must adat the static ll address bindinq to one that can
be established when the virtual machine boots.
L:7H:GK:G
6EEA>6C8:
8DC;><JG6I>DC
192.168.8.8
8JHIDB>O6I>DC
liqure 1. 4r applicatior ircorrectly paclaqeJ jor tle clouJ Jue to a static ll aJJress
birJirq.
Dei^b^oZY[dgi]ZXadjY
An alication, service, or attern is otimized to run in the cloud when it takes
advantaqe of the unique characteristics of the cloud, makinq a functionality or
servicelevel imrovement as a result. lhe amount of otimization is driven by a
cost/benet analysis. lhe unique characteristics of the cloud include:
A hiqhly arallel infrastructure that can hel horizontally scaled, or scale out"
alication architectures achieve massive scale. Many traditional enterrise
alications are built usinq a vertically scaled architecture that scales only to a
oint. lhe cloud suorts a horizontally scaled model in which an alication can
Sun Microsystems, lnc. b 0timizinq Alications for Cloud Comutinq Lnvironments
use literally thousands of servers in order to accelerate a |ob. lhe challenqe for
those otimizinq alications for the cloud is to most effectively transition to a
more arallel, horizontally scaled model.
lhe ondemand, aybythesi model enables imlementations that would be
imossible with hysical infrastructure, for examle scalinq to thousands of
servers in a matter of days. lhis infrastructure can be dismantled as quickly as it
is created, helinq to cut costs when the workload requirements do not require a
fully scaled infrastructure. lhe model also qives orqanizations more exibility, for
examle, to erform larqe batchstyle tasks in the cloud without affectinq existinq
alications or havinq to reallocate dedicated servers for the task.
lhe more that alications can be decomosed and refactored at a functional level,
the more they have the otential to benet from runninq in the cloud. lor examle,
an alication comonent that includes a MySQL database runninq on the Solaris
0eratinq System can be miqrated directly to the cloud. Usinq an SQL cloud service
instead is an examle of a functional decomosition and miqration that can yield
additional benets (deendinq on the circumstance).
EViiZgch
latterns describe the relationshi amonq the comonents used to deliver an
alication or service. lhere are a number of different atterns used throuqhout the
alication lifecycle, includinq:
5olutior arclitecture patterrs that are used in the initial architecture hase.
lhey take alication requirements as inut, and roduce a serviceoriented
architecture as outut.
Microarclitecture patterrs that assemble services (described by atterns) into
hiqherlevel comonents that can be used to imlement the alication. lor
examle, email, messaqinq, 0omain Name Service (0NS), and directory services
are all microarchitecture atterns that combine to make a larqer service rovider
architecture.
8uilJ patterrs that transform the loqical descrition to the hysical. ln the real
world, they take the list of comonents and roduce a bill of materials. ln the
cloud world, they secify the resources that are required, alonq with how the
resources are bound into an infrastructure that is built at run time. 8uild atterns
of articular use in the cloud are web functional atterns and cloud rovisioninq
atterns.
0ptimizatior arJ maraqemert patterrs that hel once an alication is
deloyed. lhey use olicies, such as servicelevel aqreements, and roduce
chanqes to atterns and instances of them.
Sun Microsystems, lnc. / 0timizinq Alications for Cloud Comutinq Lnvironments
0timization and manaqement atterns are amonq the most imortant for cloud
comutinq because they rovide quidance on how to best utilize the cloud's
elasticity, helinq business orqanizations increase exibility and aqility while
reducinq costs.
Sun has undertaken the challenqe of creatinq a set of cloud atterns that are oen
for community use and review. locusinq on otimization and manaqement atterns
and leveraqinq the exerience of others, these cloud atterns hel architects save
time and resources, avoid itfalls, reduce maintenance costs, increase reuse, and
increase business exibility and aqility by shorteninq develoment time.
lhe cloud comutinq atterns that aear on Sun's wiki include a siqnicant amount
of detail includinq diaqrams of the comonents and their interactions, a sequence
diaqram that illustrates the relative timinq of the interactions, and a ow diaqram
that illustrates how the attern miqht be imlemented usinq seudocode.
lhe atterns discussed in the context of this aer are build atterns that illustrate
virtual machines and their loqical relationshis. lor examle, a simlied twotier
web service attern is illustrated in liqure z.
96I676H:
L:7H:GK:G
6E68=:
L:7H:GK:G
6E68=:
L:7H:GK:G
6E68=:
liqure z. !wotier web service patterr.
Suerosition is the way in which larqer atterns are built by combininq smaller
microarchitecture atterns. lor examle, the twotier web service attern uses both
horizontal scalinq for its web servers, and vertical scalinq for its database server.
Lach of these asects are their own atterns. Likewise, larqer atterns such as a
messaqinq service, email service, and 0omain Name Service (0NS) can be combined
into an even larqer service rovider attern.
lor more irjormatior or 5urs clouJ
patterrs worl, please rejer to tle wili
at: lttp:wilis.sur.comJisplayclouJ
latterrs
Sun Microsystems, lnc. 8 0timizinq Alications for Cloud Comutinq Lnvironments
Chater
BZi]dYdad\n
lhe methodoloqy described in this chater hels to determine whether an existinq
alication is comatible with the cloud, can run in the cloud, or can be otimized
for the cloud. lhe methodoloqy focuses on atterns, where a attern miqht model
all or art of an existinq alication. lhe methodoloqy hels to devise strateqies for
movinq alications into the cloud and understandinq the benets that result. As
the examles of usinq the methodoloqy will show, alications can be decomosed
into their essential atterns. lhen the atterns, rather than the alication, can be
assessed.
EgdXZhhdkZgk^Zl
lhe methodoloqy involves rst evaluatinq where a attern falls in the sectrum
of cateqories illustrated in liqure , and then assessinq whether it is ractical
to otimize the attern and move it to the riqht. lhe rst ste in the rocess
is assessinq the existinq instance; the subsequent stes involve assessinq the
attern's functions and whether they can be decomosed and erhas recomosed
(refactored) to more fully otimize the attern for use in the cloud.
lhe farther riqht in the qure that a attern can be moved, the more that it is
otimized for the cloud and can exloits the cloud's benets. liqure illustrates that
there are several ossibilities for how atterns move alonq the sectrum:
A dashed black line illustrates where the attern lands after an initial assessment,
with no structural chanqes made. lhe attern instance may have oerational
chanqes made to allow it to run in the cloud, includinq ackaqinq it as a virtual
machine, ossibly basinq it on an aliance, chanqinq bindinq to be dynamic, and
utilizinq the selfservice deloyment nature of the cloud.
A solid qreen line indicates the case where a attern can be otimized so that
it can more fully utilize the benets of the cloud. 0timization often involves
decomosinq a attern or alication at a functional level and then recomosinq
it in a new way that more fully exloits the nature of cloud comutinq.
lhere are many levels at which a attern can be otimized for the cloud. lt can
be adated to use the massive arallelism of the cloud. lt can very closely match
its resource consumtion characteristics to its workload, otimizinq around the
aybythesi billinq model. lt can be refactored to automatically deloy and scale
itself, and to comletely redeloy itself (rather than atch) when chanqes are
made to the alication.
linally, other atterns can be substituted where aroriate, for examle the use
of Hadoo rather than a traditional database manaqement system.
4pacle laJoop is a jrameworl built to
support JistributeJ applicatiors tlat
process larqe amourts oj Jata. lt combires
iJeas jrom tle 6ooqle MapkeuJuce
alqoritlm arJ tle 6ooqle lile 5ystem {6l5}
Sun Microsystems, lnc. 0timizinq Alications for Cloud Comutinq Lnvironments
HI6GI
6HH:HH
E6II:GC
IG69>I>DC6A
>C8DBE6I>7A:
8ADJ9
GJCH DEI>B>O:9
G:;68IDG
G
:
;
6
8
I
D
G
G:;68IDG
&
'
(

liqure {. !le more tlat a patterr car be moveJ to tle riqlt ir tle spectrum, tle
more tlat it car exploit tle berejts oj clouJ computirq.
lhe sectrum illustrated in liqure is continuous, not discrete: the more that a
attern can be otimized for the cloud, the further it moves to the riqht in the
qure. A attern that reaches a cloud nirvana" miqht use many instances of
the attern across many clouds, scalinq itself dynamically and solvinq the data
hysics issues that resent themselves. lhe result is qeoqrahic scalability with
inherent hiqh availability and likely lower cost than a traditional deloyment.
A dotted red line indicates an antiattern, illustratinq the fact that there is some
roadblock that revents a movement to the riqht, secically one that should
be resected. lhe ossibilities include: business risk, architectural or technical
roadblocks, requlatory or comliance issues.
ln the examle noted as i, a attern is determined to run in the cloud with only
some ackaqinq chanqes, and it can be refactored further to otimize its use of the
cloud. ln the examle noted as z, a attern that is initially assessed as incomatible
with the cloud can later be refactored so that it can run in the cloud. ln the examle
noted as , a attern that is assessed as incomatible with the cloud is revented
from runninq in the cloud and noted with an antiattern. An examle of this
situation is a qovernment or industry requlation that laces restrictions on the use of
data. lf a cloud rovider cannot rovide a servicelevel aqreement that satises the
requlatory requirements, then that data cannot be stored by the rovider .
An antiattern is not absolute because of the chanqinq offerinqs of cloud service
roviders. Some roviders, for examle, are offerinq visibility into their datahandlinq
olicies so that datahandlinq standards can be met. A further ste could be taken
Sun Microsystems, lnc. io 0timizinq Alications for Cloud Comutinq Lnvironments
by offerinq a layment Card lndustry (lCl) 0ata Security Standard (0SS)comliant
latform as a dedicated, not virtualized, cloud service in order to enable customers
to build cloud alications that can be lCl 0SS comliant.
:mVbeaZ/ild"i^ZgLZWhZgk^XZ
Consider how we miqht aly the methodoloqy to the simlied twotier web service
illustrated in liqure z. lo simlify the discussion, the loadbalancinq mechanism that
would manaqe incominq trafc is omitted from the attern.
>c^i^VaVhhZhhbZci
An initial assessment of the attern shows that it can run in the cloud. lndeed, the
attern as illustrated shows a horizontally scaled set of web servers all accessinq a
MySQL database, with each of the comonents deloyed as virtual machines in an
infrastructure as a service (laaS) environment.
lhis is the oint at which it is useful to assess the role of data in the attern. 0ata
is not only stored by the MySQL database - it also moves from the database to the
web servers. 0eendinq on the orqanization's datahandlinq olicies that aly to
the data, the assessment miqht chanqe to incomatible."
Dei^b^oZi]gdj\]gZ[VXidg^c\
Now assess whether the attern can be otimized and symbolically moved to
the riqht in the model. As shown, the twotier web service has a xed number of
web servers and a sinqle backend database. lts scalability is limited, and so is the
workload that it can handle. 0ne of the benets of the cloud is the elasticity that
allows alications to scale u and down as needed, all roqrammatically.
lhe attern can be otimized for the cloud by enablinq it to take advantaqe of the
cloud's elasticity. An external monitorinq service can watch each virtual machine's
resource consumtion and/or resonse time characteristics to hel decide whether
the web server tier or the database server tier should scale u (liqure ). lhis
attern is called oll watchdriven elasticity," and is one of the atterns that Sun
has articulated as one of its communitybased cloud atterns.
lhe alication, or the aqent causinq the scalinq to occur, would have to take
different criteria into account deendinq on the tier to be scaled:
lhe web server tier can scale u and down as needed so lonq as the web servers
have minimal state. lhis ability to scale u and down uses the cloud's elasticity to
meet service levels. when it scales u, it increases cost only for the time that the
number of web server instances has increased. As it scales down, the aybyuse
costs are shed. lhe web server tier needs to be aware of whether the database
tier has scaled, as it may have to chanqe how it makes queries.
lor a Jiscussior oj tlis patterr, please rejer
to lttp:wilis.sur.comJisplayclouJ
lollwatclMoritorirq
Sun Microsystems, lnc. ii 0timizinq Alications for Cloud Comutinq Lnvironments
L:7H:GK:G
6E68=:
L:7H:GK:G
6E68=:
L:7H:GK:G
6E68=:
96I676H: 96I676H: 96I676H:
G:HDJG8:
BDC>IDG>C<
6C9B6C6<:B:CI
G:EA>86I:9
###
H=6G9:9
6"> ?" F G" O
###
liqure . !le twotier web service car be optimizeJ jor tle clouJ by erablirq it to
scale up arJ Jowr baseJ or resource corsumptior arJor perjormarce metrics.
lacl tier uses a Jijjerert teclriue jor scalirq.
lhe database server tier would scale u as either the size of the database or the
workload demands on it cause a erformance limit to be reached. lerformance
could be limited by saturatinq resources includinq ClU utilization or storaqe
system throuqhut. while an enterrise database miqht be hosted on a
commercial database manaqement system on a server offerinq a hiqh deqree of
vertical scalability, an oensource database manaqement system hosted in the
cloud can be limited in vertical scalability and miqht need to address bottlenecks
throuqh horizontal scalinq.
0atabase manaqement systems can be scaled in the cloud by artitioninq,
or slarJirq their data so that it is distributed across a number of database
manaqement system instances. lor examle, a sinqle database manaqement
system hostinq data for customers whose last names beqin with letters from A-Z
could be artitioned into three instances, one each hostinq names from A-l, }Q,
and kZ. lhis artitioninq could reeat to reduce qranularity as needed. Shardinq
requires effort (ClU, elased time, ossible data movement), and it can increase
an environment's comlexity.
Dei^b^oZ[jgi]Zg
Now assess whether additional features of the cloud could be exloited to further
enhance the alication's characteristics includinq erformance, scalability, cost, or
risk.
ln the case of this alication, the comlexity of the database server tier could be
outsourced to a thirdarty cloud database service (liqure ). lhis would allow a
third arty to handle the comlexity of storinq the data and otentially simlify the
deloyment and imrove erformance.
Sun Microsystems, lnc. iz 0timizinq Alications for Cloud Comutinq Lnvironments
L:7H:GK:G
6E68=:
L:7H:GK:G
6E68=:
L:7H:GK:G
6E68=:
G:HDJG8:
BDC>IDG>C<
6C9B6C6<:B:CI
8ADJ9
96I676H:
H:GK>8:
liqure . kejactorirq jurtler to use a clouJbaseJ Jatabase maraqemert service.
Another otimization that could be considered is to use Hadoo to add a massive
amount of horizontal scalability to the database query rocess. lhis reresents a
functional refactorinq from a tyical database manaqement system to a arallelized,
treestructured aroach usinq a dynamic infrastructure.
HjbbVgn
lhe assessment ath for this alication can be summarized as shown in liqure b.
lhe twotier web service attern can run in the cloud unchanqed, however it can
further be refactored to be otimized for the cloud. lt could then be otimized
further by usinq a cloud database service or the Hadoo model.
HI6GI
6HH:HH
IG69>I>DC6A
>C8DBE6I>7A:
8ADJ9
GJCH DEI>B>O:9
G:;68IDG
8ADJ9
96I676H:
H:GK>8:
=69DDE
liqure 6. !le assessmert patl jor a twotier web service.
Sun Microsystems, lnc. i 0timizinq Alications for Cloud Comutinq Lnvironments
:mVbeaZ/ZciZgeg^hZYViVWVhZXajhiZg
Lnterrise alications often deend on a central database that contains much
of a business orqanization's oerational data. Lach alication uses the database
manaqement system to store all of its data, and a contentdelivery network rovides
efcient access to those alications (liqure /). lhis examle exlores whether and
how the central database functions could be moved to the cloud.
8
D
C
I
:
C
I
9:A>K:GNC
:
I
L
D
G
@
8A>:CIH
6
E
E
A
>
8
6
I
>
D
C
6
E
E
A
>
8
6
I
>
D
C
6
E
E
A
>
8
6
I
>
D
C 6
E
E
A
>
8
6
I
>
D
C
96I676H:
B6C6<:B:CI
HNHI:B
liqure 7. lrterprise applicatiors are baseJ or a certral Jatabase maraqemert
system
8ecause of the workload laced on the database manaqement system and the
imortance of the data to business oerations, the software is often hosted on a air
of hiqhly scalable, symmetric multirocessor servers in a clustered conquration.
ln the case of hiqhly stateful database software, the cluster uses an active/standby
conquration such as that suorted by Sun Cluster software. As liqure 8 illustrates,
the two servers are connected by a redundant air of heartbeat connections, and
both servers access a shared storaqe device that is sometimes referred to as a
uorum Jevice. lhe quorum device is used as a decidinq vote to avoid slitbrain
syndrome so that, in the event that the active server in the cluster fails, the backu
server can take over with minimal interrution.
>c^i^VaVhhZhhbZci
lhere are a number of reasons why such a core database should not and cannot be
moved into a cloud environment.
8ki_d[iiheWZXbeYai
lhe qoal of usinq a clustered database is to maximize data availability. Any miqration
to a cloud environment should assess whether the same level of availability can be
rovided. Unless the cloud imlementation satises the business requirements for
availability, this miqration should not occur.
Sun Microsystems, lnc. i 0timizinq Alications for Cloud Comutinq Lnvironments
96I676H: 96I676H:
FJDGJB
9:K>8:
liqure 8. !le core Jatabase tlat supports mary erterprise applicatiors rurs or a
clustereJ pair oj servers arJ it uses a uorum Jevice.
lt can be arqued that the business risk of uttinq a comany's most recious data
into a cloud environment is too hiqh. Not only is the data in someone else's hands,
it is not as easy to verify that the cloud rovider can and does rotect its customer's
data to the same extent that the business itself does. loday, many cloud roviders
do not rovide transarency into the security asects of their business. 0o they
exercise strict hysical control over their datacenters, disk drives in storaqe systems,
backu taes, and networks? when customers delete data, do they also scrub it
from their disks? lhe answers to these questions are not clear, so the risk cannot be
assessed accurately. An equal risk is the business viability of the cloud rovider itself:
if the cloud rovider suddenly les for bankrutcy, what haens to its customers'
businesscritical data? 0r what if the business wants to chanqe cloud roviders?
J[Y^d_YWbheWZXbeYai
lhere are numerous technical roadblocks that would revent the cluster attern
from oeratinq in a cloud environment, whether a ublic or rivate cloud:
!raJitioral clusterirq moJel . A traditional clustered system needs shared storaqe
to use as a quorum device. lhis shared storaqe must have semantics that include
lockinq. lhis is a secic requirement that revents traditional clusters from
runninq in the cloud. while some cloud roviders may offer services that would
allow secic cluster imlementations to work, it is likely that clusterinq software
will adat to the cloud before roviders offer the secial features they need.
liqlspeeJ irtercorrect . A cluster needs to have a dedicated, hiqhseed, low
latency interconnect between its members. lwo virtual machines in a cloud could
be interconnected usinq searate vLANs, but latency can be variable because
customers have no control over the hysical lacement of their virtual machines.
Nor do they have control over the nature of the network link between them.
5calability . lhe standard virtual machine suorted by cloud environments is
tyically limited to a xed maximum number of ClUs. when movinq an enterrise
database manaqement system currently runninq on a Sun server with b quad
core SlAkCb rocessors, a direct movement to a virtualized, x8barchitecture
environment could mean a dramatic loss in erformance.
Sun Microsystems, lnc. i 0timizinq Alications for Cloud Comutinq Lnvironments
4vailability . lhe connectivity between an enterrise datacenter and a ublic
cloud rovider needs to be considered. lf a comany's oerations deend on
connectivity over the lnternet to a ublic cloud rovider, and connectivity is lost
or imaired, so is the comany's oerations. lhis level of availability is likely to be
insufcient, esecially qiven that connectivity on the lnternet can be imaired due
to conditions beyond any rovider's control, includinq cable cuts and denialof
service attacks.
?dYecfWj_Xb[m_j^j^[YbekZ
lhe assessment's bottom line is that, as the roblem is dened, and the database
manaqement system structured, movinq a database cluster to a cloud will not
deliver benets, esecially if the comany's business oerations deend on it.
8ut suose that the enterrise is consolidatinq multile alication silos in favor
of a shared environment that deends on the central database. More and more
alications now deend on the database manaqement system - but it has reached
the a scalability limit. lhe comany has a budqet for the aybythesi cloud
comutinq model, but not for the caital cost of a new, larqer server.
Dei^b^oZi]gdj\]gZ[VXidg^c\
lf the database manaqement system cannot run in the cloud or be otimized for
the cloud due to both business and technical issues, is there a way to refactor the
attern to address the scalability roblem?
when a centralized system is limited in its transactional throuqhut, cachinq is a
standard aroach for ofoadinq and decentralizinq the workload. lf the alications
usinq the central database erform many more reads than writes, then read cachinq
is a solution, and the cache can be imlemented in the cloud desite the limited
scalability of each virtual machine. ln order to use a cache for an enterrise database
manaqement system, a business decision must be made reqardinq what data can
be relicated, cached, and otentially allowed to be stale. lor examle, an online
merchant miqht cache roduct availability information, takinq the risk that when a
urchase transaction is committed the roduct may no lonqer be available.
lhe solution resented in liqure illustrates how a cache for the enterrise database
can be moved into the cloud, and a vertical scalinq roblem turned into a horizontal
scalinq challenqe. lhe basic architecture leaves the database cluster in the
enterrise datacenter, but it reduces the demand on the database by establishinq
a cloudbased cache that contains data relicated from the database on a eriodic
basis. Lnterrise alications can access the cloudbased cache from the enterrise
datacenter (if the secic alication is not hosted in the cloud), or from the cloud
itself (if the alication has been moved into the cloud).
Sun Microsystems, lnc. ib 0timizinq Alications for Cloud Comutinq Lnvironments
:CI:GEG>H:
96I68:CI:G
8ADJ9
G:EA>86I>DC
96I676H: 96I676H:
LG>I:EGDMN G:69868=: G:69868=: G:69868=:
liqure . 4 clouJbaseJ cacle car solve tle scalability problem witlout movirq tle
erterprise Jatabase cluster irto tle clouJ.
lhe cloudbased cache shards, or artitions, the database oerations so the cache
can be horizontally scaled and thus adated well for deloyment in the cloud:
keaJwrite slarJirq . lirst, reads are searated from writes. 0ne or more write
roxies interact with the client alications and ass on write requests to the
database cluster, ossibly asynchronously. kead transactions are handled by a set
of read caches that hold relicated data from the database.
ata slarJirq . lhere is no benet to havinq a uniform set of read roxies, each
of which must have a coherent cache of recently used records from the database.
lhis aroach alone does not reduce the number of transactions that the
database manaqement system must suort. when the database data is sharded
across a number of caches, however, then each one can serve many requests for
the same data based on a sinqle transaction with the database manaqement
system. lhis allows the cache to be scaled horizontally to handle increasinqly
larqe workloads while minimizinq the load on the source database.
0atabase records can be sharded across the read caches in a number of ways that
should be determined based on database access atterns. 0ata could be sharded
on the basis of tables, or ranqes of data within tables, or both.
Dei^b^oZ[jgi]Zg
lf the oint of the refactorinq erformed in the revious ste is to increase scalability,
then scalability can be increased further by usinq the cloud's elasticity to scale u
and down the number of read cache instances as needed to efciently service the
needs of enterrise alications while reducinq the overall load on the enterrise
database manaqement system.
Sun Microsystems, lnc. i/ 0timizinq Alications for Cloud Comutinq Lnvironments
Chater
HjbbVgn
Cloud comutinq is a model that orqanizations can exloit in order to reduce costs,
increase exibility, and reduce risk. lt can be used to host alications ranqinq from
those which are business critical to those which are needed to satisfy a shortterm or
transient need, includinq runninq a sinqle larqe |ob in the cloud.
lhere are a number of considerations to make when decidinq whether and how to
move an existinq alication or service into the cloud. lirst consider whether it is
feasible at all, or whether a technical roadblock miqht revent such a move. Also
consider whether cost or risk considerations miqht make the move imractical. lhen
determine whether the alication can run in the cloud, or whether it is, or can be,
otimized to run in the cloud. lollowinq the methodoloqy resented in this aer
should hel cloud architects make informed decisions and follow strateqies that will
hel them make the fullest use of cloud comutinq with the least risk.
6X`cdlaZY\bZcih
lhis aer was made ossible throuqh the efforts of }ason Carolan and Steve 6aede.
lhe authors would like to thank 6lenn 8runette, 6rant Holland, }ohn Stanford,
and Hal Stern of Sun Microsystems, and Michael kulf of Al&l Hostinq, for their
careful review of the aer and helful suqqestions for imrovement. lhanks to Lou
Srinqer of 8aumeister Cororation for the insiration for the second examle.
Sun Microsystems, lnc.
Sun Microsystems, lnc. io Network Circle, Santa Clara, CA o USA lhone iboboioo or i8ooSUN (/8b) web sun.com
0timizinq Alications for Cloud Comutinq Lnvironments
zoo Sun Microsystems, lnc. All riqhts reserved. Sun, Sun Microsystems, the Sun loqo, Solaris loqo, 6lasslish, MySQL, MySQL loqo, 0enSolaris, Solaris, and lhe Network is the Comut
er" are trademarks or reqistered trademarks of Sun Microsystems, lnc. or its subsidiaries in the United States and other countries. All SlAkC trademarks are used under license and are trade
marks or reqistered trademarks of SlAkC lnternational, lnc. in the US and other countries. lroducts bearinq SlAkC trademarks are based uon an architecture develoed by Sun Microsystems, lnc.
lnformation sub|ect to chanqe without notice. Sunwin # /i8z 6Nwlio8o lrinted in USA ii/o

Você também pode gostar