of 86/86
B GIO DC V ĐO TO ĐI HỌC Đ NẴNG ĐỀ TI: TÌM HIỂU ĐIỆN TON ĐM MÂY, XÂY DỰNG B CÔNG C VĂN PHÒNG Giáo viên hướng dẫn: PGS.TS. Lê Tiến Thường Học viên thực hiện : Đinh Thị Hồng Nguyên Lê Anh Vũ

Thuat toan dam may

  • View
    82

  • Download
    0

Embed Size (px)

DESCRIPTION

thuat toan dam may

Text of Thuat toan dam may

B GIAO DUC VA AO TAO I HC NNG

TI: TM HIU IN TON M MY, XY DNG B CNG C VN PHNGGio vin hng dn: PGS.TS. L Tin Thng Hc vin thc hin : inh Th Hng Nguyn L Anh V Lp : K thut in t - K23

Nng, thng 01 nm 2012

Tm hiu in ton m my, xy dng b cng c vn phng

PGS.TS.L Tin Thng

MC LC1CHNG 1: M U TNG QUAN V TI................................11.1 t vn ....................................................................................................................1 1.2 Mc ch v ngha.....................................................................................................2 1.3 Cc nhim v nghin cu v thc hin.........................................................................2

CHNG 2:

C S L THUYT...........................................................1

1. Khi nim v in ton m my...................................................................................1 1.1 Cc tnh cht ca in ton m my...........................................................................1 1.1.1 Tnh t phc v theo nhu cu............................................................................2 1.1.2 Tnh truy sut din rng.....................................................................................2 1.1.3 Kh nng dng chung ti nguyn.......................................................................2 1.1.4 Kh nng co dn................................................................................................3 1.1.5 Kh nng iu tit dch v.................................................................................4 1.2 Cc c im ca in ton m my..........................................................................4 1.3 Cc vn c th c gii quyt bi in ton m my v u nhc im ca in ton m my.....................................................................................................................5 1.3.1 Cc vn c th c gii quyt bi in ton m my................................5 1.3.5 Cc u, nhc im ca in ton m my.....................................................6 1.4 Cu trc v cc dch v in ton m my.................................................................7 1.4.1 Cu trc ca mt m my in ton................................................................7 1.4.2 Cc dch v trin khai trn mt m my in ton...........................................9 1.5 Cc m hnh trin khai cloud Computing...................................................................14 1.5.1 Cc m my cng cng (Public cloud) .........................................................14 1.5.2 Cc m my ring (Private cloud) .................................................................15 1.5.3 Cc m my lai (Hybrid cloud ) ....................................................................17 1.5.4 Cc m my cng ng (Community cloud)..................................................18 1.6 So snh m hnh Cloud Computing vi m hnh Client Server..............................19 1.7 So snh Cloud Computing vi Grids Computing.......................................................20 1.7.1 M hnh thng mi (Business Model)............................................................20 1.7.2 Kin trc (Architecture)...................................................................................21 1.7.3 Qun l ti nguyn (Resource Management)...................................................23 1.7.11 M hnh lp trnh (Programming Model) ......................................................25 1.7.12 M hnh ng dng (Application Model) .......................................................26 1.7.13 M hnh bo mt (Security Model) ...............................................................26

CHNG 3: MT S GII PHP V NN TNG M MY HIN TI....................................................................................................................11. Amazon Web Services...................................................................................................1 2. Amazon Elastic Compute Cloud (EC2).........................................................................2 3. Amazon Simple DB.......................................................................................................2 4. Amazon Simple Storage Service (S3):...........................................................................3 5. Amazon Cloud Font:......................................................................................................4 6. Amazon Simple Queue Service:.....................................................................................41

Page 2

.T.Hng Nguyn + L.AnhV

Tm hiu in ton m my, xy dng b cng c vn phng

PGS.TS.L Tin Thng

7. Google App Engine.......................................................................................................5 7.1 Gii thiu:.............................................................................................................5 7.2 Cc thnh phn chnh ca Google App Engine:....................................................6 7.3 Mt s Data API ca Google App ......................................................................7 10.1 Mt s im lu khi xy dng mt ng dng trn nn Google App Engine. 10 10.2 Quy trnh pht trin mt ng dng trn Google App Engine...........................11 10.3 Demo ng dng trn Google App Engine........................................................13

CHNG 4: PHT TRIN NG DNG VN PHNG TRN WEB 1813.1 Padevents.js : Ghi li cc s kin xy ra trn Pad :.......................................24 13.2 Model.js: Cc phng thc cho php truy cp n 1 i tng pad, kim tra s tn ti ca pad v to ra 1 pad nu n cha c sn..................................................25 13.3 Chatarchive.js : X l cc thao tc khi cc client chat vi nhau.......................25 13.4 Collab_server.js: Bao gm cc phng thc xc thc User (thng qua userId), ly thng tin phin bn (pad revision), p dng cc thay i do user to ra trn pad, cp nht cc thay i do user to ra ti tt c cc client ang s dng cng 1 pad. ......26 13.5 Pad_control.js:Kim sot cc thng tin v cc tc ng trn pad , tr v default pad text : on vn bn xut hin khi to mi pad, cho php gn cc thng tin nh tn user , mu ch ng vi tng user, render mt pad, render saverevision...............28

CHNG 5: KT LUN V HNG PHT TRIN CA TI. .30

Page 3

.T.Hng Nguyn + L.AnhV

CHNG 1: M U TNG QUAN V TI

1.1 t vn Ngy nay, i vi cc cng ty, doanh nghip, vic qun l tt, hiu qu d liu ca ring cng ty cng nh d liu khch hng, i tc l mt trong nhng bi ton c u tin hng u v ang khng ngng gy kh khn cho h. c th qun l c ngun d liu , ban u cc doanh nghip phi u t, tnh ton rt nhiu loi chi ph nh chi ph cho phn cng, phn mm, mng, chi ph cho qun tr vin, chi ph bo tr, sa cha, Ngoi ra h cn phi tnh ton kh nng m rng, nng cp thit b; phi kim sot vic bo mt d liu cng nh tnh sn sng cao ca d liu. T mt bi ton in hnh nh vy, chng ta thy c rng nu c mt ni tin cy gip cc doanh nghip qun l tt ngun d liu , cc doanh nghip s khng cn quan tm n c s h tng, cng ngh m ch tp trung chnh vo cng vic kinh doanh ca h th s mang li cho h hiu qu v li nhun ngy cng cao hn. Thut ng cloud computing ra i bt ngun t mt trong nhng hon cnh nh vy. Thut ng cloud computing cn c bt ngun t tng a tt c mi th nh d liu, phn mm, tnh ton, ln trn mng Internet. Chng ta s khng cn trng thy cc my PC, my ch ca ring cc doanh nghip lu tr d liu, phn mm na m ch cn mt s cc my ch o tp trung trn mng. Cc my ch o s cung cp cc dch v gip cho doanh nghip c th qun l d liu d dng hn, h s ch tr chi ph cho lng s dng dch v ca h, m khng cn phi u t nhiu vo c s h tng cng nh quan tm nhiu n cng ngh. Xu hng ny s gip nhiu cho cc cng ty, doanh nghip va v nh m khng c c s h tng mng, my ch lu tr, qun l d liu tt. Xt trn tnh hnh hin ti, thi gian va qua, cc hng cng ngh ln trn th gii nh Microsoft, Google, IBM, Amazon, Sun,.. lin tc gii thiu v tung ra cc gii php, cng ngh v nn tng lin quan ti lnh vc o ha v in ton m my. Tiu biu nh Google ngoi cc ng dng m my vn t trc n nay vn quen thuc ca hng nh Gmail, Google Docs,.. thi gian gn y, hng cng lin tc a ra th trng cc sn phm phn cng cng nh phn mm chy trn mt h iu hnh mi c xem l tng lai ca cng nghip in ton l h iu hnh m my Chrome OS. Microsoft cng khng km cnh khi hng cng va gii thiu sn phm h iu hnh m my Windows Azure. Bn cnh cn rt nhiu cc hng khc cng tham gia vo lnh vc mi m ny. Tt c nhng iu cho thy, in ton m my l mt xu hng tt yu ca s pht trin cng ngh thng tin v s l mt trong nhng cng c hiu qu gip cho cc

Tn tc gi, LP XXX

1

Tn ti y

c nhn, doanh nghip khai thc hiu hiu qu hn na ng dng CNTT trong mi trng cnh tranh hin ti v tng lai. Tr li vi thc tin ti Vit Nam,. Nnhng nm tr li y, ngi dng v ang quen thuc khai thc cc cng c da trn nn tng m my, v d nh cc dch v th in t nn tng web (Google Mail, Yahoo Mail, Windows Live Mail,..) hay cc cng c chia s video (Youtube), cc ng dng thao tc vi hnh nh trn web (Google Picasa, Flickr, Photoshop Express,), cc cng c x l v lu tr vn bn online (Google Docs, Yoho,..), hay cc dch v ng b ha file trn mng (ASUS Webstore, Dropbox,..) thm ch nhiu h iu hnh web cng ra i v c mt s t ngi dng quan tm n cng ngh s dng. iu ny chng t rng cng ngh in ton m my v ang chim mt vai tr quan trng trong cuc sng hng ngy ca mi ngi dn Vit Nam. V c bit, chnh ph v nh nc cng c nhng k hoch, chnh sch pht trin v s dng in ton m my nh l mt phn ca chnh ph in t trong tng lai. Thy c nhng thc tin , kt hp vi nhng kin thc thu nhn c trong thi gian va qua, nhm chng em mnh dn chn v thc hin nghin cu ti: Tm hiu v in ton m my v xy dng b cng c vn phng trc tuyn

1.2 Mc ch v nghaMc tiu ca ti nhm gii quyt cc nhim v sau: Tm hiu c m hnh hot ng ca in ton m my. Nghin cu, so snh mt s nn tng, gii php o ha v m my ph bin hin ti. T rt ra mt s kt lun v th xy dng mt ng dng demo n gin chy trn mt nn tng c chn. Xy dng c mt b cng c vn phng chy trn nn web, cho php nhiu ngi cng tham gia tng tc son tho. Sn sng a ln m my.

-

1.3 Cc nhim v nghin cu v thc hin thc hin c cc mc ch trn, nhm thc hin ti gii quyt nhng nhim v sau: Nghin cu v a ra c m hnh v nguyn tc hot ng ca cc m my hin ti. Nghin cu, phn tch v tng hp v mt s nn tng cng nh gii php ng v m hin nay ca cc hng cng ngh ln v ph bin v in ton m my v rt ra c kt lun. Xy dng c mt ng dng demo n gin, chy trn nn tng m v min ph lm r c hot ng ca mt ng dng m my.

-

2

Tn ti y

-

Nghin cu, xy dng c mt ng dng vn phng tha mn cc yu cu cho php nhiu ngi cng tng tc mt lc trn 1 vn bn v sn sng a ln m my chy.

Cc chng tip theo ca ti s ln lt gii quyt cc nhim v c th trn. Chng 2: Gii thiu mt cch tng qut nht v cng ngh in ton m my, cc cng ngh o ha, m hnh v nguyn tc hot ng ca mt m my in ton. ng thi phn bit m hnh Cloud vi m hnh Client Server thng gp cng nh ch ra im khc bit gia in ton m my v in ton li (tnh ton song song). Chng 3: Nghin cu v a ra so snh mt s gii php v nn tng m my ph bin hin nay ca Google, Amazone, Microsoft. T cc so snh a ra mt s kt lun v xy dng th mt ng dng demo chy trn m my ca Google thy r nguyn tc hot ng ca m my . Chng 4: Trnh by v xy dng mt ng dng vn phng trn nn web cho php nhiu ngi cng tng tc mt lc trn cng mt vn bn. Chng 5: nh gi v kt lun nhng kt qu t c cng nh ra nhng phng hng m rng v pht trin ti, nhng nhim v cn gii quyt tip theo.

3

CHNG 2:

C S L THUYT

1.

Khi nim v in ton m my

Ni v khi nim o ha (hay in ton m my, ting Anh l Cloud Computing) hin nay tn ti rt nhiu nh ngha. Theo Wikipedia: in ton m my (cloud computing) l mt m hnh in ton c kh nng co gin (scalable) linh ng v cc ti nguyn thng c o ha c cung cp nh mt dch v trn mng Internet. Theo Gartner (http://www.buildingthecloud.co.uk/) : Mt m hnh in ton ni m kh nng m rng v linh hot v cng ngh thng tin c cung cp nh mt dch v cho nhiu khch hng ang s dng cc cng ngh trn Internet. Theo Ian Foster: Mt m hnh in ton phn tn c tnh co gin ln m hng theo co gin v mt kinh t, l ni cha cc sc mnh tnh ton, kho lu tr, cc nn tng (platform) v cc dch v c trc quan, o ha v co gin linh ng, s c phn phi theo nhu cu cho cc khch hng bn ngoi thng qua Internet. Tuy c nhiu nh ngha nh vy, nhng tu chung th in ton m my Cloud Computing l mt h phn b, cung cp cc dng ti nguyn o di dng dch v mt cch linh ng theo nhu cu ca ngi dng trn mi trng internet.

Hnh 1: Mi th u tp trung vo m my

1.1 Cc tnh cht ca in ton m myin ton m my ni chung v cc dch v v gii php cng nh nn tng chy trn nn in ton m my c cc tnh cht sau:

Tn tc gi, LP XXX

1

Tn ti y

1.1.1 Tnh t phc v theo nhu cuin ton m my c th c nh ngha mt cch n gin nh l s s dng ti nguyn tnh ton c kh nng thay i theo nhu cu c cung cp ging nh mt dch v t bn ngoi vi chi ph phi tr cho mi ln s dng. Bn c th truy cp n bt k ti nguyn no tn ti trong "m my (cloud)" ti bt k thi im no v t bt k u thng qua h thng Internet. Bn khng phi quan tm xem lm cch no cc th ang c duy tr pha trong ca m my. m my c nh gi cao v sn sng p ng cho cc nhu cu cn thit ca ng dng ca bn. in ton m my cng c th c gi l tnh ton tin ch hay l tnh ton li (grid computing). in ton m my l m hnh dch chuyn trong cch thc lm th no chng ta cung cp kin trc v kh nng m rng ca cc ng dng. Trong qu kh, cc cng ty thnh cng thng dnh thi gian qu bu v ngun lc xy dng xy dng c s h tng.

1.1.2 Tnh truy sut din rngNh trnh by trn, ngi s dng cc mi trng in ton m my khng cn thit phi quan tm n nn tng pha bn di. Mi th c xem nh trong sut vi ngi s dng v h c th truy cp vo mi ti nguyn trn m my nu c php vo bt c lc no, bt c ni u v trn bt c phng tin no cho php.

1.1.3 Kh nng dng chung ti nguyn hiu r hn v kh nng dng chung ti nguyn trn m my ta quan st hnh 2, m tcu trc n gin ca mt m my. Trong hnh ta thy, xy dng mt c s h tng phc v cho mt m my, nh cung cp dch v s dng rt nhiu nhng thit b phn cng khc nhau, nhng tt c c s dng chung v thng nht trn c s ca cng ngh o ha (Virtual technology) to ra mt kin trc o ha (Virtual Infrastructure) trn c s xy dng nn mt m my cung cp dch v. Cc kin trc phn cng ny l trong sut i vi ngi s dng v mi dch v, mi nn tng trin khai trn 1 m my u s dng chung ngun ti nguyn ny.

2

Tn ti y

Hnh 2: M hnh mt kin trc o ha s dng xy dng mt m my

1.1.4 Kh nng co dnTrong hu ht cc trng hp th cch tip cn ti nguyn mng theo kiu c (cp cng mt bng thng v dung lng s dng nht nh trn server) th s pht sinh nhng vn sau:

li mt lng ln cc ti nguyn tnh ton khng c s Bt buc mt ai phi trng gi cc my ch. Gn lin vi chi ph nng lng.

dng lm tiu tn khng gian trong cc trung tm d liu ln.

-

Vi in ton m my, cc my tnh d tha c th c a vo s

dng v c sinh li bng cch bn cho khch hng. S chuyn i ca vic tnh ton v c s h tng cng ngh thng tin vo mt tin ch, n c tc dng trong cc trng hp hoc mt s mc cho php. iu mang ngha n lc cnh tranh da trn tng hn l da trn cc ti nguyn tnh ton. Cc ti nguyn ng dng ca bn v cc h thng cng ngh thng tin th rt cn thit ( p ng nhu cu ngy cng ln cho lu tr, cho ti nguyn tnh ton, cho cc h thng nhn tin v cho cc c s d liu). Bn c th tr chi ph h tng c s ny cho nh cung cp no m cung cp gi v dch v tt

3

Tn ti y

nht. l mt tng n gin nhng cuc cch mng v t duy khng phi l hon ton mi. iu ny by gi l ng u trong cc xu hng cng ngh hin i bi v mi trng in ton m my c Amazon a ra u tin.

1.1.5 Kh nng iu tit dch vChnh nh kh nng co gin cp pht mt cch hp l ngun ti nguyn dng chung trn m cch dch v cng nh c iu tit s dng ti nguyn mt cch chnh xc v ph hp. Ly v d mt m my cung cp 2 dch v l A v B. Ti mt thi im, dch v A c nhiu ngi s dng hn dch v B. Th ti thi im m my s t ng iu tit dch v A c u tin s dng ngun ti nguyn dng chung hn so vi dch v B nhm cung cp dch v mt cch n nh, trnh tnh trng nghn xy ra trn dch v A v d tha ti nguyn trn dch v B. iu ny l hon ton hp l v thng minh.

1.2 Cc c im ca in ton m myin ton m my c cc c im sau: Nhanh chng ci thin vi ngi dng c kh nng cung cp sn cc ti nguyn c s h tng cng ngh mt cch nhanh chng v t tn km. Chi ph c gim ng k v chi ph vn u t c chuyn sang hot ng chi tiu. iu ny lm gim ro cn cho vic tip nhn, chng hn nh c s h tng c cung cp bi i tc th 3 v khng cn phi mua dng cho cc tc v tnh ton thc hin 1 ln hay chuyn su m khng thng xuyn. Vic nh gi da trn c s tnh ton theo nhu cu th tt i vi nhng ty chn da trn vic s dng v cc k nng IT c i hi ti thiu (hay khng c i hi) cho vic thc thi. S c lp gia thit b v v tr lm cho ngi dng c th truy cp h thng bng cch s dng trnh duyt web m khng quan tm n v tr ca h hay thit b no m h ang dng, v d nh PC, mobile. V c s h tng off-site (c cung cp bi i tc th 3) v c truy cp thng qua Internet, do ngi dng c th kt ni t bt k ni no. Vic cho thu nhiu c th chia s ti nguyn v chi ph gia mt phm vi ln ngi dng, cho php: o Tp trung ha c s h tng trong cc lnh vc vi chi ph thp hn (chng hn nh bt ng sn, in, v.v.) o Kh nng chu ti nng cao (ngi dng khng cn k s cho cc mc ti cao nht c th). o Ci thin vic s dng v hiu qu cho cc h thng m thng ch 10-20% c s dng.4

Tn ti y

tin cy ci thin thng qua vic s dng cc site c nhiu d tha, lm n thch hp cho tnh lin tc trong kinh doanh v khi phc tht bi. Tuy nhin, phn ln cc dch v ca cloud computing c nhng lc thiu ht v ngi gim c kinh doanh, IT phi lm cho n t i. Tnh co gin linh ng (theo nhu cu) cung cp ti nguyn trn mt c s mn, t bn thn dch v v gn thi gian thc, khng cn ngi dng phi c k s cho chu ti. Hiu sut hot ng c quan st v cc kin trc nht qun, kt ni lng lo c cu trc dng web service nh giao tip h thng. Vic bo mt ci thin nh vo tp trung ha d liu, cc ti nguyn ch trng bo mt, v.v nhng cng nng cao mi quan tm v vic mt quyn iu khin d liu nhy cm. Bo mt thng th tt hay tt hn cc h thng truyn thng, mt phn bi cc nh cung cp c th dnh nhiu ngun lc cho vic gii quyt cc vn bo mt m nhiu khch hng khng c chi ph thc hin. Cc nh cung cp s ghi nh (log) cc truy cp, nhng vic truy cp vo chnh bn thn cc audit log c th kh khn hay khng th.

1.3 Cc vn c th c gii quyt bi in ton m my v u nhc im ca in ton m my1.3.1 Cc vn c th c gii quyt bi in ton m myCloud Computing ra i gii quyt cc vn sau: 1.3.2 Vn v lu tr d liu:

D liu c lu tr tp trung cc kho d liu khng l. Cc cng ty ln nh Microsoft, Google c hng chc kho d liu trung tm nm ri rc khp ni trn th gii. Cc cng ty ln ny s cung cp cc dch v cho php doanh nghip c th lu tr v qun l d liu ca h trn cc kho lu tr trung tm. 1.3.3 Vn v sc mnh tnh ton: (cc mc nm l c nh th ny nn bt u trang mi)

C 2 gii php chnh: o S dng cc siu my tnh (super-computer) x l tnh ton. o S dng cc h thng tnh ton song song, phn tn, tnh ton li (grid computing). 1.3.4 Vn v cung cp ti nguyn, phn mm:

Cung cp cc dch v nh IaaS (infrastructure as a service), PaaS (platform as a service), SaaS (software as a service). Cc phn tip theo s i su hn v cc dch v ny.5

Tn ti y

Hnh 3: Cc dch v c th c cung cp trn nn in ton m my

1.3.5 Cc u, nhc im ca in ton m my1.3.6 u im Tnh linh ng : Ngi dng c th thoi mi la chn cc dch v ph hp vi nhu cu ca mnh, cng nh c th b bt nhng thnh phn m mnh khng mun. (Thay v phi b ra hng trm USD cho 1 b Ms office, ta c th mua ring l tng phn hoc ch tr 1 khon ph rt nh mi khi s dng 1 phn no ca n). Gim bt ph : Ngi dng khng ch gim bt chi ph bn quyn m cn gim phn ln chi ph cho vic mua v bo dng my ch. Vic tp hp ng dng ca nhiu t chc li 1 ch s gip gim chi ph u t ban u, cng nh tng hiu nng s dng cc thit b ny mt cch ti a. To nn s c lp : Ngi dng s khng cn b b hp vi 1 thit b hay 1 v tr c th no na. Vi in ton m my, phn mm, d liu c th c truy cp v s dng t bt k u, trn bt k thit b no m khng cn phi quan tm n gii hn phn cng cng nh a l Tng cng tin cy : D liu trong m hnh in ton m my c lu tr 1 cch phn tn ti nhiu cm my ch ti nhiu v tr khc nhau. iu ny gip tng tin cy, an ton ca d liu mi khi c s c hoc thm ha xy ra. Bo mt : Vic tp trung d liu t nhiu ngun khc nhau s gip cc chuyn gia bo mt tng cng kh nng bo v d liu ca ngi dng, cng nh gim thiu ri ro b n cp ton b d liu. (D liu c t

6

Tn ti y

ti 6 my ch khc nhau trong trng hp hacker tn cng, bn cng s ch b l 1/6. y l 1 cch chia s ri ro gia cc t chc vi nhau) Bo tr d dng : Mi phn mm u nm trn server, lc ny, ngi dng s khng cn lo lng cp nht hay sa li phn mm na. V cc lp trnh vin cng d dng hn trong vic ci t, nng cp ng dng ca mnh. 1.3.7 Nhc im Tnh ring t: Cc thng tin ngi dng v d liu c cha trn in ton m my c m bo c ring t, v liu cc thng tin c b s dng v mt mc ch no khc? Tnh sn dng: Liu cc dch v m my c b treo bt ng, khin cho ngi dng khng th truy cp cc dch v v d liu ca mnh trong nhng khong thi gian no khin nh hng n cng vic? Mt d liu : Mt vi dch v lu tr d liu trc tuyn trn m my bt ng ngng hot ng hoc khng tip tc cung cp dch v, khin cho ngi dng phi sao lu d liu ca h t m my v my tnh c nhn. iu ny s mt nhiu thi gian. Thm ch mt vi trng hp, v mt l do no , d liu ngi dng b mt v khng th phc hi c. Tnh di ng ca d liu v quyn s hu : Mt cu hi t ra, liu ngi dng c th chia s d liu t dch v m my ny sang dch v ca m my khc? Hoc trong trng hp khng mun tip tc s dng dch v cung cp t m my, liu ngi dng c th sao lu ton b d liu ca h t m my? V lm cch no ngi dng c th chc chn rng cc dch v m my s khng hy ton b d liu ca h trong trng hp dch v ngng hot ng. Kh nng bo mt : Vn tp trung d liu trn cc m my l cch thc hiu qu tng cng bo mt, nhng mt khc cng li chnh l mi lo ca ngi s dng dch v ca in ton m my. Bi l mt khi cc m my b tn cng hoc t nhp, ton b d liu s b chim dng v nh cung cp. Cc quy nh php lut cho cc dch v, gia khch hng

1.4 Cu trc v cc dch v in ton m my1.4.1 Cu trc ca mt m my in tonNh cp trn, cu trc vt l ca in ton m my (bao gm cc thit b, my mc chy dch v,) c xem nh trong sut i vi ngi s dng v ngi thu s dng dch v. Tuy nhin khi xt v mt cu trc nn tng th mt m my, d loi no hay do hng no cung cp th cng u c 1 cu trc chung gm 4 lp.7

Tn ti y

Hnh 4: Cu trc 4 lp ca in ton m my

Client (Lp Khch hng): Lp Client ca in ton m my bao gm phn cng v phn mm, da vo , khch hng c th truy cp v s dng cc ng dng/dch v c cung cp t in ton m my. Chng hn my tnh v ng dy kt ni Internet (thit b phn cng) v cc trnh duyt web (phn mm). Application (Lp ng dng): Lp ng dng ca in ton m my lm nhim v phn phi phn mm nh mt dch v thng quan Internet, ngi dng khng cn phi ci t v chy cc ng dng trn my tnh ca mnh, cc ng dng d dng c chnh sa v ngi dng d dng nhn c s h tr. Cc c trng chnh ca lp ng dng bao gm : o Cc hot ng c qun l ti trung tm ca m my, ch khng nm pha khch hng (lp Client), cho php khch hng truy cp cc ng dng t xa thng qua Website. o Ngi dng khng cn cn thc hin cc tnh nng nh cp nht phin bn, bn v li, download phin bn mi bi chng s c thc hin t cc m my. o Platform (Lp Nn tng): Cung cp nn tng cho in ton v cc gii php ca dch v, chi phi n cu trc h tng ca m my v l im ta cho lp ng dng, cho php cc ng dng hot ng trn nn tng . N gim nh s tn km khi trin khai cc ng dng khi ngi dng khng phi trang b c s h tng (phn cng v phn mm) ca ring mnh. o Infrastructure (Lp C s h tng): Cung cp h tng my tnh, tiu biu l mi trng nn o ha. Thay v khch hng phi b tin ra mua cc server, phn mm, trung tm d liu hoc thit b kt ni gi y, h vn c th c y ti nguyn s dng m chi ph c gim thiu, hoc thm ch

8

Tn ti y

l min ph. y l mt bc tin ha ca m hnh my ch o (Virtual Private Server) o Server (Lp Server - My ch): Bao gm cc sn phm phn cng v phn mm my tnh, c thit k v xy dng c bit cung cp cc dch v ca m my. Cc server phi c xy dng v c cu hnh mnh (thm ch l rt may) m ng nhu cu s dng ca s lng ng o cc ngi dng v cc nhu cu ngy cng cao ca h

1.4.2 Cc dch v trin khai trn mt m my in tonDa trn cu trc phn tng trn, mt m my in ton c th cung cp c cc dch v tng qut nh trong s di y.

Hnh 5: S kin trc cung cp dch v ca mt m my in ton

Cloud computing cung cp h tng, nn tng v phn mm nh l dich v, m c th c cung ng nh l mt dich v cho thu trong cch dng bao nhiu tr by nhiu i vi ngi dng. Cloud computing c hin thc theo 3 kiu: 1.4.3 Infrastructure-as-a-Service (IaaS Dch v h tng): Cung cp cho ngi dng h tng th (thng l di hnh thc cc my o) nh l mt dch v. Nhng kin trc o xp chng l mt v d ca xu hng mi th l dch9

Tn ti y

v v c cng nhng im chung. Hn hn mt my ch cho thu, khng gian luu tr tp trung hay thit b mng, my trm thay v u t mua nhng nguyn th c th thu y dch v bn ngoi. Nhng dch v ny thng thng c tnh chi ph trn c s tnh ton chc nng v lng ti nguyn s dng (v t ra chi ph) s phn nh c mc ca hot ng. y l mt s pht trin ca nhng gii php lu tr web v my ch c nhn o. Tn ban u c s dng l dch v phn cng (HaaS) v c to ra bi mt nh kinh t hc Nichlas Car vo thang 3 nm 2006, nhng iu ny cn thit. Nhng t ny dn b thay th bi khi nim dch v h tng vo khong cui nm 2006. Nhng c trng tiu biu: Cung cp ti nguyn nh l dch v: bao gm c my ch, thit b mng, b nh, CPU, khng gian a cng, trang thit b trung tm d liu. Kh nng m rng linh hot Chi ph thay i ty theo thc t Nhiu ngi thu c th cng dng chung trn mt ti nguyn

Cp doanh nghip: em li li ch cho cng ty bi mt ngun ti nguyn tnh ton tng hp Cc v d: Amazon EC2/S3, Elastra (Beta 2.0 2/2009), Nirvanix, AppNexus 1.4.4 Platform-as-a-Service (PaaS Dch v nn tng): Cung cp API cho pht trin ng dng trn mt nn tng tru tng. Cung cp nn tng tinh ton v mt tp cc gii php nhiu lp. N h tr vic trin khai ng dng m khng quan tm n chi ph hay s phc tp ca vic trang b v qun l cc lp phn cng v phn mm bn di, cung cp tt c cc tnh nng cn thit h tr chu trnh sng y ca vic xy dng v cung cp mt ng dng v dch v web sn sng trn Internet m khng cn bt k thao tc ti hay ci t phn mm cho nhng ngi pht trin, qun l tin hc, hay ngi dng cui. N cn c bit n vi mt tn khc l cloudware. Cung cp dch v nn tng (PaaS) bao gm nhng iu kin cho qui trnh thit k ng dng, pht trin, kim th, trin khai v lu tr ng dng c gi tr nh l dch v ng dng nh cng tc nhn, sp xp v tch hp dch v web, tch hp c s d liu, bo mt, kh nng m rng, qun l trng thi, phin bn ng dng, cc li ch cho cng ng pht trin v nghin cu ng dng. Nhng dch v ny c chun b nh l mt gii php tnh hp trn nn web. Nhng c trng tiu biu: Phc v cho vic pht trin, kim th, trin khai v vn hnh ng dng ging nh l mi trng pht trin tch hp Cc cng c khi to vi giao din trn nn web.

10

Tn ti y

Kin trc ng nht Tch hp dch v web v c s d liu H tr cng tc nhm pht trin Cng c h tr tin ch

Cc yu t: Thun li: Dch v nn tng (PaaS) ang thi k u v c a chung nhng tnh nng vn c a thch bi dch v phn mm ( cp sau), bn cnh c tch hp cc yu t v nn tng h thng. u im trong nhng d n tp hp nhng cng vic nhm c s phn tn v a l. Kh nng tch hp nhiu ngun ca dich v web Gim chi ph ngoi l khi tch hp cc dch v v bo mt, kh nng m rng, kim sot li Gim chi ph khi tru tng ha cng vic lp trnh mc cao to phc v, giao din ngi dng v cc yu t ng dng khc. Mong i ngi dng c kin thc c th tip tc hon thin v h tr tng tc vi nhiu ngi gip xc nh mc kh khn ca vn chng ta gp phi. Hng vic s dng cng ngh t c mc ch to iu kin d dng hn cho vic pht trin ng dng a ngi dng cho nhng ngi khng ch trong nhm lp trnh m c th kt hp nhiu nhm cng lm vic Kh khn: Rng buc bi nh cung cp: do gii hn ph thuc v dch v ca nh cung cp Gii hn pht trin: phc tp khin n khng ph hp vi yu cu ph trin nhanh v nhng tnh nng phc tp khi hin thc trn nn tng web. Cc v d: zosso (2/2008), Google App Engine, Salesforce, Heroku, Engine Yard 1.4.5 Software-as-a-Service (SaaS Dch v phn mm): Cung cp dch v phn mm thc thi t xa. Dch v phn mm (SaaS) l mt m hnh trin khai ng dng m ngi cung cp cho php ngi dng s dng dch v theo yu cu. Nhng nh cung cp SaaS c th lu tr ng dng trn my ch ca h hoc ti ng dng xung thit b khch hng, v hiu ha n sau khi kt thc thi hn. Cc chc nng theo yu cu c th c kim sot bn trong chia s bn quyn ca mt nh cung cp ng dng th ba.

11

Tn ti y

Hnh 6: M hnh Software as a Services

Nhng c trng tiu biu Phn mm sn c i hi vic truy xut, qun l qua mng. Qun l cc hot dng t mt v tr tp trung hn l ti mi ni ca khch hng, cho php khc hng truy xut t xa thng qua web. Cung cp ng dng thng thng gn gi vi m hnh nh x t mt n nhiu hn l m hnh 1:1 bao gm c cc c trng kin trc, gi c v qun l. Nhng tnh nng tp trung nng cp, gii phng ngi dng khi vic ti cc bn v li v cp nht. Thng xuyn tch hp nhng phn mm giao tip trn mng din rng Cc v d: 3Tera (2/2006), Salesforce

12

Tn ti y

Hnh 7: So snh quy trnh lm pht trin phn mm truyn thng vi pht trin da trn m my

1.4.6 Cc cch tnh chi ph trn m my nh gi c nh: nh cung cp s xc nh r c t v kh nng tnh ton c nh (dung lng b nh c cp pht, loi CPU v tc .v.v) nh gi theo n v: c p dng ph bin cho lng d liu truyn ti, dng lng b nh c cp pht v s dng, cch ny uyn chuyn hn cch trn nh gi theo thu bao: ng dng phn ln trong m hnh dch v phn mm (SaaS) ngi dng s tin on trc nh mc s dng ng dng cloud (cch tnh ny thng kh t c chnh xc cao)

13

Tn ti y

1.5 Cc m hnh trin khai cloud Computing

Hnh 8: Cc m hnh trin khai Cloud Computing

1.5.1 Cc m my cng cng (Public cloud)L cc dch v m my c mt bn th ba (ngi bn) cung cp. Chng tn ti ngoi tng la cng ty v chng c lu tr y v c nh cung cp m my qun l. Cc m my cng cng c gng cung cp cho ngi tiu dng vi cc phn t cng ngh thng tin tt nht. Cho d l phn mm, c s h tng ng dng hoc c s h tng vt l, nh cung cp m my chu trch nhim v ci t, qun l, cung cp v bo tr. Khch hng ch chu ph cho cc ti nguyn no m h s dng, v th ci cha s dng c loi b. Tt nhin iu ny lin quan n chi ph. Cc dch v ny thng c cung cp vi "quy c v cu hnh," ngha l chng c phn phi vi tng cung cp cc trng hp s dng ph bin nht. Cc ty chn cu hnh thng l mt tp hp con nh hn so vi nhng g m chng c nu ngun ti nguyn c ngi tiu dng kim sot trc tip. Mt iu khc cn lu l k t khi ngi tiu dng c quyn kim sot mt cht trn c s h tng, cc quy trnh i hi an ninh cht ch v tun th quy nh di lut khng phi lc no cng thch hp cho cc m my chung. Mt m my cng cng l s la chn r rng khi: Phn b ti workload cho cc ng dng c s dng bi nhiu ngi, chng hn nh e-mail. Bn cn phi th nghim v pht trin cc m ng dng.14

Tn ti y

Bn c cc ng dng SaaS t mt nh cung cp c mt chin lc an ninh thc hin tt. Bn cn gia tng cng sut (kh nng b sung nng lc cho my tnh cao nhiu ln). Bn ang thc hin cc d n hp tc. Bn ang lm mt d n pht trin phn mm qung co bng cch s dng PaaS cung cp cc m my.

Hnh 9: M hnh 1 m my cng cng

1.5.2 Cc m my ring (Private cloud)L cc dch v m my c cung cp trong doanh nghip. Nhng m my ny tn ti bn trong tng la cng ty v chng c doanh nghip qun l. Cc m my ring a ra nhiu li ch ging nh cc m my chung thc hin vi s khc bit chnh: doanh nghip c trch nhim thit lp v bo tr m my ny. S kh khn v chi ph ca vic thit lp mt m my bn trong i khi c th c chiu hng ngn cn vic s dng v chi ph hot ng lin tc ca m my c th vt qu chi ph ca vic s dng mt m my chung. Cc m my ring a ra nhiu li th hn so vi loi chung. Vic kim sot chi tit hn trn cc ti nguyn khc nhau ang to thnh mt m my mang li cho cng ty tt c cc ty chn cu hnh c sn. Ngoi ra, cc m my ring l l tng khi cc

15

Tn ti y

kiu cng vic ang c thc hin khng thit thc cho mt m my chung, do ng vi cc mi quan tm v an ninh v v qun l. Mt m my ring l s la chn r rng khi Vic kinh doanh ca bn gn vi d liu v cc ng dng ca bn. V vy, vic kim sot v bo mt chim phn ln cng vic. Vic kinh doanh ca bn l mt phn ca mt ngnh cng nghip phi ph hp vi an ninh nghim ngt v cc vn bo mt d liu. Cng ty ca bn l ln chy mt d liu trung tm in ton m my c hiu qu .

Hnh 10: Kin trc mt m my ring

16

Tn ti y

Hnh 11: M hnh mt m my ring

1.5.3 Cc m my lai (Hybrid cloud )L mt s kt hp ca cc m my cng cng v ring. Nhng m my ny thng do doanh nghip to ra v cc trch nhim qun l s c phn chia gia doanh nghip v nh cung cp m my cng cng. m my lai s dng cc dch v c trong c khng gian cng cng v ring. Cc m my lai l cu tr li khi mt cng ty cn s dng cc dch v ca c hai m my ring v cng cng. Theo hng ny, mt cng ty c th phc tho cc mc tiu v nhu cu ca cc dch v v nhn c chng t m my cng cng hay ring, khi thch hp. Mt m my lai c xy dng tt c th phc v cc quy trnh nhim v-ti hn, an ton, nh nhn cc khon thanh ton ca khch hng, cng nh nhng th l khng quan trng bng kinh doanh, nh x l bng lng nhn vin. Hn ch chnh vi m my ny l s kh khn trong vic to ra v qun l c hiu qu mt gii php nh vy. Phi c th nhn c v cung cp cc dch v ly t cc ngun khc nhau nh th chng c ngun gc t mt ch v tng tc gia cc thnh phn ring v chung c th lm cho vic thc hin thm ch phc tp hn nhiu. Do y l mt khi nim kin trc tng i mi trong in ton m my, nn cch thc hnh v cc cng c tt nht v loi ny tip tc ni ln v bt c d chp nhn m hnh ny cho n khi hiu r hn

17

Tn ti y

Hnh 12: M hnh mt m my lai Di y l mt vi tnh hung m mt mi trng hybrid l tt nht.

Cng ty ca bn mun s dng mt ng dng SaaS nhng quan tm v bo mt . Nh cung cp SaaS c th to ra mt m my ring ch cho cng ty ca bn bn trong tng la ca h. H cung cp cho bn mt mng ring o (VPN) b sung bo mt. Cng ty ca bn cung cp dch v c thay i cho th trng khc nhau. Bn c th s dng mt m my cng cng tng tc vi khch hng nhng gi d liu ca h c bo m trong vng mt m my ring.Cc yu cu qun l ca in ton m my tr nn phc tp hn nhiu khi bn cn qun l d liu c nhn, cng cng, v truyn thng tt c vi nhau. Bn s cn phi thm cc kh nng cho ph hp vi cc mi trng

1.5.4 Cc m my cng ng (Community cloud)L cc m my c chia s bi mt s t chc v h tr mt cng ng c thc mi quan tm chung (v d: chung s mnh, yu cu an ninh, chnh sch .. ) N c th c qun l bi cc t chc hoc mt bn th ba. Mt m my cng ng c th c thit lp bi mt s t chc c yu cu tng t v tm cch chia s c s h tng thc hin mt s li ch ca in ton m my

18

Tn ti y

Ty chn ny l tn km hn nhng c th p ng v s ring t, an ninh hoc tun th cc chnh sch tt hn.

Hnh 13: M hnh mt m my cng ng

1.6 So snh m hnh Cloud Computing vi m hnh Client ServerCloud client trong cloud computing v client trong m hnh client/server ging nhau vai tr l hin th d liu v tip nhn cc thao tc ca ngi dng, mi tnh ton nghip v u c thc hin my ch. Tuy nhin, im khc bit ln nht gia 2 m hnh ny l vic tnh ton trn my ch: Server trong m hnh client/ server thng mang ngha l 1 hoc 1 cm my ch trung tm ch lm nhim v thc hin tnh ton cho 1 s client c th (trong 1 cng ty hoc 1 t chc no ); trong khi server trong Cloud computing li mang 1 ngha rng hn nhiu. Server trong in ton m my s lm nhim v tnh ton cho bt k client no vi bt k cng vic no (m n h tr). Cng vic tnh ton lc ny khng phi thc hin theo ngha v m l theo dch v. Vi in ton m my, mi th s c cung cp di dng dch v, v ngi dng s ch phi tr ph s dng cc dch v .

19

Tn ti y

1.7 So snh Cloud Computing vi Grids ComputingKhi xem xt cc nh ngha v Clouds, Grids, Distributed Systems (DS), chng ta d dng thy rng nh ngha ca Clouds c im trng lp vi cc nh ngha ca Grids v DS. iu ny khng phi l mt vn ng ngc nhin bi v Clouds khng ra i mt cch ring l hay c lp m n da trn nn tng ca cc cng ngh trc . Hnh 14 minh ha mi lin h gia Clouds v cc cng ngh khc:

Hnh 14: Biu so snh Cloud Computing vi mt s cng ngh khc

Xt ring v 2 lnh vc l Cloud Computing v Grids Computing th c nhiu kha cnh so snh, nhng tu chung th c 6 m hnh sau y cho thy s khc nhau r nt gia cloud v grids computing

1.7.1 M hnh thng mi (Business Model)M hnh thng mi truyn thng trong cc phn mm trc y l cc hnh thc tnh ph theo mt my tnh. Trong Clouds m hnh thanh ton ph linh hot hn nhiu, ngi khch hng ch cn tr theo nhu cu s dng nh cc loi ph sinh hot hng ngy m h phi tr: in, nc, gas ..v.v. Ngoi ra Clouds cn h tr kh nng m rng h thng mang tnh kinh t, tc l ngi s dng c th trin khai vi h thng20

Tn ti y

ngy mt ln hn vi chi ph ph hp. Cc tim nng hin ca c l cc trung tm d liu ln ca cc tp on Amazon, IBM, Sun, Google ..v.v. Ngi dng trong tng lai ch cn mt th tn dng c th truy cp theo nhu cu n hng 100 000 b x l ngang qua hng chc trung tm d liu tri khp th gii. M hnh thng mi ca Grids l hng n cc d n nghin cu trong mi trng hc thut nh cc i hc, vin nghin cu, phng th nghim ca chnh ph. TeraGrid lm mt v d in hnh cho hnh thc thng mi ca Grid, n s dng hng chc Grid khc nhau t cc vin nghin cu trong cng mt quc gia. Khi mt t chc no gia nhp vo TeraGrid th s c th truy cp n cc Girds khc v ng thi c th s dng ti nguyn, kt qu th nghim trn h thng Grid ny. M hnh ny c ng dng rng ri nhiu ni trn th gii. C nhiu n lc xy dng mt Grid kinh t cho c s h tng Grid ton cu, n h tr thng mi, m phn, cung cp dch v theo nhu cu s dng, kh nng ri ro, chi ph v s thch ca ngi s dng. Nu nh cc c gng ny mang n kt qu kh quan th m hnh thng mi ca Grids v Clouds tht kh phn bit trong tng lai.

1.7.2 Kin trc (Architecture)Phn ny trnh by m hnh kin trc ca Grids v Clouds lm ni bt s khc bit trong hng tip cn ca c hai. Trong khi Grids tp trung trn vic tch hp cc ti nguyn sn c gm c phn cng, h iu hnh, c s h tng an ninh ca cc h thng th Clouds hng n cc cp khc nhau ca dch v nhm p ng ti a nhu cu ngi s dng nh SaaS, IaaS, PaaS. h tr cho vic to ra cc t chc o (Virtual Organizations) mt thc th lun l m bn trong n cc ti nguyn phn b c th c khm ph v chia s nh th trong cng mt t chc, Grids nh ngha v cung cp mt tp cc giao thc chun, phn mm c s (middleware), b cng c v cc dch v c xy dng trn tp giao thc ny. Kh nng hot ng lin kt v tnh an ton l nhng vn chnh c quan tm cho c s h tng Grids bi v cc ti nguyn c th n t cc min qun tr khc nhau, c c chnh sch s dng ti nguyn cc b v ton cc khc nhau, cc nn v cu hnh phn cng v phn mm cng khc nhau v kh nng s dng v tnh sn sng ca chng. Grids cung cp cc giao thc v dch v 5 lp khc nhau nh c minh ha bi hnh 15 Lp connectivity nh ngha cc giao tip v chng thc ct li cho qu trnh giao tc an ton v d dng qua mng. Lp resource nh ngha cc giao thc cng b, khm ph, m phn, gim st, k ton v thanh ton chi ph cho cc hot ng trn cc ti nguyn ring bit. Lp collective nm gi s tng tc ngang qua cc tp ti nguyn, dch v th mc cho php gim st v khm ph ra cc ti nguyn t chc o. Cui cng l lp application bao gm cc ng dng ngi dng c xy dng trn u ca cc giao thc.

21

Tn ti y

Hnh 15: Kin trc Grids Computing

Clouds c pht trin gii quyt nhng bi ton tnh ton m rng qua Internet trong mt s gi thit l khc bit so vi Grids. Clouds thng c xem nh l mt h tnh ton v lu tr c th c truy cp thng qua cc giao thc chun v qua mt giao tip tru tng. Tht ra Clouds c th c hin thc trn nhng cng ngh Grids tn ti hng thp nin nhng hng vo kin trc 4 lp sau: Lp Fabric gm cc ti nguyn phn cng, lp Unified Resource cha cc ti nguyn c tru tng ha c th xut hin ng nht vi ngi dng, lp Platform thm vo mt tp cc cng c, phn mm v dch v trn lp Unified Resource, lp Application l lp cha cc ng dng chy trn Clouds. Hnh 16 minh ha mt kin trc ca Clouds.

22

Tn ti y Hnh 16: Kin trc Cloud Computing

1.7.3 Qun l ti nguyn (Resource Management)Qun l ti nguyn l vn quyt nh kh nng hot ng ca h thng v ng nhin n khng th thiu trong cc h thng ln nh Grids v Clouds. Trong phn ny, cp n nhng thch thc chnh m c Grids v Clouds phi i mt thy c im tng ng v khc bit trong hai m hnh. 1.7.4 M hnh tnh ton (Compute Model): Hu ht cc Grids s dng m hnh tnh ton b (batch-scheduled compute model) cng vi mt b qun l ti nguyn cc b nh PBS, SGE, Condor qun l ti nguyn ti cc v tr khc nhau. Vi phng thc qun l ny. Grids khng th phc v tt cho cc chng trnh yu cu nhiu b x l v thc thi trong thi gian di. Chng hn trong trng hp mt chng trnh cn 100 b x l v thc thi trong 60 pht, n phi i n khi h thng c 100 b x l v rnh trong 60 pht. M hnh tnh ton trong Clouds hon ton khc, cc ngi dng c s dng ti nguyn ng thi mc d phi m bo c cht lng dch v cho ngi s dng. y cng l mt trong nhng thch thc ca Clouds v kh nng m rng v khi s lng ngi dng ln. 1.7.5 M hnh d liu (Data Model): M hnh d liu c khuynh hng trong tng lai l m hnh tng tc tam gic nh ch ra trong hnh 17.

Hnh 17: M hnh d liu Tnh ton Internet s xoay quanh m hnh d liu trn do cc nguyn nhn khch quan t thc tin. Ngi khch hng khng mun a cc d liu nhy cm hoc ti quan trng ln x l v lu tr trn Clouds. ng thi, ngi dng cng mun truy cp n d liu ring t ca h ngay khi cc giao tip mng chm hay h hng. Ngoi ra, cng ngh a nhn (multicore - technology) cng mang n cho ngi dng nhiu h thng con mnh m trong tng lai.

23

Tn ti y i vi Grids, th m hnh tnh ton tp trung vo d liu a c quan tm t sm, chng hn nh Data Grid c thit k dnh ring cho cc ng dng tp trung ln trn d liu. Do , Grids khng cn thit a ra nh hng pht trin m hnh d liu nh Clouds thay vo n c m hnh chuyn bit s dng.

1.7.6 Tnh cc b ca d liu (Data Locality): Mt thch thc chnh trong vn m rng ng dng mt cch hiu qu l v tr d liu lin quan i vi cc ti nguyn sn sng. Vic di di d liu xa v cc b x l mt cch lin tc l mt hn ch r rt, hn na qu trnh nhp xut (I/O) d liu t xa c khc bit ln vi I/O trn d liu cc b v nh hng trc tip n hiu sut ca h thng. y l mt nh hng c Clouds quan tm gii quyt. Qu trnh x l d liu l kt hp d liu lin quan v tin trnh (process) x l n trong cng mt nt (node), do vn data locality s c gii quyt mt cch hiu qu. V pha Grids, d liu c lu tr da trn cc h thng file chia s nh NFS, GPFS, PVFS ..v.v. Ni m tnh data locality khng d dng p dng, y cng l mt im yu ca Grids so vi Clouds. 1.7.7 Kt hp tnh ton v qun l d liu(Combining compute and data management): Tnh cc b ca d liu ch hiu qu khi m s lng ngi dng v qui m cha thc s ln. Khi h thng ngy cng m rng th vn kt hp tnh ton v qun l d liu tr thnh yu t quan trng cho vic ci thin hiu sut. l bi ton nh thi cng vic (job) gn vi d liu m n s dng trong sut qu trnh thc thi trnh ti a hot ng di di d liu qua mng. Girds c cc m hnh tp trung cho cc ng dng d liu khng l cn Clouds th s phi i mt vi vn ny trong tng lai. 1.7.8 o ha (Virtualization): y l cng ngh c khai thc mnh m trong hu ht cc Clouds. Khng ging nh m hnh tnh ton ca Grids, Clouds i hi chy nhiu ng dng ngi dng v tt c cc ng dng ny phi c thc hin mt cch ng thi i vi ngi s dng. Bn cnh mi ngi dng c cm gic nh l h i s hu ton b ti nguyn sn c. Cng ngh o ha cung cp mc tru tng thit yu cho vic hp nht ti nguyn nhm t c mc tiu ny. ng thi o ha cn cho php mi ng dng c th c ng gi (encapsulate) c th cu hnh, trin khai, bt u, di chuyn, tm dng, tip tc, dng hn, ..v.v. v v vy cung cp tnh c lp, kh nng qun l, bo mt tt hn. Grids khng da vo cng ngh o ha nhiu nh Clouds, nhng m bo c tnh ring t cho cc t chc o trn ti nguyn th cng ngh o ha cng c s dng trong li chng hn nh Nimbus. 1.7.9 Gim st (Monitoring): Mt thch thc khc m cng ngh o ha mang li cho Clouds l vic gim st ti nguyn. Vn gim st ti nguyn trn Clouds cha c t chc trc tip nh Grids. Grids ra cc m hnh tin cy khc nhau ngi dng c y quyn c th24

Tn ti y

truy cp cc ti nguyn khc nhau trn cc Grid khc nhau v qu tnh duyt ti nguyn ny c m bo an ton. Hn na, Grids khng c tru tng cao v tn dng o ha nh Clouds, v d cng c gim st Ganglia c th theo di cc cluster v Grids phn tn mt cch kh hiu qu v c chp nhn rng ri trong cng ng Grids. Kh nng gim st ti nguyn ca Clouds gp nhiu thch thc do mc tiu ra ca n v vic cn bng qu trnh gim st cc ng dng thng mi, qun l my ch x nghip, gim st my o, bo tr phn cng..v.v. Do trong tng lai gn Clouds s hng n vic cung cp kh nng t bo tr, cu hnh v qun l v pha ngi dng. 1.7.10 Ngun gc d liu(Provenance): y l qu trnh hng dn v ngun gc, lai lch ca cc sn phm d liu bao gm tt c cc d liu ngun, sn phm d liu trung gian, v cc th tc c ng dng vo trong sn phm d liu. Thng tin ny l cn thit hiu, khm ph, hp l v chia s cc sn phm d liu cng nh cc ng dng, chng trnh dn xut t n. Trong Grids provenance c trin khai thnh cc h thng workflow v c s dng hiu qu. Ngc li, Clouds cn cha khai thc lnh vc ny v c nhiu thch thc trong vic theo vt d liu ngang qua cc nh cung cp dch v khc nhau, ngang qua cc phn mm khc nhau v cc lp phn cng tru tng thuc mt nh cung cp.

1.7.11 M hnh lp trnh (Programming Model)Mc d m hnh lp trnh trong mi trng Grids khng c cc khc bit v c bn so vi cc mi trng lp trnh song song v phn b truyn thng. N c mt s vn phc tp nh nhiu min qun tr, ti nguyn bt ng b, hiu sut v tnh n nh, iu khin ngoi l trong mi trng c tnh linh ng cao..v.v. Mc ch chnh ca Grids l cc ng dng khoa hc i hi kh nng m rng cao, m rng n khi lng ti nguyn ln v thc thi va nhanh va hiu qu, do d cc chng trnh cn phi hon tt mt cch chnh xc nn phi xem xt n tin cy v kh nng khng li trong mi trng Grids. Ngoi cc mi trng lp trnh truyn thng nh MPI, Globus Toolkit, cn c mt mt m hnh lp trnh c quan tm gn y l MapReduce. MapReduce tht ra ch l mt m hnh lp trnh song song khc nhm vo cc h thng vi khi lng d liu ln. N c xy dng da trn hai t kha chnh l map v reduce mn t ngn ng t nhin. Chc nng map l cung cp thao tc c th ln mt tp d liu v sinh ra mt tp d liu mi. Thao tc reduce ngc li s thu gom cc d liu li. Mt hin thc m m ca m hnh ny l Hadoop v ang c quan tm trong Clouds. Clouds v khi qut chp nhn cc Web Services APIs, ni m ngi dng cu hnh v lp trnh dch v Cloud da trn cc API c trnh by trong Web Services. Cc giao thc HTTP v SOAP l nhng giao thc chun c chn trong cc dch v ny. Mc d Clouds chp nhn mt s giao thc tng qut nh HTTP v SOAP, kh nng tch hp v lin kt gia cc dch v ln ng dng vn l mt thch thc ln khi ngi s dng lm vic vi cc nh cung cp Clouds25

Tn ti y

khc nhau.

1.7.12 M hnh ng dng (Application Model)Grids mt cch tng qut h tr nhiu loi ng dng khc nhau v h tr tt cho cc ng dng hiu sut cao (high performance computing - HPC). HPC l cc ng dng song song chy trn mt h thng cc b khng phi qua internet. Mt khc Clouds Computing cng h tr cc loi ng dng tng t Grids nhng khng t c tnh hiu qu i vi cc ng dng HPC. Bi v Clouds cn trong qu trnh s khai, n cn nhiu vn cn gii quyt.

1.7.13 M hnh bo mt (Security Model)Clouds hu nh bao gm cc trung tm d liu (data center) chuyn dng thuc v cng mt t chc, n mang tnh ng nht khc bit hon ton vi mi trng Grids. M hnh bo mt ca Clouds hin ti n gin v t an ton hn cc m hnh sn c ca Grids. Tiu biu l Clouds da trn Web to ra ti khon ngi dng, cho php h t li mt khu v nhn mt khu mi thng qua email trong mt mi trng khng m ha v khng an ton. Ch rng, ngi dng c th d dng s dng Clouds ngay lp tc vi ch mt th tn dng hay a ch email. Ngc li hon ton, Grids hn ch hn v tnh bo mt. Chng hn, mc d thng qua Web to ti khon ngi dng, thng tin nhy cm v ti khon, mt khu c yu cu giao tip gia ngi vi ngi xc nhn r rng ngi dng c y quyn. Tnh bo mt l mt vn quan trng c quan tm trong Cloud Computing. C 7 im chnh m mt ngi dng Clouds cn ch khi quyt nh s dng: 1. Truy cp bi ngi dng c quyn hn: Vic d liu nhy cm c x l bn ngoi x nghip cn m bo rng n ch truy cp v lan truyn bi ngi s dng c c quyn. 2. ng thun v iu chnh : Ngi khch hng cn phi bit c nh cung cp Clouds c thc hin cc thao tc ngoi lung trn d liu ca h hay khng. 3. V tr d liu: Do ngi dng khng bit ni lu tr d liu ca h, nh cung cp Clouds phi m bo lu tr v x l d liu ng theo tha thun php l ban u v phi tun th yu cu v tnh ring t ca ngi khch hng. 4. S tch bit v d liu: D liu gia cc ngi s dng khc nhau phi c lu tr ring bit. 5. Khi phc: Nh cung cp Clouds phi c c ch nhn bn v khi phc d liu trong trng hp c hng hc xy ra. 6. H tr kim tra: Cc dch v Clouds rt kh kim tra, nu nh iu l quan trng vi khch hng th nh cung cp dch v cng phi c c ch h tr.

26

Tn ti y

7. Tnh lu di: D liu trn Clouds phi tn ti lu di bn vng ngay khi nh cung cp Clouds b thu mua bi mt tp on khc.

27

Chng 3:

MT S GII PHP V NN TNG M MY HIN TI

Hin ti c rt nhiu hng ln trn th gii u t vo in ton m my v pht trin cc nn tng v gii php Cloud Computing. V d nh Google c Google AppEngine, Amazon c Amazon Web Services, Windows Azure ca Microsoft, hay Clouds ca IBM. Nhng ni chung th d hng no, hay cung cp dch v g th ta cng c th chia c lm 3 loi nh chng 2 cp l: PaaS (Platform as a Service) : cho thu nn tng cng ngh c xy dng sn, cung cp cc API cho php ngi s dng v nh lptrnh t xy dng da trn cc nn tng cung cp sn ny. V d nh: Google App Engine, hay dch v Amazon WebServices IaaS (Infrastructure as a Service): cho thu nn tng, kin trc phn cng hoc phn mm. Tnh ph d trn cu hnh cho thu. y, cc nh cung cp dch v s dng cc cng ngh o ha Virtual Technology ca cc hng nh Vmware c sn phm EXServer, Microsoft c Windows Azure. Dch v ny cho php ngi s dng thu t cu hnh phn cng ca my ch ty cho ti h iu hnh v cc dch khc chy trn my ch. SaaS (Software as a Service): y l tng gn vi ngi s dng nht, cung cp cc phn mm hon chnh, tnh ph da trn s ln hoc dung lng s dng v lu tr d liu ca ngi dng. Hin ti hu ht cc SaaS c cc hng dch v cung cp min ph cho ngi s dng. V d nh Google Mail, Google Docs, Yahoo Mail, ASUS Webstore, Windows Live, Dropbox, Trong chng ny, ti xin c gii thiu mt vi nn tng ph bin v hay dng hin nay l Google App Engine (thuc dng PaaS, min ph) v Amazon Webservice (thuc dng PaaS, c ph). Sau so snh nhng im khc bit gia cc nn tng ny v 1 nn tng ang c qung b rng ri hin nay l Microsoft Azure. T rt ra mt s kt lun. Cui chng, lm r nguyn tc hot ng ca mt m my dng PaaS, ti gii thiu mt demo nh chy trn nn tng Google App Engine. L do l v hin ti mc d cn nhiu hn ch (s cp cc phn sau) nhng Google App Engine l mt nn tng min ph do trin khi d dang hn, ng thi vic qun l v xy dng ng dng da trn nn tng Google App Engine cng n gin v c Google h tr rt nhiu.

Dch v Web Services ca Amazon gm 5 dch v chnh: Elastic Compute Cloud (EC2) SimpleDB Simple Storeage Service (S3) CloudFront

1.

Amazon Web Services

Tn tc gi, LP XXX

1

Tn ti y

Simple Queue Service (SQS)

Amazon EC2 l mi trng tnh ton o cung cp kh nng tnh ton trong m my. Cc lp trnh vin c th to , khi ng v tt my o theo nhu cu. My o h tr nhiu h iu hnh khc nhau nh Red Hat Enterprise, Linux, Windows Server 2003, Oracle Enterprise Linux, OpenSolaris, openSUSE Linux, Ubuntu Linux, Fedora, Gentoo Linux, v Debian. My o cng h tr nhiu phn mm nh Oracle 11g, Microsoft SQL Server 2005 Standard Edition, Apache Web Server, IIS / ASP.Net, Java Application Server, Jboss Enterprise Application Platform,

2.

Amazon Elastic Compute Cloud (EC2)

Hnh 18: Giao din chnh Amazon EC2

Amazon SimpleDB l mt dch v c s d liu m my cung cp cc chc nng c s d liu lu tr d liu ch mc v hng i. Simple DB khng phi l mt c s d liu quan h trong m my nhng l mt phng tin lu tr lu tr v ly d liu.

3.

Amazon Simple DB

2

Tn ti y

Hnh 19: Giao din chnh Amazon DB

Amazon S3 l mt c s d liu m my, c s dng lu tr v ly d liu qua internet. y l c s h tng lu tr d liu m Amazon chy cc trang ring ca n trn ton cu. Cc lp trnh vin c th tn dng c s h tng lu tr cht lng tng t. Amazon S3 cha 3 khi nim lu tr : object, bucket, v key. Object l i tng nn tng trong S3, cha cc d liu v siu d liu (metadata) ,v kch thc ti a c th l 5GB. Cc object c th c lu tr trong bucket. Bucket cung cp mt namespace duy nht cha cc object. Key dng nhn bit cc object trong bucket .

4.

Amazon Simple Storage Service (S3):

Hnh 20: Giao din chnh Amazone S3

3

Tn ti y

Amazon CloudFront l mt mng phn phi d liu chuyn i ni dung. Amazon CloudFont hot ng cng vi Amazon S3 cung cp cc bn sao ca i tng t v tr gn nht n ng dng ang gi.

5.

Amazon Cloud Font:

Hnh 21: Giao din chnh Amazon Web Services

Amazon SQS l dch v truy vn m my lu tr tin nhn. Cc lp trnh vin c th tn dng SQS chia s d liu truy vn thng qua ng dng phn tn. SQS h tr tt c cc chc nng truy vn c bn nh to, lp danh sch, v xa truy vn cng nh gi, nhn v xa tin nhn. Bn c th s dng Amazon SQS cng vi EC2 v S3 xy dng cc lung lm vic phc tp.

6.

Amazon Simple Queue Service:

4

Tn ti y

Hnh 22: Giao din chnh Amazon SQS

Trn y l cc thng tin gii thiu c bn v nn tng Amazon Webservice cng nh mt s dch v chy trn nn tng ca Amazon Webservice. Vic tip cn nghin cu thc t cc dch v ny tng i kh khn vi nhm thc hin v dch v ny i hi tr ph s dng.

7.

Google App Engine

Mt trong nhng nn tng pht trin ng dng m my ph bin v ni ting hin ti ang c rt nhiu ngi dng la chn hin nay l App Engine ca Google.

7.1 Gii thiu:-

-

-

Google App Engine (gi tt l AppEngine, mt s trng hp c vit tt l GAE ) l gii php cho vn in ton m my. , Google cung cp sn mt h thng my ch in ton m my, v ngi lp trnh s vit ng dng ca mnh ln . ng dng ny s chy trn m my ca Google. Google App Engine cho php bn chy cc ng dng web ca bn trn c s h tng ca Google. App Engine ng dng c d dng xy dng, d bo tr, v d dng c quy m nh giao thng ca bn v nhu cu lu tr d liu ln. Vi App Engine, khng c my ch duy tr: Bn ch cn ti ln cc ng dng ca bn, v n sn sng phc v ngi dng ca bn Bn c th s dng tn min ring ca mnh (chng hn nh http://www.example.com/ ) thng qua google apps. Hoc bn c th dng subdomain min ph ca appspot.com. GAE cho php c host min ph vi dung lng 500 MB lu tr v cho php 10 GB bng thng lu chuyn mi ngy hay5

Tn ti y

-

tng ng 5 triu pageview hng thng,Vt qua mc ny bn s phi tr ph. Dng GAE, chng ta khi phi thit k database, vit SQL truy vn data, map data v object. Chng ta ch cn design cc class v GAE t ng lo phn lm vic vi database. Hin AppEngine h tr 2 loi ngn ng l: Python v Java. Mt s ngn ng khc nh PHP cng c th chy c nu ci cng vi b chuyn t PHP sang Java

7.2 Cc thnh phn chnh ca Google App Engine:7.2.1 Python Runtime AppEngine h tr Python Runtime phin bn 2.5.2. Hu ht cc th vin ca Python Standard Library u c h tr. Tuy nhin do vn v security nn cc extensions vit bng C s khng c h tr. iu ny c ngha rng bn khng th nhng C extensions vo ng dng ca bn khi s dng App Engine. Python Runtime cung cp APIs cho datastore, Google Accounts, App Engine services. tin li cho vic pht trin web AppEngine cng cung cp 1 web framework n gin l webapp. Do vit bng ngn ng Python nn AppEngine h tr hu ht cc Python framework nh Django, CherryPy, Pylons, web.py vi mt t thay i nht nh.

7.2.2 Java Runtime Environment Bn c th pht trin ng dng ca bn cho Java Runtime Environment s dng ph bin cng c pht trin web Java v cc tiu chun API. ng dng ca bn tng tc vi mi trng bng cch s dng the Java Servlet standard, v c th s dng cc cng ngh ng dng web ph bin nh JavaServer Pages (JSP) Java Runtime Environment s dng Java 6. Cc App Engine Java SDK h tr pht trin cc ng dng bng cch s dng Java 5 hoc 6. i vi cc kho d liu App Engine, Java SDK bao gm vic trin khai ca Java Data Objects (JDO) v Java Persistence API (JPA) interfaces. ng dng ca bn c th s dng cc API JavaMail gi tin nhn email vi dch v App Engine Mail. Cc java.net HTTP API truy cp vo App Engine ly URL dch v. App Engine cng bao gm cc API cp thp cho cc dch v ca mnh thc hin thm b iu hp, hoc s dng trc tip t ng dng. Xem ti liu cho the datastore, memcache, URL fetch, mail, images and Google Accounts APIs. Thng thng, cc nh pht trin Java s dng cc ngn ng lp trnh Java v cc API thc hin cc ng dng web cho JVM. Vi vic s dng cc trnh bin dch tng thch vi JVM, ngi phin dch, bn cng c th s dng cc ngn ng khc pht trin cc ng dng web, chng hn nh JavaScript, Ruby, hoc Scala.

6

Tn ti y

7.2.3 Datastore Datastore l c ch thao tc vi d liu trn h thng d liu phn tn ca Google. APIs ca Datastore s cung cp cho bn Interface c th thao tc vi cc d liu pha di. 7.2.4 Google Accounts: AppEngine lin kt mt thit vi ti khon Google. Bn c th cho user login vo ng dng ca mnh bng ti khon Google ca h. 7.2.5 App Engine Services: Cung cp nhiu dch v bn c th s dng cho ng dng ca mnh. Nhng dch v c th lit k y l: URL Fetch, Mail, Memcache, Image Manipulation

7.3 Mt s Data API ca Google App

7

Tn ti y

Bng 1: Thng k cc Data API c dng trn Google App Engine

8. So snh mt s nn tng cung cp dch v in ton m my

8

Tn ti y

Hnh 23: So snh mt s nn tng v dch v m my hin ti

Da trn nhng thng tin bn trn v Google App Engine v Amazon Webservice, nhm nghin cu a ra mt bng so snh cc nn tng trn nh sau:Bng 2: So snh mt s dch v v nn tng ang ph bin

Amazon / Windows Azure Dch v cung cp +Server as a Service +Database as a Service + Infrastructure as a Service Ph s dng C tnh ph API tng thch ng dng tng thch chy c trn mi trng my ch cn thu Ngn ng lp trnh Ph thuc vo dch v hay nn tng cn thu i tng cung cp Doanh nghip Kh nng m rng C

Google App + PaaS + IaaS + DaaS Min ph C API tng thch

Force.com +PaaS +IaaS +DaaS C tnh ph S dng Frame Work lm nn tng pht trin FrameWork Doanh nghip C

Java, Python Lp trnh vin Doanh nghip C, d m rng

9. Mt s kt lun da trn cc kt qu so snh Hu ht cc dch v v nh cung cp u cho php ngi s dng thu nn tng (Infrastructure) c th hiu nh thu trn phn cng. Tt c u cung cp cc dch v theo 5 mc ca m hnh in ton m my, u c API hay Framework h tr ngi

9

Tn ti y

s dng lp trnh c trn m my v trin khai ng dng. Tuy nhin ni ln , ta thy Google AE c cc u im vt tri m cc i th khc khng c: GAE min ph cho php ngi lp trnh s dng v trin khai d dng. Cung cp 1 b SDK v 1 tp hp phong ph cc API nhng vo 1 mi trng pht trin tch hp sn v d nh Eclipse nn vic trin khai ng dng d dng v quen thuc hn. Mc d khng phi hon ton nhng GAE h tr mnh m Java cho php lp trnh vin lp trnh d dng cng nh m rng ng dng sau ny. 10. Trin khai mt demo trn Google App Engine Nh cp phn trn, Google App Engine l mt trong nhng la chn tt nht trin khai mu mt d n nn tng m my v t hiu c cch thc hot ng ca mt m my cng nh hiu c quy trnh trin khai mt d n phn mm trn in ton m my ra sao.

10.1 Mt s im lu khi xy dng mt ng dng trn nn Google App EngineTrong phn l thuyt, ti ch ra Google App Engine h tr 2 ngn ng l Python v Java ( y l Java phin bn 6), tuy nhin cng khng phi l h tr tt c. d vn dng v pht trin, demo di y s dng ng dng da trn ngn ng Java. V vn cc th vin lp trnh chun, Google AE ch h tr cc th vin chun (Java Standard API), do , khi pht trin cc ng dng loi ny m mun chy da trn cc trnh server nh Tomcat hay Jetty th cng ch nn s dng cc th vin lp trnh chun ca Java (Java Stardard API) Google App Engine h tr 2 cch truy xut c s d liu bao gm JDO, JPA. Bi v google s dng cc container servlet ca Jetty nn n h tr Java Servlet API phin bn 2.4. Mc d vy nhng nn th Google app engine s dng Google Bigtable phn phi khng gian b nh cho cc ng dng m my chy trn n. Khi pht trin ng dng chy trn Google App Engine, Google cng h tr qun l phin bn ca sn phm v iu ny d dng thc hin trong bng qun l v iu khin ti khon Google App Engine ca nh pht trin. Mc d App Engine h tr Java 6 nhng khng phi tt c cc lp trong phin bn ny c h tr, v d nh cc th vin lp trnh giao din s dng Swing v hu ht cc lp ca th vin giao din AWT khng c h tr. Ngi dng cng khng c s dng Threads hay cc framework c s dng Thread pht trin ng dng. Ngi s dng cng khng c s dng cc lnh lin quan n file system v ch c c cc tp tin m l mt phn ca ng dng. V d nh cc phng thc ec() v exit() trong lp java.lang.System s khng thc hin vic g c.

10

Tn ti y

Ngoi ra, nh pht trin ng dng cng khng c php m cc port truyn tin m phi thao tc thng qua cc API hi phc tp v rc ri ca Google AE truyn thng tin t client ti server. Mc d cho php min ph lu tr d n trn my ch m my nhng iu khng c ngha l ng dng pht trin trn m my google c min ph hon ton. Google ch cho php mi ng dng c min ph 5 triu lt xem v c cc gii hn i vi mi ln truy cp vo c s d liu cng nh gi cc API ca Google hay cc tnh ton lin quan n s dng CPU v ln c s d liu s dng trong ng dng. Nu vt qu cc quy nh trn, Google s tin hnh thu ph nh pht trin ng dng .

10.2 Quy trnh pht trin mt ng dng trn Google App EngineQuy trnh pht trin mt ng dng trn Google App Engine c bn tun theo cc bc sau: 10.2.1 Bc 1, ng k s dng dch v ng k 1 ti khon trn Google App Engine, cho php s dng ti khon Gmail ng k s dng. Sau khi ng k, ngi dng s c 1 bng iu khin m my. Ti y c th thm, xa v cu hnh cc ng dng c th c pht trin, c ti a 10 ng dng c pht trin cho mt ti khon truy cp Google App Engine. Hnh 24 v 25 m phng v giao din ca bng iu khin ng dng m my sau khi ng k ti khon thnh cng trn Google App Engine. 10.2.2 Bc 2, ci t b cng c pht trin phn mm v mi trng pht trin ng dng Google xy dng sn mt b cng c pht trin ng dng (SDK) v mt plug-in gip ngi s dng ci t v s dng trn 1 IDE l Eclipse gip cho vic pht trin ng dng d dng hn. V vy bc ny, lp trnh vin ti v v ci t 2 b cng c chnh l SDK v plugin bt u pht trin ng dng Google App Engine trn mi trng Eclipse. Hnh 26, gii thiu giao din ca Eclipse sau khi ci t y SDK v plug-in.

11

Tn ti y

Hnh 24: Sau khi ng nhp, Google AE s lit k cc ng dng c to ra v a ln m my

Hnh 25: Sau khi click chn vo ng dng, Google AE s thng k v lu lng s dng, thi gian s dng CPU, cc thng s v bng thng, yu cu, s ln truy cp , ca ng dng

10.2.3 Bc 3, pht trin ng dng v chy chng trn my cc b bc ny ngi s dng pht trin ng dng bnh thng nh cc ng dng khc, lu ti nhng gii hn ca b cng c pht trin v chy chng kim th trn my local.

12

Tn ti y

10.2.4 Bc 4, a m ngun ln trn m myca Google v tin hnh ci t chy chng trn mi trng internet. bc ny, nu khng dng cc cng c c sn trn mi trng IDE, ngi lp trnh c th s dng cc cu lnh ca b SDK a d n ln trn m my ca Google v tin hnh bin dch. Vic xc nh v tr a d n ln m my da vo cc id m trong qu trnh to d n trong bng iu khin ti khon Google App Engine cung cp trc. Ngoi ra, d dng pht trin, plugin trn eclipse cng h tr ngi dng a d n ln trn m my cng theo cch trn nhng n gin hn bng giao din ha, ch cn cu hnh mt vi tham s khi khi to d n v sao khi chy test th xong trn local ta bm menu a d n ln m my chy n gin v bt phc tp.

10.3 Demo ng dng trn Google App Engine10.3.1 M t ng dng ng dng c chc nng n gin l khi ngi dng truy cp vo ng dng s xut hin 1 box cho php ngi dng nhp vo tn hoc chui bt k, sau khi nhn nt, thng ip s gi ln m my v s tr v kt qu l chui ngi dng nhp vo km thng ip hello cng nh thng tin v App Engine v thng tin my tnh m ngi dng ang s dng. 10.3.2 ng k ti khon Google AE v ci t Eclipse, b Google App Engine SDK v Google App Engine for Eclipse. Sau khi ng k thnh cng ti khon trn Google AE ta tin hnh to 1 d n c tn luuhoanglongtest1 nh trn hnh 24. Bm chn vo tn ng dng ta c cc thng tin bng iu khoen nh trn hnh 25. Tip ta tin hnh download v ci t b Google AE SDK t trang ch ca Google AE. Ti v ci t b cng c Eclipse. Sau khi ci t ta tip tc ci t plug-in Google AE cho Eclipse. Sau khi ci t thnh cng, giao din Eclipse c nh hnh 26.

13

Tn ti y

Hnh 26: Mi trng Eclipse sau khi ci t Google App Engine plugin

10.3.3 To d n mi v tin hnh lp trnh Sau khi ci t c plug-in, khi to d n mi ta s c thm la chn l Web Application. Ta chn d n loi ny, t tn v hon thnh. Sau khi to ta tin hnh lp trnh cc file code theo hnh sau:

Hnh 27: Cc file code ca demo

14

Tn ti y

Mt s chc nng cc file nh sau: GAJ___ChapterThree.html v GAEJ___ChapterThree.css: to giao din cho ng dng Gaej.chapterthree.client v Gaej.chapterthree.server: khi to kt ni gia m my v client. Nhng packet v lp trong packet ny s do b SDK v IDE t to ra trong lc khi to d n. Jdoconfig.xml : cu hnh c s d liu cho ng dng. Sau khi lp trnh ta c th cho ng dng chy ngay trn my local kim tra v test ng dng bng cch nhp chut phi ln project, chn Run As -> Web Application. Kt qu c nh hnh sau:

Hnh 28: Kt qu chy trn my Local. 10.3.4 a d n ln m my Nh cp cc phn trc, a d n ln m my, trc ht cn phi ng k ti khon Google App Engine, lp trnh vin s phi dng ti khon ny login vo trn c mi trng Eclipse, sau khi ng nhp, thng tin ti khon s nm gc di, bn tri ca ca s Eclipse. Tip tc ngi dng to ra 1 ng dng m my trn bng iu khin nh hnh 24. ng dng s c 1 application ID duy nht v ta s dng ID ny ci vo Eclipse trc khi a ng dng ln m my.15

Tn ti y

Nhp chn biu tng Deploy Application Project trn ca s Eclipse ta c:

Hnh 29: Cu hnh ng dng m my. Ta in tn ng dng (application ID) vo, nh hnh 26 l luuhoanglongtest1 l tn ng dng ging nh to trn m my. Tip tc ta nhn OK. ng dng s t ng c plug-in a ln trn m my, bin dch v thc hin. Nu thnh cng, ta g dng a ch sau: http://luuhoanglongtest1.appspot.com. Ta s thy kt qu chy trn m my nh hnh 30.

16

Tn ti y

Hnh 30: Kt qu chy trn m my

17

Chng 4: PHT TRIN NG DNG VN PHNG TRN WEB

Chng 3 ca n lm so snh v ly c v d demo 1 ng dng n gin chy trn nn tng m my ca Google l Google App Engine. Tuy nhin, vic trin khai d n trn Google App Engine vn cn nhiu hn ch v l mt nn tng , h tr vn cha y v mi th u ph thuc vo cc API v cc tiu chun ca Google. in ton m my khng ch c vy, khng ch c dng Platform, trong chng 2 ca ti trnh by l vn cn 3 dch v c tip cn na ca m my l Software as a Service v Infrastructure as a Service (IaaS). Trong , IaaS l cch thc cc nh cung cp dch v s dng cng ngh o ha cc c s h tng cung cp mt cch ty bin v mm do cc ti nguyn phn cng v phn mm. T , d dng cho thu cc my ch vi dung lng v sc mnh x l cng nh h iu hnh trn ty bin theo nhu cu ca ngi s dng. V d, mt doanh nghip trong nhng ngy bnh thng ch c nhu cu thu 1 server chy Windows, vi cu hnh CPU, RAM, b nh lu tr trung bnh chy website ca cng ty. n mt thi im no , cng ty c mt d n ln, cn trin khai, d n yu cu phi s dng linux, vi CPU v RAM cng nh lu tr cao hn. iu ny hon ton c th thc hin c bng cng ngh o ha. Nh cung cp c th nng cu hnh v chy nn tng h iu hnh khc cho doanh nghip ch trong 1 thi gian rt ngn. V sau cng ty c khng c nhu cu na, mun tr li nh cu hnh v h iu hnh ban u cng ht sc d dng. l cch thc hot ng ca cc trung tm d liu (Data Center), mt trong nhng in hnh in ton m my ph bin v l xu hng ngy nay. Trong chng ny, nhm thc hin pht trin mt ng dng vn phng cho php thao tc nhiu ngi mt lc, chy trn mi trng web, v sn sng trin khai trn m my. chy, ch cn thu mt Data Center ( Vit Nam c Viettel, FPT v IBM khnh thnh v a vo hot ng cc trung tm ny), mt my ch linux, c h tr Java Virtual Machine v cc ngn ng da trn JVM nh Scala, l c th trin khai m my chy c d n. Do thi gian tm hiu in ton m my l mt lnh vc mi rt mt thi gian nn tit kim thi gian lm n, nhm thc hin a vo s dng m ngun m Etherpad thc hin demo. Etherpad trc y l mt d n pht trin da trn Java phc v cho vic cng tc lm vic trn mng. Sau ny, d n c Google mua li v m m ngun cho ng o ngi s dng theo chun Apache. 11. Gii thiu cc chc nng y l chng trnh x l k t n gin da trn nn web , chng trnh cho php mi ngi lm vic, tng tc trn cng 1 vn bn trong thi gian thc. Khi nhiu ngi chnh sa cng mt ti liu ng thi , mi thay i c lp tc hin th trn mn hnh ca nhng ngi cng lm vic.Chng trnh em n s nTn tc gi, LP XXX 18

Tn ti y

gin ha cho nhng cng vic yu cu tnh cng tc nh : ghi ch trong cc cuc hp, son tho vn bn theo phin, nhm lp trnh , gio dc v nhiu hn na. Sau khi build source code, ta s c 1 server lng nghe kt ni trn cng 9000. s dng chng trnh trn localhost http://localhost:9000. ta g vo trnh duyt a ch :

Mn hnh cho mng s hin ra. to mt pad mi ta click vo dng ch : Click to file mi.

Giao din chnh ca chng trnh : Trn giao din ca chng trnh ta thy c cc vng sau :

19

Tn ti y

Vng cho php in tn ngi dng, chn ma ch tng ng vi mi ngi dng. Vng hin th ni dung chat gia nhng ngi dng. Vng cho php nhiu ngi dng cng son tho ni dung ca vn bn. Vng cha cc cng c nh dng vn bn. Vng la chn cc chc nng khc ca chng trnh. Chng trnh c cc chc nng chnh nh sau : Cho php nhiu ngi cng son tho trn mt ti liu, gi chung l pad. T ng lu li nhng thay i trn ti liu trong thi gian ngn. Cho php ngi dng lu tr ti liu ti nhng mc thi gian ty . Tnh nng Time Slider cho php mi ngi xem lch s tc ng ca ti liu. Cho php thc hin mt s tnh nng nh dng vn bn c bn. Cho php nhng ngi tham gia son tho c th chat vi nhau. Cho php lu ni dung file thao tc thnh file txt hoc html. Minh ha cc chc nng ca chng trnh: Chc nng son tho vn bn ng thi :

20

Tn ti y

Thng tin tng ng ti mn hnh server :

Chc nng chat gia nhng ngi dng vi nhau:

21

Tn ti y

Thng ip tng ng trn server :

Chc nng Time Slider : Ta nhp chn nt Time Slider chn chc nng ny. Trnh duyt s m ra mt tab mi cho php xem li lch s tc ng ln pad.

22

Tn ti y

-Thng ip tng ng trn server:

12. Cu trc m ngun M ngun c t chc theo cu trc sau

23

Tn ti y

13. Chc nng mt s file m ngun

13.1 Padevents.js : Ghi li cc s kin xy ra trn Pad :- function onNewPad(pad) : S kin khi to pad mi : + u vo : i tng pad. + u ra : M ra mt pad v lu padID vo CSDL. - function onDestroyPad(pad) : S kin hy mt pad. + u vo : i tng pad. + u ra : Hy 1 pad c v lu vo. CSDL. - function onUserJoin(pad, userInfo): S kin 1 user Join vo chng trnh. + u vo : i tng pad, thng tin ngi dng. + u ra : M ra mt pad mi cho ngi dng v lu thng tin ngi dng vo file log. - function onUserLeave(pad, userInfo) : S kin 1 user ri khi chng trnh: + u vo : i tng pad, thng tin ngi dng.

24

Tn ti y + u ra : ng kt ni vi ngi dng ri khi chng trnh, cp nht vo CSDL. - function onUserInfoChange(pad, userInfo) : Thay i thng tin ngi dng. - function onClientMessage(pad, senderUserInfo, msg) : S kin ngi dng to ra cc s kin c gi thng ip ln server: + u vo : i tng pad, thng tin user , thng ip. + u ra : Ty dng thng ip sn c m server s c cc hi p khc nhau - function onEditPad(pad, authorId) .

13.2 Model.js: Cc phng thc cho php truy cp n 1 i tng pad, kim tra s tn ti ca pad v to ra 1 pad nu n cha c sn.Bao gm cc phng thc : - function _getModelCache(): - function cleanText(txt): - function accessPadGlobal(padId, padFunc, rwMode) - function doWithPadLock(padId, func) - function isPadLockHeld(padId) - function _getPadMetaData(padId) - function _insertPadMetaData(padId, obj) - function _removePadMetaData(padId) - function _getPadAPool(padId) - function _removePadAPool(padId) - function _getPadTemp(padId) - function _getPadStringArray(padId, name) - function _destroyPadStringArray(padId, name) - function _getPadSqlMeta(padId) - function _writePadSqlMeta(padId, updates) - function removeFromMemory(pad)

13.3 Chatarchive.js : X l cc thao tc khi cc client chat vi nhau.Bao gm cc - function: - - function onChatMessage(pad, senderUserInfo, msg): Gi cc thng ip chat ra mn hnh.

25

Tn ti y + u vo : i tng pad, Thng tin client gi thng ip, thng ip. + u ra : Xut thng ip v thng tin ngi gi ln mn hnh server. - function getRecentChatBlock(pad, howMany): - function getChatBlock(pad, start, end):

13.4 Collab_server.js: Bao gm cc phng thc xc thc User (thng qua userId), ly thng tin phin bn (pad revision), p dng cc thay i do user to ra trn pad, cp nht cc thay i do user to ra ti tt c cc client ang s dng cng 1 pad.- function onStartup() - function _padIdToRoom(padId) - function _roomToPadId(roomName) - function removeFromMemory(pad) - function _getPadConnections(pad) : Ly thng tin v pad m kt ni. + u vo : i tng pad. + u ra : To ra mt kt ni ti pad. - function guestKnock(globalPadId, guestId, displayName) : Xc nh cc quyn ca mt ngi dng guest ( ngi dng cha ng k) c khi truy cp vo 1 pad. + u vo : Id ca pad, Id ca guest , tn user guest. + u ra : Thng bo ca server khi ngi dng guest thao tc trn pad. - function _verifyUserId(userId) : Xc minh ngi dng l guest hay ngi dng ng k . + u vo : userId. + u ra : Tr v kiu ca ngi dng. - function _checkChangesetAndPool(cs, pool) - function _doWarn(str) { - function _getPadRevisionSockets(pad) - function applyUserChanges(pad, baseRev, changeset, optSocketId, optAuthor) : p dng cc thay i m ngi dng thc hin trn pad. + u vo : pad, phin bn pad, thay i , SoketId ca client thc hin thay i , thng tin tc gi thay i. + u ra : Cho php lu cc thay i . - function updateClient(pad, connectionId) : + u vo : pad, connectionId: + u ra : Nu phin bn ca client c hn phin bn hin ti ca server th server s cp nht li ni dung mi nht cho client.

26

Tn ti y - function updatePadClients(pad) - function applyMissedChanges(pad, missedChanges) - function getAllPadsWithConnections() - function broadcastServerMessage(msgObj) - function appendPadText(pad, txt) - function setPadText(pad, txt) - function setPadAText(pad, atext) - function applyChangesetToPad(pad, changeset) - function _applyChangesetToPad(pad, changeset) - function getHistoricalAuthorData(pad, author) : Ly thng tin v nhng thit t trong ln s dng trc ca ngi dng : + u vo : pad, ngi dng. + u ra : Nu trc y ngi dng s dng chng trnh th cc thit t c nh tn, mu ch .. s c dng. Nu l ln s dng u tin th ngi dng phi thit t. - function buildHistoricalAuthorDataMapFromAText(pad, atext) { - function buildHistoricalAuthorDataMapForPadHistory(pad) - function getATextForWire(pad, optRev) - function getCollabClientVars(pad) - function getNumConnections(pad) : m s lng ngi dng ang kt ni ti cng 1 pad. + u vo : pad. + u ra : S lng client kt ni n pad. - function getConnectedUsers(pad) : Thng tin ca nhng user ang s dng chng trnh thao tc trn cng 1 pad. + u vo : pad. + u ra : Tn nhng user ang cng thao tc trn pad. - function bootAllUsersFromPad(pad, reason) - function dumpStorageToString(pad) - function _getPadIdForSocket(socketId) : Ly PadId ng vi SocketId + u vo : socketId + u ra : PadId tng ng vi socketId ang kt ni. - function _serverDebug(msg) - function _accessSocketPad(socketId, accessType, padFunc, dontRequirePad) : - function _accessConnectionPad(connection, accessType, padFunc, dontRequirePad) - function _accessCollabPad(padId, accessType, padFunc, dontRequirePad) : Cho php truy cp ng thi ti 1 pad. + u vo : padId, kiu truy cp, padFunc, + u ra : Nu socket c kt ni n 1 pad th cho php thao tc trn pad cng vi nhiu ngi dng khc, nu khng s xut thng bo trn server. - function _accessExistingPad(padId, accessType, padFunc, dontRequireExist) : Cho php truy cp vo 1 pad vi padId sn c.

27

Tn ti y - function _handlePadUserInfo(pad, userInfo) : X l thng tin ngi dng. + u vo : pad, userInfo + u ra : Lu thng tin gm mu ch, tn ngi dng ln truy cp cui cng. - function _sendUserInfoMessage(connectionId, type, userInfo) :Gi thng tin user li cho kt ni c connectionId. - function translateSpecialKey(specialKey) - function getSpecialKey(name) - function _handleCometMessage(connection, msg) - function _correctMarkersInPad(atext, apool) - function _updateDocumentConnectionUserInfo(pad, socketId, userInfo):

13.5 Pad_control.js:Kim sot cc thng tin v cc tc ng trn pad , tr v default pad text : on vn bn xut hin khi to mi pad, cho php gn cc thng tin nh tn user , mu ch ng vi tng user, render mt pad, render saverevision.- function onStartup() : to ra bng PAD_DIAGNOSTIC trong CSDL. - function getDefaultPadText() : Tr v on vn bn cho mng khi mi kt ni n chng trnh. - function assignName(pad, userId) : Gn username tng ng vi userId ng k. - function assignColorId(pad, userId) : Gn mu ch ng vi userId ng k. - function _getPrivs() Cc hm lin quan ti biu din: - function render_linkfile() - function render_newpad() - function render_newpad_xml_post() - function render_pad(localPadId) - function render_create_get() - function render_create_post() - function render_saverevision_post() - function render_saverevisionlabel_post() - function render_getrevisionatext_get() - function _recordDiagnosticInfo(padId, diagnosticInfoJson) - function recordMigratedDiagnosticInfo(objArray) - function render_reconnect() - function render_connection_diagnostic_info_post() - function _applyMissedChanges(localPadId, missedChangesJson) - function render_feedback_post() - function render_emailinvite_post()

28

Tn ti y - function render_slider() - function render_auth_get() - function render_auth_post() - function render_chathistory_get()

29

Chng 5: KT LUN V HNG PHT TRIN CA TI

14. Kt lun ti c bn hon thnh c nhng ni dung ra bao gm: Tm hiu c c s l thuyt v in ton m my, nguyn tc hot ng, cu trc v cc dch v trin khai trn mt m my in ton. Phn bit cc loi m my hin ti, so snh c in ton m my vi m hnh Client Server v c bit l phn bit in ton m my vi in ton li v tnh ton song song. Trnh by v so snh c mt s nn tng pht trin in ton m my hin ti nh Google App Engine, Amazon Webservices, so snh cc dch v ny vi nhau. Trnh by c quy trnh pht trin ng dng da trn nn tng m my ca Google l Google App engine v demo c ng dng chy trn nn tng ny thy r c cch thc hot ng ca mt m my in ton. Xy dng c mt ng dng vn phng da trn m ngun m chy trn web v sn sng a ln m my ti cc trung tm d liu (Data Center) ti Vit Nam. 15. Hng pht trin ca ti Mc d c bn hon thin mc tiu, nhng ti vn cn mt vn na cn gii quyt trong thi gian ti. y cng l nguyn nhn khch quan, v hin ti gi thnh thu ti cc trung tm d liu kh cao v v cn l sinh vin nn nhm thc hin cha a c ng dng ln m my ti cc trung tm d liu chy th. Nhm thc hin cng th to mt m my ring, nhng vic ny cng i hi cc thit b c cu hnh rt mnh v gi thnh cao. Tuy nhin vi s pht trin nh v bo hin nay ca CNTT, gi thnh thu cc dch v ny s ngy cng h thp v vic a ln m my l nhim v v hng pht trin thi gian n ca ti.

Tn tc gi, LP XXX

30

PH LCT c cc ph lc nm y v c nh s th t cng tn ph lc : PH LC A xxx

i

TI LIU THAM KHO[1] . . , hoc . [2] Jacque Arsac. Nhp mn lp trnh. Nguyn bn : Premires lecons de programmation. Trung tm h thng Thng tin ISC, H ni 1991, 241 tr. [3] Doug Cooper. Standard Pascal User Reference Manual. W.W.Norton & Company, 1983, 476 tr. [4] Jacque Courtin, Irne Kowaski. Initiation lalgorithmique et aux structures de donnes. Volume 1. Dunord, Paris 1994, 397 tr. [5] Phan Huy Khnh, V Trung Hng. Thit k c s d liu a ng ng php ting Vit. Tp ch Khoa hc Cng ngh, S 36+37, 2002, tr19-24. [6] Detmoungkhoum Saly. Xy dng t in tin hc Lo-Anh-Vi. Bo co tt nghip Thc s ngnh CNTT, i hc Nng Kho 2002-2005. [7] Nguyn Nh . i t in ting Vit. Nh Xut bn Vn ho-Thng tin 1999. [8] Trang web : http://www.informatik.uni-leipzig.de/~duc [9] ...

1

TM TT LUN VN TT NGHIPPhn ny vit tn ti (ch nh 13pt) v : tm tt ni dung LUN VN TT NGHIP, vit ngn gn v r rng (15 n 20 dng) cho bit :

ti c t ra nh th no (bi cnh), mc ch (gii thch r hn tn ti) v nhim v phi thc hin (cc mc tiu c th v kt qu cn c) SV gii quyt vn g ( nghin cu l thuyt, thc tin nh th no, xut c nhng gii php (bin php) hay sng kin g ?). SV gii quyt n u (nu mt s kt qu tiu biu).

Tn tac gia y, LP XXX

2