Categorie: Programare Web

Cererile privind rutele sitemap.xml la controler particularizate / acţiune

Prin , miercuri, 06 ianuarie 2010 12:13

În scopul de a solicitărilor directe pentru / sitemap.xml la un controler personalizat şi de acţiune în dumneavoastră Zend Framework adăugaţi aplicaţie pur şi simplu următorul text în application.ini sau fişier de configurare alternative (de exemplu, eu folosesc navigation.ini):

 resources.router.routes.sitemap.route = "sitemap.xml"
 resources.router.routes.sitemap.defaults.controller = indicele
 resources.router.routes.sitemap.defaults.action = sitemap

Codul de exemplu pentru scoate pot fi văzute prin crearea unei acţiuni în controlerul corespunzătoare (de exemplu, Sitemap-ul meu se află în controlerul de index, sitemap acţiune):

 < php
 clasa IndexController
     extinde Zend_Controller_Action
 {
     / **
      * Prestează un Sitemap pe baza de configurare Zend_Navigation
      * /
     sitemapAction funcţia publică ()
     {
    	 echo $ this-> view-> navigare () -> sitemap ();
    	 $ This-> view-> aspect () -> disableLayout ();
    	 $ This-> _helper-> viewRenderer-> setNoRender (true);
     }
 }

Sitemaps poate rapid şi uşor să fie generate folosind Zend_Navigation , un tutorial mare rapidă (şi, în general, foarte util pentru Zend tutoriale-cadru) este Zend Distributie - crearea dinamic un meniu un Sitemap şi pesmet .

Zend Framework Per-Modulul setările de bază

Prin , vineri, un ianuarie 2010 22:40

Am creat un de urmarire pentru acest post care necesită o configuraţie mai puţin, vă rugăm să consultaţi Aspect Modulul Bazat - Zend Framework .

Când utilizaţi Zend Framework cu module, evident că, dacă rulaţi diferite (sub-) site-uri de pe aceeaşi cerere nu doriţi neapărat acelaşi aspect script pentru fiecare parte. Am hotarat sa merg cu structura site-ul următor:

  / Aplicaţie
     / Controlere
         ...
     / Modele
     / Module
         / Default
             / Controlere
             / Aspect
                 / Script-uri
             / Vizualizari
                 / Script-uri
         / AnotherModule
             ...
     / Script-uri

Problema a fost de înfiinţare a script aspect pe o bază per-modul. Răspunsul a venit prin utilizarea unui Helper de acţiune. Configurarea layout pe o baza per-modul implică trei etape:

  1. Application.ini (sau de configurare configuraţie similară):
      admin.resources.layout.layoutPath APPLICATION_PATH = "/ modules / admin / layout / script"
     default.resources.layout.layoutPath APPLICATION_PATH = "/ modules / default / layout / script"
     member.resources.layout.layoutPath APPLICATION_PATH = "/ modules / membru / layout / script"
     affiliate.resources.layout.layoutPath APPLICATION_PATH = "/ module / afiliat / layout / script" 
  2. Creaţi Helper dumneavoastră de acţiune:
      <? Php
     / **
      * Setează calea de aspect pe o bază per-modul
      *
      * @ Author Lloyd Watkin <lloyd@evilprofessor.co.uk>
      * @ Deoarece 2010-01-01
      * /
     clasa Pro_Controller_Action_Helper_SetLayoutPath
         extinde Zend_Controller_Action_Helper_Abstract
     {
         / **
          * Seturi de cale aspect bazate pe modulul
          * /
         preDispatch funcţia publică ()
         {
        	 $ Modul = $ this-> getRequest () -> getModuleName ();
    
    	     dacă ($ bootstrap = $ this-> getActionController ()
    	                        -> GetInvokeArg ("bootstrap")) {
    
    	         $ Config = $ bootstrap-> getOptions ();
    
    	         if (isset ($ config [$ modul] ['resurse'] ['aspect'] ['layoutPath'])) {
    	             $ LayoutPath =
    	                  [Modul $] $ config ['resurse'] ['aspect'] ['layoutPath'];
    	             $ This-> getActionController ()
    	                  -> GetHelper ("aspect")
    	                  -> SetLayoutPath ($ layoutPath);
    	         }
        	 }
         }
     } 
  3. Şi, în sfârşit boostrap helper de acţiune:
      ...
         / **
          * Configurează script aspect pe o baza per-modul
          * /
         protejate funcţia _initLayoutHelper ()
    	 {
    	     $ This-> bootstrap ('frontController');
    	     Layout = $ Zend_Controller_Action_HelperBroker:: addHelper (
    	         noi Pro_Controller_Action_Helper_SetLayoutPath ());
    	 }
     ... 

Doctrina: DATETIME default NOW ()

Prin , miercuri 30 decembrie 2009 18:30

Am fost luptă cu crearea unei schema bazei de date pentru un nou Zend Framework proiect. Sunt utilizând încercaţi să utilizaţi Doctrina ORM pentru modelele baza mea de date. Am nevoie pentru a configura schema, astfel încât acesta mi-a permis să stabilească o dată implicit şi de timp pentru o `datetime` coloana, de exemplu, atunci când se adaugă un mesaj nou primesc timestamp-ul curent. După multe cercetări şi experimente am gasit solutia aşa că eu sunt o partajare.

În dvs. schemă YAML fişier face pur şi simplu următorul text:

 Mesajul:
   actAs:
     Timestampable:
       creat:
         Nume: created_at
         tip: timestamp
         Format: Ymd H: i: s
       actualizat:
         Nume: last_updated
         tip: timestamp
         Format: Ymd H: i: s
   coloane:
     id:
       tip: integer
       primar: adevărat
       autoincrement: adevărat
     Nume: string (255)
     e-mail: string (300)
     mesaj: string (2000)

Dacă, pe de altă parte, nu doriţi un `updated_at` coloană puteţi folosi următorul text:

 Mesajul:
   actAs:
     Timestampable:
       creat:
         Nume: created_at
         tip: timestamp
         Format: Ymd H: i: s
       actualizat:
         cu handicap: adevărat
   coloane:
     id:
       tip: integer
       primar: adevărat
       autoincrement: adevărat
     Nume: string (255)
     e-mail: string (300)
     mesaj: string (2000)

PHP Design Patterns - model de Observer

Prin , marţi 29 decembrie 2009 22:02

Am citit Şeful Modele Prima de proiectare recent, şi au decis să scrie unor modele ca exemple PHP pentru propriul meu interes. Primul pe care l-am decis să cod up este Pattern Observer . Definiţia formală a modelului de Observer este:

Modelul observator (un subset al asincron publică / abona model ) este un software de design model , în care un obiect , numit această temă, şi menţine o listă de persoane in intretinere sale, numit de observatori, şi le anunţă în mod automat de orice modificări de stat, de obicei, prin apel la unul dintre lor metode . Este folosită în principal pentru punerea în aplicare a sistemelor distribuite de manipulare eveniment.

Ca sisteme să devină mai slab cuplate asigurându-vă că, atunci când un eveniment se intampla toate sistemele care necesită cunoştinţe de aceste actualizări sunt informate. De exemplu, un post pe blog, după salvarea unui mesaj am putea avea nevoie pentru a actualiza un motor de căutare (de exemplu, Lucene), actualizare sitemap noastre, tag-uri, utilizatorii de e-mail subscris, etc model observator permite dezvoltatorilor să adauge ascultatori suplimentare fără obiect editarea lor observabile . Prin injectarea de observatori (de exemplu, un motor de căutare observator actualizare, un generator de sitemap, etc) într-un subiect (de exemplu, pe blog-posta sistem de editare), putem permite să îşi îndeplinească toate actualizările necesare, fără nici o schimbare.

Continuaţi lectură "PHP Design Patterns - model de observator" »

Oficiul pentru Grid Computing utilizând medii virtuale - Partea 4

Prin , vineri 04 decembrie 2009 11:59

Introducere

Eu lucrez intr-o companie în care vom rula multe locuri de muncă lot de prelucrare a milioane de înregistrări de date în fiecare zi şi m-am gândit recent la toate maşinile care stau în jurul valorii de fiecare şi în fiecare zi, nu face nimic pentru mai multe ore. Nu ar fi bine dacă am putea folosi aceste maşini pentru a consolida puterea de procesare a sistemelor noastre? În acest set de articole am de gând să se uite la beneficiile potenţiale ale angajarea unui birou grilă utilizând medii virtualizate.

În partea a 3- am creat maşina de procesare virtuale şi a înfiinţat ferestre utilaje pentru a deveni inactiv timp lucrătorilor.

Rularea cele mai recente codul

Inevitabil după crearea logica ta lucrătorilor de afaceri se va schimba, bug-uri va fi gasit, cod mai rapid mai eficientă va fi produs, astfel, lăsând muncitorii stăteau în jurul valorii de prelucrare a datelor folosind codul vechi mirositor . Atunci, cum ne asigură că suntem folosind întotdeauna cea mai recentă versiune şi cea mai mare scripturilor prelucrare nostru?

Există câteva metode foarte uşor de simplu, vom putea face acest lucru, truc, cu toate acestea, este de a reduce puterea de procesare şi traficul din reţea în realizarea acestui lucru. Sa incepem cu cele mai simple de soluţii şi îmbunătăţirea ei lent, pe o pereche de iteraţii.

Prima metodă ar fi pur şi simplu să se conecteze la serverul nostru de control de locuri de muncă (prin samba, FTP, sau similar) şi trage în jos cea mai recentă versiune a codului. Nu este foarte eficient, dar va face treaba. Permite îmbunătăţirea pe care oarecum, cum despre crearea unui script de rsync şi folosind ca de fiecare dată în schimb? Alternativ, ceea ce despre punerea noastre script târziu de prelucrare în subversiune verificarea codul iniţial şi apoi actualizarea doar codul nostru la fiecare rulare ( svn update )?

În final am putea termina cu un script bash (numit de către cron la fiecare 10 minute), care arată la fel de simplu ca acest lucru:

  # / Bin! / Sh
 dacă ps ax | grep-v grep | grep php > / dev / null
 atunci
     echo "locurilor de muncă este în prezent de procesare, ieşire"
 altfel
     echo "Iov nu se execută, începe acum"
     cd / calea / catre / de lucru / copiere
     svn update
     php yourJobProcessingScript.php
 Fi 

Acum putem fi siguri că, odată cu fiecare rula suntem execută cu siguranta cele mai recente cod. Suntem asigurarea acest lucru prin actualizarea bazei noastre de cod de fiecare dată vom efectua o rulare şi reducerea traficului de reţea, prin transferarea numai diferenţele fişier din reţeaua noastră.

În configurare demonstrative mea, am facut exact ca mai sus. Subversion a fost instalat pe serverul meu de prelucrare de locuri de muncă şi am tras pur şi simplu cele mai recente cod dintr-un "lucrător" sucursală folosind 'svn update'. Am adaugat de asemenea o etichetă număr de versiune a script-ul de prelucrare a mea, care a fost returnat în baza de date, ca parte a returna rezultate. În acest fel am putut vedea că codul meu a fost în curs de actualizare de fiecare dată când am copiat în trunchiul meu şi anume ramura lucrătorul că am fost cu siguranta execută script-ul mai recente de prelucrare.

Folosind cele mai recente date

Dacă dvs. de locuri de muncă de prelucrare a face utilizarea surselor de date, apoi la un moment dat aceste vor fi actualizate prea. Excepţia cazului în care apelaţi surse de date pe o bază foarte rar ai de gând să inundaţii reţelei cu trafic cât mai curând muncitorii dvs. încep să ruleze aducand totul la un impas. Pentru soluţie mea am decis că aş dori să se mute în jurul valorii de sursele mele de date cu masini virtuale mea.

Ţineţi esti caii acolo! Ce se întâmplă dacă sursele mele de date sunt imense? Ei bine, aceasta este cu adevărat un caz de cât de mult date este vorba? Acesta poate fi mai rentabilă pentru a instala un hard disk suplimentar mai mare în fiecare maşină decât să cumpere un server de procesare suplimentar. Aceasta este o chestiune de buget şi este de până la afaceri de a decide. Se poate că sursele de date sunt atât de mari încât ei doar imposibil să păstreze faptul că volumul de date la maşinile de lucrător dumneavoastră. În acest caz, ce aţi face? Ei bine, am putea uita la nivel local de asteptare server de date, dar acest lucru ar putea cauza probleme cu reţeaua. În acest caz, un sistem de reţea, cum ar fi acest lucru poate deveni nerealist să includă în mediul de birou. Acesta poate fi, de asemenea, ca poti sa te uiti in strategii alternative de funcţionare, de exemplu, de asteptare numai de către lucrători dumneavoastră între 20 şi 6am fiecare noapte şi / sau de reglare a cererilor de date sursă.

Mutarea la vă permite să spun sursele noastre de date sumă la 100GB de date. Ei bine, da asta e destul de un pic de date pentru a vă deplasa în jurul valorii de reţea pe o actualizare. Cum ne-am asigura că avem cea mai recentă copie a datelor în acest caz? Rsync este o posibilitate, dar personal cred ca prin rularea de noi surse de date pe serverul dvs. de prelucrare de locuri de muncă şi înfiinţarea asta ca un maestru în replicare (cu un log frumos bin lung) ar putea fi mod de a merge:

replicare Prin setarea fiecare dintre muncitorii ca un sclav pentru actualizări serverul de locuri de muncă de control la surse de date se va prelinge în jos frumos pentru a lucrătorilor, fără o creştere uriaşă în activitatea de reţea (cu excepţia cazului în care este să efectuaţi o actualizare imens de date şi toate lucrătorilor lovi cu piciorul în la o dată). Acest lucru are avantaje faţă de rsync în care nu ar obţine o pauză lungă înainte de fiecare loc de muncă, ca actualizările bazei de date, mysql daemon-ul pe lucrător dvs. se va actualiza continuu sale de date în timp ce continuă transformare.

Acesta este modul în care am configurat serverul meu demonstrative. Pentru a configura replicare am urmat ghidul de pe site-ul MySQL ( Configurarea replicare ) şi în 20 de minute am avut asistentul meu inital replicarea de control de locuri de muncă setul de date servere. Pentru fiecare lucrător suplimentar setările de replicare şi de procesul de lucrat de fiecare dată când VM a fost copiat.

Rezumat

În această secţiune a articolului ne-am uitat la cat de usor si fara durere, este pentru a menţine codul de procesare de până la data de rsync using sau subverion (SVN) pentru a face munca şi pentru a reduce traficul în reţea la time. acelaşi Avem, de asemenea discutat modul în care pentru a păstra informaţiile de date sursă up-to-data, permiţându-i să prelinge în jos pentru fiecare dintre muncitorii. Astfel, am zona asigurându-se că ne ţine pasul cu logica de afaceri si de informare în sistemul nostru de reţea de birou. Nu va fi, evident, nenumarate alternative pentru efectuarea acestor sarcini, dar aici au fost două exemple simple pentru a arăta cât de uşor o soluţie este de a veni cu.

Dată următoare

În partea finală a acestei serii, aptly numit Partea 5 , vom discuta despre implementarea acestui sistem. Voi rezuma ceea ce a fost învăţat şi ceea ce am reuşit să creeze.

Oficiul pentru Grid Computing utilizând medii virtuale - Partea 3

Prin , vineri 04 decembrie 2009 23:37

Introducere

Eu lucrez intr-o companie în care vom rula multe locuri de muncă lot de prelucrare a milioane de înregistrări de date în fiecare zi şi m-am gândit recent la toate maşinile care stau în jurul valorii de fiecare şi în fiecare zi, nu face nimic pentru mai multe ore. Nu ar fi bine dacă am putea folosi aceste maşini pentru a consolida puterea de procesare a sistemelor noastre? În acest set de articole am de gând să se uite la beneficiile potenţiale ale angajarea unui birou grilă utilizând medii virtualizate.

În partea a 2- am uitat la un server de locuri de muncă va rula, şi cum de locuri de muncă ar trebui să fie configurat pentru a realiza cea mai mare cantitate de prelucrare în acelaşi timp asigurându-se că fiecare loc de muncă este procesat, fără a eşua.

Configurarea lucrător dumneavoastră - sau serverul Limp

Următorul pas în acest proces este de a crea lucrătorilor ta virtuala. Pentru aceasta voi să utilizaţi o instalaţie de CentOS folosind VirtualBox. Mă duc pentru a instala MySQL şi PHP pe server, de asemenea, cunoscut ca un Limp (Li vomica, m ySQL, P HP) Server (I poate fi făcut acest nume în sus).

  • Instalaţi pe VirtualBox maşinii dvs. cu Windows (urmaţi link-ul)
  • Descărcaţi şi instalaţi CentOS (versiunea curenta 5.3) într-o maşină virtuală creată

Nu are rost sa ma duc la o acolo, probabil, 1000 e de tutoriale mare acolo (ok, aici e una din urmatoarele: Crearea si Centos Managing maşini virtuale în VirtualBox ). Punct important de notat este Bănuiesc că am numit maşina mea virtuală GridMachine.

În ceea ce priveşte alegerile mele de virtualizare client şi sistemul de operare merge nu există nici un motiv de mare convingător pentru fiecare alegere. VirtualBox este ceva ce am folosi pe maşina de acasă şi este susţinută de cele trei sisteme de operare majore. Am ales ca CentOS sale un sistem de operare stabil bun si l-am folosi pe serverul meu web. Eu sunt un credincios mare în instrumentele potrivite pentru locul de muncă (deşi eu sunt aplicabile "utilizarea mai rapid si mai usor pentru tine" mentalitatea de aici), aşa că, dacă sistemul de operare X rulează cod mai repede şi mai eficient utilizarea că, în loc:)

Este important de asiguraţi-vă că VM dvs. utilizează DHCP, altfel pentru fiecare masina virtuala noi ar trebui să fie configurat separat, care este ceva ce noi nu utilizaţi DHCP want.By nu avem nevoie să configuraţi setările de reţea în mod individual pentru maşini muncitor, DHCP va înmâna IP-uri pentru tine. Prin urmare, puteţi copia maşina ta virtuala despre biroul fără a se preocupa de stabilire fiecare sus (acest lucru îmbunătăţeşte scalabilitatea şi reduce administrare muncitor).

Procesul ar trebui să urmărească atingerea ar fi pentru a obţine o maşină nouă fizic, instala VirtualBox, şi apoi destul de mult de mobilizare a imaginea virtuală, fără nimic altceva. Ar putea fi înţelept să setaţi toate lucrătorilor dintr-o subreţea diferită astfel încât să puteţi cel puţin vedea cât de multe maşini sunt difuzate. Veţi avea nevoie, de asemenea, pentru a configura masini pe un închiriere pe termen lung sau nelimitat DHCP leasing.

Cum pentru a rula pe ocuparea forţei de muncă lucrătorul

Aceasta este o zonă interesantă şi există mai multe metode valabile pentru prelucrare de locuri de muncă pe lucrător. Aici voi discuta doar doua dintre cele mai evidente:

  • De funcţionare perpetuu script: Un scenariu, fie el un script de shell, sau un script PHP este executat o singură dată pe lucrătorul şi se execută ca parte a unui buclă infinită. Am actualizate această metodă ca fiind unul accident de script-ul şi potenţial lucrătorilor dvs. va înceta să ruleze fără un fel de intervenţie.
  • De executare script cron pe baza: la fiecare X minute cron daemon începe un apel către script-ul pentru a obţine lucrurile merg. Fără unele verificarea aceasta ar putea duce la multe exemplare multe de funcţionare dvs. script-lucrător.

Decizia mea a fost să meargă cu cron, care va începe un script de shell fiecare minutes. 10 script-ul meu coajă îndeplineşte următoarele atribuţii:

  1. Obţineţi o listă proces şi grep acest lucru pentru "php". Dacă nu a fost găsit apoi continua.
  2. Apel codul de locuri de muncă, în cazul meu, acest lucru ar fi PHP ceva bazat
  3. Script lucrătorul completează alerga sale
  4. Gata pentru a merge din nou la apel corespunzătoare următoare

Bash script-ul meu arata ceva de genul cu următorul text:

  # / Bin! / Sh
 dacă ps ax | grep-v grep | grep php> / dev / null
 atunci
     echo "locurilor de muncă este în prezent de procesare, ieşire"
 altfel
     echo "Iov nu se execută, începe acum"
     php yourJobProcessingScript.php
 Fi 

Notă: Echo sunt aproape complet inutil, dar poate ajuta la următoarea persoană pe care vine de-a lungul pentru a încerca şi să le editaţi.

Concluzionează că înfiinţarea de maşină virtuală lucrătorului, rapid, simplu şi uşor de a copia la fiecare nouă piesă de hardware, care este primit. "Inteligenţa" a sistemului de reţea într-adevăr nu este în sistemul de operare vizualizate, de-a face cu codul creat pentru a procesului de locuri de muncă, de configurare de locuri de muncă, şi în asigurându-se că locul de muncă se execută atunci când este necesar (adică atunci când gazda este în aşteptare ).

Configurarea Windows pentru a iniţializa lucrătorilor

Prima sarcină este de a lucra în comandă necesare pentru a rula maşină virtuală de la linia de comandă ferestre. Dacă aţi instalat VirtualBox în locaţia implicită şi aţi numit dumneavoastră lucrător GridMachine atunci comanda trebuie să încărcaţi până lucrător este:

  "C: \ Program Files \ Sun \ VirtualBox \ VBoxManage.exe" startvm GridMachine 

Cu toate acestea pentru a rula script-ul într-o "fără cap" de stat trebuie să facem uz:

  "C: \ Program Files \ Sun \ VirtualBox \ VBoxHeadless.exe"-startvm GridMachine - vrdp = off 

Acesta va porni maşina virtuală, fără GUI şi lăsaţi-o pentru a salva de stat cu gratie. Al doilea argument se opreşte RDP astfel încât să nu intre în conflict cu ferestre RDP, sau vă dau un mesaj despre ascultare pe portul 3389. Numele maşina virtuală este sensibil la majuscule!

Apoi, va trebui să setaţi Windows până la lovitura de începere VM noastre lucrător de îndată ce aparatul a fost inactiv. Pentru a face acest lucru (pe Windows XP) va trebui să mergi pe Start -> All Programs -> Accessories -> System Tools -> Activităţi programate după cum urmează:

sarcini planificate

Faceţi clic pe Următorul pe "Adăugaţi sarcina planificată" urmată de răsfoiţi pentru a adăuga un program personalizat. Navigaţi la script-VBoxManage dvs. şi faceţi clic pe OK. Program de activitate pentru oricare dintre opţiunile de (ne vom schimba acest lucru într-un minut) şi a continua. După sar peste urmatorul ecran Windows vă va întreba care doriţi să rulaţi această sarcină, aş sugera fie "administrator" sau de a crea un utilizator nou privilegiat. Amintiţi-vă nu vrem să interfereze cu contul personal standard de pe masina, la orice punct. Faceţi clic pe Următorul şi check arată opţiunile avansate pentru această sarcină.

Până la sfârşitul caseta alerga adăuga noastre "startvm GridMachine" şir şi să se asigure că funcţionează numai atunci când este conectat la stânga unticked. Vizitează sarcină programul următor şi schimba programul derulantă la opţiunea "atunci când inactiv", alegeţi cantitatea de timp pe care doriţi ca aparatul să fie idle, înainte de a trece la fila următoare.

În cele din urmă debifaţi opţiunea care prevede opri activitatea în cazul în care a fost difuzate suma X de timp, dar nu bifaţi opţiunea de a opri de activitate în cazul în care maşina nu mai este inactiv.

program

Asta e, atunci pentru configurarea gazdă ferestre!

Rezumat

În această parte am înfiinţat o maşină virtuală pentru a acţiona ca un lucrător, precum şi modul în care noi o numim şi să execute script-uri de locuri de muncă noastre de prelucrare (pentru mine un script PHP). De aici ne uităm la cum să înfiinţeze copii noastre de ferestre pentru a porni maşina virtuală în modul fara cap atunci când calculatorul devine inactiv, şi de a salva starea sa atunci când utilizatorul se reia de utilizare a aparatului. Sperăm că în acest moment vedeţi cât de simplu este să înfiinţeze un astfel de sistem şi sunt mâncărime pentru a obţine unele experimente vă merge!

Dată următoare

În partea 4 , vom fi uitat la utilizarea instrumentelor pentru a se asigura că rulaţi ultima versiune a surselor de cod şi de date, astfel încât rezultatele obţinute sunt intotdeauna la curent cu cele mai recente informaţii de afaceri şi logică.

Oficiul pentru Grid Computing utilizând medii virtuale - Partea 1

Prin , vineri 04 decembrie 2009 11:23

Introducere

Lucrez într-o companie în care vom rula multe locuri de muncă de prelucrare de loturi milioane de înregistrări de date în fiecare zi şi m-am gândit recent la toate maşinile care stau în jurul valorii de fiecare zi nu face nimic pentru mai multe ore. Nu ar fi bine dacă am putea folosi aceste maşini pentru a consolida puterea de procesare a sistemelor noastre? În acest set de articole am de gând să se uite la beneficiile potenţiale ale angajarea unui birou grilă utilizând medii virtualizate.

Ca un PHP developer am de gând să utilizeze instrumente pe care le folosesc în fiecare zi şi anume, Linux, mySQL , PHP, VirtualBox şi subversiune (SVN). Cu toate acestea Sper că acest ghid se va adapta la alte limbi şi tehnologii la fel de bine.

Soluţia oferă Eu va fi foarte vag în funcţie de tipul de prelucrare am fi avut nevoie pentru a realiza toate acestea, acest lucru nu poate fi adevarat prin intreg articolul ca voi schimba lucrurile pentru simplitate, sau pentru a produce mai multe scenarii interesante de utilizare.

Aceste medii virtualizate va rula pe maşinile ferestre, deoarece aceasta este ceea ce majoritatea birourilor alerga. De prelucrare că a echipamentelor de birou nu ar trebui să interfereze cu personalul care utilizează aceste maşini, ar trebui să nu necesită întreţinere la maşină, şi să fie uşor dislocabile pentru maşini noi în care acestea devin disponibile. De asemenea, maşinile noi nu ar trebui să virtuale necesită nici o configurare suplimentare, deoarece aceasta reduce semnificativ scalabilitatea şi uşurinţa la care reţeaua poate fi extins.

De ce Implementaţi un Grid Computing Office?

În primul rând s-ar putea să fie de gândire, ce să nu folosim doar o resursa de cloud computing, cum ar fi platforma Amazon EC2 lui ? Ei bine, ar putea fi mai multe motive, de exemplu:

  • Tu nu va încredinţa anumite date la un mediu cloud computing
  • Nu poţi pune anumite date într-un mediu cloud computing pentru motive juridice (de exemplu, date care părăsesc ţara), potenţial pentru motive juridice, de exemplu, înregistrări NHS.
  • Doriţi să păstraţi unităţile de procesare a închide şi au control deplin asupra hardware-ul prea
  • Nu aveţi fonduri proiectul de a executa instanţe nor
  • Biroul dvs. nu are o conexiune la internet şi, prin urmare, ei nu este posibil de a utiliza o resursă nor
  • Nu-ti place ploaia, norii de ploaie sugerează, prin urmare, vă păstraţi bine departe

Sunt sigur că lista ar putea continua, dar cred că e suficient pentru acum.

Avantajele unui Computing Grid Oficiul pentru

Ei bine, vă permite să facă unele matematică (şi în stil fizica va permite adevărat face unele ipoteze de măturat strada). Imaginati-va ca au server de mare de prelucrare a musculos de funcţionare 100 de locuri de muncă pe zi. În biroul dumneavoastră aveţi 50 de maşini care sunt în repaus 16 ore pe zi, fiecare dintre aceste maşini este de 10%, la fel de puternic ca Sever de procesare musculos. (Toate rezultatele aici sunt rotunjite la subestimeze creste performanta).

Deci, 1 masina de putere * 10% * 2 / 3 = 0.067 de timp şi anume 1 prelucrare pe ecranul inactiv, în timp ar putea proces de 6 locuri de muncă plin pe zi.

Dacă scara acum asta este nevoie de 15 desktop-uri în aşteptare pentru a procesa cat mai multe locuri de muncă pe zi ca serverul dumneavoastră principală de procesare nu.

Deci, în biroul nostru pretinde de 50 de masini noi ar putea creste puterea noastra de procesare de la 1 server de până la 4 servere de prelucrare complet, sau am putea fi de prelucrare a 400 de locuri de muncă pe zi în loc de 100.

Aviz, pentru nici o investiţie în hardware nou compania ta tocmai a crescut capacitatea de prelucrare a lot de 4 ori! Potenţial ai de gând să crească utilizarea dvs. de alimentare, dar de la cele mai multe medii de birou am fost la maşini sunt, în general, pe stânga peste noapte, oricum, asa ca puteti vedea acest lucru ca pe o iniţiativă verde.

Alte avantaje înseamnă, de asemenea, că investiţiile în noi (sau actualizate), serverele de procesare poate fi amânată în cazul în care maşinile de birou sunt suficiente şi că, după cum vă îmbunătăţi puterea de maşini de birou dvs. grila de la birou devine mai puternic în mod automat.

Tehnologii

Ce ai nevoie? (Sau mai corect ceea ce am folosit):

  • Maşini de birou inactiv (in cazul meu un schimb vechiul Windows XP laptop)
  • VirtualBox (sau un alt client software de virtualizare)
  • O maşină virtuală, cu PHP, mySQL running execută o tăietură în jos sistem de operare, eu sunt de asteptare aceste servere Limp meu:)
  • Locuri de munca pentru a rula
  • Job server (poate fi o altă maşină virtuală undeva)

Locuri de munca tipice

Tipurile de locuri de muncă că acest sistem este proiectat pentru a rula este după cum urmează:

  • Sistem primeşte o listă de date pe care avem nevoie pentru a se potrivi şi să se întoarcă rezultatele
  • Potrivirea presupune verificarea / Cauta dupa mai multe (destul de statică) surse de date
  • Rezultatele de la sursele de date poate solicita validarea suplimentare, care fuzionează, verificarea de surse de date suplimentare, ca răspuns la rezultatele
  • De date este returnat cu înregistrările potrivite, pe deplin validate şi prelucrate
  • Fiecare înregistrare într-un loc de muncă este independent de restul

Deci, practic ne uităm la execută de locuri de muncă care necesită un amestec de interogarile bazei de date şi unele ronţăit număr, un scenariu destul de tipic într-un mediu de afaceri.

Grila de soluţii nu sunt numai avantajoase pentru prelucrare de locuri de muncă de acest tip. Practic, orice proces care poate fi împărţită în unităţi independente pot fi rulate în paralel. A se vedea acest Wikipedia pentru mai multe exemple şi informaţii: Grid Computing , dar o serie de exemple celebre sunt SETI @ home şi BIONC . Există cadre pentru rularea grile de calcul, iar acestea sunt bine, merită să analizăm.

Ceea ce vom realiza?

Până la sfârşitul acestor articole sper să demonstreze că desfăşurarea unei grile de birou nu trebuie să fie extrem de scumpe sau consumatoare de timp. Am de gând, pentru a discuta:

  • Configurarea sistemului de control de locuri de muncă, locuri de muncă de configurare
  • Crearea unei maşini de prelucrare adecvate virtuală
  • Cum se setează sistemul de pe un calculator cu Windows
  • Asigurarea sunteţi folosind cele mai noi date şi codul
  • De desfăşurare şi evaluare comparativă
  • Privind în perspectivă

Voi fi de constructii (ok am construit, apoi a scris acest lucru) o cerere de exemplu pentru a testa conceptele pe o maşină locală utilizând Windows XP şi a mea "GridMachine" maşină virtuală. Serverul meu de control de locuri de muncă va fi masina mea principală, care ruleaza Fedora 11 .

Acest lucru este în nici un fel menite să demonstreze existenţa unui sistem complet de lucru robust, sa însemnat mai mult de o demonstraţie şi discutarea care arată că aceste lucruri pot fi realizate intr-un spatiu rezonabil de scurt de timp si la costuri mici. Vă rugăm să nu ezitaţi să-mi trimiteţi orice comentarii, corecturi, sau îmbunătăţiri şi voi face tot posibilul pentru a păstra acest articol actualizat pentru a se potrivi.

Dată următoare

În partea a 2- Voi începe prin a uita la sistemul de control de locuri de muncă, şi privi în modul de locuri de muncă ar trebui să fie configurat pentru a realiza cea mai mare cantitate de prelucrare în acelaşi timp asigurându-se că fiecare loc de muncă este procesat, fără a eşua.

Oficiul pentru Grid Computing utilizând medii virtuale - Partea 2

Prin , vineri 04 decembrie 2009 11:23

Introducere

I work in a company where we run many batch jobs processing millions of records of data each day and I've been thinking recently about all the machines that sit around each and every day doing nothing for several hours. Wouldn't it be good if we could use those machines to bolster the processing power of our systems? In this set of articles I'm going to look at the potential benefits of employing an office grid using virtualised environments.

In Part 1 I gave an overview of the system and technologies I will be using as well as discussed some of the potential reasons why you would want to create an office grid.

Job Control

If you're going to be running jobs then you're going to need some way to manage them. Your job control system (on your job server) needs to be really well thought out before even attempting to run an office grid. So firstly, what are the tasks for a job control system:

  • Hand out jobs upon request from workers
  • Tell workers what type of jobs to run
  • Track jobs
  • Ensure that jobs are only run once
  • Provide job data to workers, or at least tell them where to get it

The system also needs to be extensible, a solution that works for now in a single case may be extended to run several types of jobs as the business sees the worth in a grid solution. For example, jobs may gain priorities, more than one job type may exist (ie several code bases), eventually you may even run several different worker machines that are optimised for each type of job (although that does move away from the 'generic worker' idea). Always try to think about the future when developing systems, a short term vision can lead to longer term frustration and increased development time.

Job Server

We're going to need somewhere to control our jobs from, this should be the only system in your grid that has a fixed resource locator, be that an IP address, host name, URL (using internal DNS), etc. This is because the workers need to know where to look for jobs, workers need to find the job control system (not the job control system find the workers).

The job server itself doesn't really have a complicated task (in a basic system anyhow), it needs to store a list of jobs, hand out jobs, receive results, and subsequently store them for later retrieval. How these parts (such as 'hand out jobs') are defined can be very basic. Later on we can extend the system to include an administration interface to add, edit, delete, suspend jobs but this is beyond this exercise.

There is no reason whatsoever then that your job server could not be a virtual machine running within your main processing server provided it doesn't drain too many resources from it. The job server however does need high availability, if it goes down on a Friday evening you're going to lose a whole weekend of processing, potentially costing you a couple of weeks worth of processing time (when compared to your main processing server alone). You may want to consider putting your job server on a load balanced environment for high availability.

Basic Setup

Configurare de bază pentru serverul de munca noastra va consta din ceea ce am de asteptare unul dintre serverele mele Limp (care este vomica Li, m ySql, P CP). Codul se execută pe lucrătorilor tolerează va funcţiona efectiv de locuri de muncă ce se poate executa prin interactiunea cu bazele de date cu sistem de control de locuri de muncă. Mai târziu am putea crea un serviciu de web si de fapt, o parte din locurile de muncă, mai degrabă decât având în lucrătorilor face munca grea în sine, dar de acum vom continua utilizarea principiul KISS (Keep It Simple, Stupid!).

Deci, vă permite să creaţi trei mySQL tabele pentru a face faţă cu locuri de muncă. Acestea vor fi locuri de muncă ``, `jobRecords`, `şi` jobResults.

tabelul de locuri de muncă Aici Sunt folosind SQL Prieteni o alternativă mare la mic phpMyAdmin doar pentru că mai uşor de sarcina de a instala pe CentOS (pentru alţii a se vedea: 10 alternative Mare pentru a phpMyAdmin )

Acest tabel este format din 5 domenii de simplu,

  • id: identifică în mod unic de locuri de muncă
  • Numele: Ar putea fi o referinţă client, sau orice alt număr de alţi identificatori
  • Stare: Trebuie să ştiţi unde este la locul de muncă, de exemplu,
    • 0: Nu a început
    • 1: crescut
    • 2: Finalizat
  • started_by: Cine a inceput sa faca treaba? Acest lucru nu este în întregime necesar, dar este un frumos de a avea. Aş sugera lucrătorilor de urmărire prin adresa IP în reţea
  • started_at: Când a început lucrătorul de locuri de muncă? Prin urmărirea de locuri de muncă care nu au finalizat în termen de suma X de timp ştim că avem nevoie pentru a ridica din nou loc de muncă şi de a începe prelucrarea de către un alt lucrător. Lucrătorii ar putea opri de prelucrare / go offline pentru orice număr de motive, pană de curent, accident, o pierdere în reţea, etc

Este uşor de modul în care acest tabel ar putea fi extins cu câteva domenii suplimentare pentru a permite pentru urmărirea statisticilor, există o coloană de timp finisaj pentru a vedea cât de mult a luat loc de muncă, un contor pentru a vedea cât de multe lucrătorilor ridicat de locuri de muncă (evident, acest lucru trebuie să tind să 1), prioritate de locuri de muncă, lista poate continua pe şi de pe. În scenarii de locuri de muncă mai complexe, ar fi posibil să se precizeze cât de mult de memorie în care lucrătorul ar fi nevoie de acces la (şi, prin urmare, utilizarea numai de către lucrători adecvate), sau chiar ce tip de lucrător ar fi necesare.

Să adăugăm un putine locuri de munca exemplu:

exemplu de locuri de muncă

În tabelul următor este din nou destul de simplu de înţeles, acestea sunt inregistrarile noastre de locuri de muncă. Ele sunt legate la masa principală de locuri de muncă de către o coloană `jobs_id`. Fac din acest tabel foarte mult depinde de datele de care aveţi nevoie să furnizeze lucrătorilor dumneavoastră, vă permite să fac un exemplu foarte simplu în cazul în care avem patru coloane:

  • id: ID-ul de înregistrare
  • Numele: Persoana Numele
  • Adresa: Adresa Persoanei
  • jobs_id: The job ID that this record is linked to

The third and final table consists of a results table, it has much the same make up as our records table, and with the addition of some columns could be part of the records table:

  • job_record_id: Link the result to the job table
  • result: The result data

…and that's all you need for job control! (albeit at a very basic level) In my case I'm pointed to another table where my data to process was located, but this could just as easily been a file, parameters to run simulation code, you name it.

Selecting a job

As stated previously, the workers will do our job management for us for now, so all we need to really do is find a job that needs processing and get the information. How would we do this? Well pick our job selection criteria and look for jobs, in SQL I did the following:

  1. Take any jobs that are not marked as complete but from our worker and reset them (substitute __ME__ with an identifier, easiest would be IP address):
     UPDATE `jobs` SET `status` = 0 WHERE `status` = 1 AND `started_by` = __ME__; 
  2. Using our job selection criteria, select a job and tell the control system that this worker is dealing with it:
     UPDATE `jobs` SET `status` = 1, `started_by` = __ME__, `started_at` = NOW() WHERE `status` = 0 OR
    (`status` = 1 AND `started_at` > DATE_SUB(NOW(), INTERVAL X HOUR)) ORDER BY `id` ASC; 

    By grabbing jobs that haven't returned results in X amount of time we ensure that all jobs are run in the event of a worker crashing or going AWOL.

  3. Next grab the jobs details followed by the records themselves:
     SELECT * FROM `jobs` WHERE `started_by` = __ME__ LIMIT 1;
    SELECT * FROM `job_records` WHERE `id` = __JOBID__; 

Upon completion of the job we insert our result records and mark the job as complete. Remember as jobs can suspend/resume at any time allow for some robustness in your script. It might be that the task suspends half way through updating the job control system, so checking the number of records in a job and the number of results saved back to the job control system would be a wise move.

In addition, whilst this demonstrates how jobs can be selected and managed from an SQL-query frame you should really be abstracting your job control so that if you decide to switch to using a web service, a file based system, XML , or any other number of systems it will not affect the code above it.

Job Configuration

The next aspect to consider is job size and configuration. By playing with job configuration we can strike an excellent balance between speed, process replication, and reliability. Take a couple of scenarios:

  1. Jobs take 1 day each to run: This means that your workers need 15 days to process each job (remember 10% of the power for 2/3rds of the time). This is clearly not a wise configuration, your job size is way too big! It would take at least double the time to get a job processed should the initial worker go AWOL (time to pick up that it hasn't returned a result plus reprocessing time). In an ideal you'd have at least one full job easily cleared by the end of each long idle period, that way you keep the jobs ticking over and at worst case a job would take two days to process should the first go missing.
  2. Jobs take 1 minute to run: This means that your workers take about 15 minutes to run each job. Whilst this may initially seem ideal, you gain additional work processing during lunch time, coffee breaks, meetings, etc this scenario puts strain on other areas of your system and introduces its own problems. For example, firstly your setup/processing time ratio is going to go right down, therefore losing system efficiency. Your network is going to be constantly streaming job information to the various workers frustrating staff who are dong their day to day work. You're also going to put more strain on your job processing server as it has to dish out lots and lots of small pieces of work on a regular basis. Lastly, in this situation if your job server goes down you're going to create a huge back log of uncompleted work whereas bigger jobs could of continued processing blissfully unaware that the job server was experiencing difficulties.

In reality there will be no one ideal configuration for your grid setup, much depends on the available resources, types of job, job turnaround time requirements, network capability, and so on. However some guidelines would be:

  • Size jobs so that each worker can get through at least 3-4 jobs in a period of 15 hours (the longest likely idle time period)
  • Play with the job size so that setup time becomes fairly insignificant compared to the processing time (bearing in mind the above point).
  • If a job doesn't complete in double the amount of time (maybe less) you expect it to complete it assume that its gone AWOL and start processing it with another worker. This means you may have to wait up to three times the normal length of a job for it to complete (possibly longer if the subsequent job fails). You may want to reduce this time, but be careful not to reduce it too much as you may start duplicating processing tasks on a regular basis.
  • Jobs should be independent of outside requirements as much as possible. The job server, for example, should only be contacted at the start and end of every job.
  • Don't saturate your network, this will have two negative effects, your daytime staff will find using the network frustrating and problems may be experienced with connections timing out a problem that will only get worse as you scale your grid.
  • Ensure jobs can run on your workers. If jobs become too memory intensive or disk space intensive jobs will start aborting and the only thing you'll notice is a drop in number of jobs processed with no real reason why.

Submitting Results of a Job

When submitting the results of a job it is important to check that results have not been submitted by another worker, especially if the current worker has been dormant for some time.

When results are submitted ensure that the number of results matches the number of records within the job.

As stated previously, and can not be over emphasised, build fault tolerance into job retrieval and results submission. The workers can (and most likely will) go into suspend mode at the most inconvenient of times and this needs to be catered for. Also once again abstracting away your results submission will help cater for future changes to your job control system much easier to deal with.

Rezumat

In this section we have looked at what a job control server needs to do and how to get a very basic system set up. We discussed how to retrieve a job from the control system and how best to configure jobs to get the most our of your office grid system. To finish, a paragraph or two on submitting results back to the job control server was presented.

  • A job control server manages jobs and ensures that all work units are completed
  • By abstracting your job select/results submission we can change the technology of the control server without much problems
  • Configure your jobs to ensure that they are run quickly and efficiently without putting too much pressure on your network infrastructure, and without duplicating processing tasks on a regular basis.
  • Ensure that you build fault tolerance and error checking into your routines, workers can suspend and resume and the most inconvenient of times. Remember to check if results have already been submitted by another worker.

Next time

In part 3 we'll create our virtual processing machine and set up our windows machines to become idle-time workers.

Office Grid Computing using Virtual environments – Part 5

By , Friday 4th December 2009 11:03 pm

Introducere

I work in a company where we run many batch jobs processing millions of records of data each day and I've been thinking recently about all the machines that sit around each and every day doing nothing for several hours. Wouldn't it be good if we could use those machines to bolster the processing power of our systems? In this set of articles I'm going to look at the potential benefits of employing an office grid using virtualised environments.

In Part 4 we looked at using tools to ensure that we're running the latest version of the code and data sources so that obtained results are always up-to-date with the latest business information and logic.

Pre-Deployment

Before deploying your grid system if there's one thing you do and one thing alone it's benchmark your current system ! No matter what you tell colleagues about how much extra work your system is going to do unless you have numbers to back this up your guarantees are nothing. Deci,

  • how many records can you process currently? Per Day? Per Hour?
  • How long does it typically take to turn around a job?
  • How much more capacity do you have?

There's also additional questions:

  • If your processing server (or one of your processing servers) goes down how will this affect your capabilities, will you be crippled?
  • What advantages do you hope/expect to get from a grid system?
  • Are your office machines capable of running the jobs?
  • Are your (or can you jobs be converted) to wrok in this style of running?

The last major point is to take your time on any major change like this. Update your processing code to work using the new methodology, benchmark again. Possibly set up your processing server to run a virtual machine, after all your processing server will just be another worker (just a very powerful one relatively). Allow the new process to settle.

Deployment

My suggestion would be to pop into the office one weekend perform all the installations and setup. Do this just before a fortnight's holiday and leave so other poor chap to deal with the consequences… maybe not…

Deployment for a system like this needs to be slow. Despite it being relatively simple to set up this system will affect your entire office infrastructure (well the digital one). Firstly, roll out to a couple of machines at a time, monitor network traffic, how the worker hosts perform on a day-to-day basis. You may need to alter your job configuration in response to your findings.

Once the system has settled with a few machines (lets say 10% of all office machines, ie 5) keep monitoring network traffic and host machine performance. Next benchmark again, you should now be processing 33% more jobs than your first benchmarks. Check this is so, or that you're at least in this ballpark. If not, investigate what is going on before moving on. Repeat this cycle until you happily have all office machines running without killing individual machine performance or grinding your network to a standstill.

At all times keep benchmarking, even after all deployments are made. Check how new code updates affect speed of your system, check all workers are reporting in and processing jobs. Slowly (very slowly) increment your job configuration to get the best from your workers and network.

Opreste-te!

What if you want to stop your workers from running at some time? They are all out there running, regenerating, and trying their best to process data like hungry insects. The answer may seem obvious but its worth adding just in case its overlooked. Simply edit your processing script with an exit(0) or die() or some other statement to kill your processing job. An important reason why we always try to update to the latest processing script before any run!

Demonstration System

In order to write this set of short articles I created a very small grid to demonstrate the technologies and methodologies. I read lots of articles, tutorials, and used various tools to setup and monitor what was going on. By no means have I gone out and saturated a whole office with traffic and nor have I had access to a regular staff members PC to see how host performance was affected.

My demonstration system was very humble indeed. I used my regular desktop set up as a job control server. On this I had installed mySQL server installed set up as a master in replication, PHP , and SVN linked through apache (for access via worker VM).

I then created a centOS worker machine on VirtualBox on a 6 year old windows XP laptop. I setup scheduled tasks as specified after copying the VM onto the machine and let it go.

The virtual machine was set up with PHP, subversion, and mySQL. I checked out a branch named 'worker' from my job control servers repository and made sure it could be updated using 'svn update'. Next I setup mySQL as a slave and checked that data was replicating from mySQL on the job control server down to the worker VM. After all this I setup the bash script and the cron job.

My processing script basically went along the lines of this (very simple stuff):

  • Read in the name field
  • Counted the number of similar names in a table from the data source held on the VM
  • Counted the number of names as above but splitting the name by spaces (ie forename, middle, surname)
  • Repeated this process 1,000 times

Each job took approximately 20 minutes to run. At one point I opened several copies of the worker VM on the windows laptop and watched the jobs be checked off by each of the worker IP addresses. At this point I also confirmed that replication automatically restarted.

Leaving the laptop to idle resulted in a worker starting to process jobs from the job control server. When resuming laptop usage there was a delay of about 30-60 seconds, this is a fair amount of time and staff would need to be made aware that their machine may pause for a short while when returning to the machine. Newer machines may not have a pause of this long. The benefit of the amount of processing performed by these machines during idle periods would more that outweigh staff members having to wait a short period (say 1 minute) on arriving at their machines of a morning (I frequently wait longer that this for a Windows Defender update to take place) provided they were made aware of this (useful time to grab a morning coffee!).

Overall I feel confident that I have demonstrated the technologies that could be used to create such a system. I have shown that such a system does work on a (very) small scale and with some more experimenting could be scaled up utilise the resources of an office's machines. If I don't get to the point of doing this I would be very interested to know/see when someone else does.

Conclusions / Evaluation

The next obvious step would be to actually get a real world example and start to deploy a system such as this within an office environment and see what happens. Asking a business to commit to this without a trail blazing company to prove the technology and effectiveness may be a little difficult. Grid/Distributed computing is very popular is some circles and has some large applications (BIONC, SETI@Home, Folding@Home, etc). I did not, however, find a smaller scale and simple system like this in my searches that could be rolled out within an office environment.

I created a basically free system using mostly open source software and tools available in almost any office. The technologies were basically demonstrated and show to perform and work as expected. Hopefully I have show that with not much work and with a very simple setup you can deploy an office grid computing system that is powerful, cheap, and scalable all at the same time.

Once a system is up and running there is almost no end to the amount of customisation and improvements you can make. For example statistics / benchmarking can easily be added showing the worth of such a system every day. New machines can be added quickly and easily as and when they arrive with upgrades to existing hardware bolstering your processing power.

I hope you've enjoyed reading this series of articles and its given you food for thought on running an office grid system. The solution presented here won't necessarily work in all situations but should be adaptable to allow you to get your data processing done using your own solution.

Please feel free to send me any comments, corrections, or improvements and I'll do my best to keep this article updated to match.

Zend Framework: Fundamentals – Review

By , Saturday 28th November 2009 10:42 pm

My employer recently paid for a group of us developers to take the Zend Framework: Fundamentals course, here I'll summarise my thoughts and opinions on the course for others. For those looking to save time, here's my summary:

For developers who haven't had time to look at the Zend Framework this course (Zend Framework: Fundamentals) offers a good overall picture of the framework introducing you to the key areas and giving enough information in order to continue. For those who have spent time looking at the framework and have followed one or two tutorials this course does not offer much beyond.

Fundal

I've been a PHP developer for around 5-6 years, and have started working with the Zend Framework on a component basis over the last 6 months. I've developed and/or been a developer on a couple of small Zend Framework MVC sites. I'll be honest, I haven't had a huge amount of exposure to other frameworks from a coding point of view but have spent several hours researching the project websites and evaluating them. The framework and the community surrounding Zend Framework it is quite exciting and there seem to be huge possibilities in where its going.

About the Course

The course is delivered over 9 two hour webex sessions (with a 10-minute break in the middle). The time is spent going through a set of slides provided by Zend with discussion at any time. You can use a microphone to talk to the instructor, but to be honest I didn't see anyone use anything more than the chat window. In addition a VMWare Ubuntu machine is provided that has example code and projects set up an a trial version of Zend Studio. The course leader talks to attendees either over an integrated VoIP solution, or you can dial in using one of the many worldwide dial in numbers.

During the course the material consists of a brief overview of the Framework and the MVC pattern before heading into a sample guestbook application. The discussion demonstrated bootstrapping, Zend_Application, Db Tables, Database access, Forms, Filtering, ACL, Validating, etc, etc. Basically covering all the topics you'd require to get a basic site up an running all the time giving you the tools to go and get more advanced in the framework (although this did amount to 'See the website' much of the time).

Time is given to code up some examples, and to develop the 'guestbook' and simple 'wiki' application. Personally I felt that providing the code or each app and then asking us to develop what was essentially a copy alongside didn't really provide a good learning experience. I would have preferred to develop an application similar, but not identical. to the example application with the benefit of having a guide to refer to. Alternatively building the applications from scratch with the demonstrator would of possibly led to more questions about why and how , thus giving a better understanding of the framework, after all you can look up specifics after the course.

The last lecture consisted of working on the wiki application with help/guidance from the instructor. After the course feedback was taken, it was emphasised several times through the course that Zend takes feedback very seriously, in fact apparently our version of the course was quite new. Some of the other developers in the company will be taking the course soon so it will be interesting to see if this has happened.

The course style was informal, allowed for feedback and collaboration between attendees and the instructor. The course leader was friendly, approachable (email addresses were shared for questions), and whilst his presentation from the slides was a bit shaky seemed fully competent in the framework. He was clearly someone who used the framework on a regular basis rather than someone who is taught to teach the course, I liked the 'real world' experience in that respect.

Overall Feeling

In some ways I found the course a waste of time, in others it was very handy. Hopefully I'll get my reasons across clearly, and maybe provide some food for thought or useful feedback (knowing me this is unlikely!).

For myself this course was aimed at too low a level. Having gone through the quickstart guide, read Rob Allen's Zend Framework in Action, and worked with the framework a little I didn't really get anything too much. I would of liked the course to pick up from the end of the quickstart and develop additional skills.

That said, the course title does clearly state “Zend Framework: Fundamentals ” and in that aspect the course achieves what it sets out to do. Other members of the development team that haven't spent the time looking into the framework finished each session with enthusiasm and asked questions which was really nice to see.

All was not lost, it was good to spend time confirming the basic details of the framework and get to ask a couple of questions in areas where I wasn't 100%. It was also time that I got to sit down each day and think about coding using the framework and future projects, something I wouldn't of been able to do otherwise (can you imagine your company agreeing to that? :) ). Last but not least you also get a nice certificate from Zend to say that you attended the course (albeit by email).

Zend Framework Certification

This was one question that kept coming to mind during the course, would it prepare me for the certification? The quick, easy is a resounding No . The course instructor was quite clear on that with the additional advice that for the certification you should really be using the framework on a day to day basis and feel very comfortable and confident in its usage and methodologies.

Rezumat

Given everything I've written above, I'll summarise everything in two easy bullet points:

  • New to Zend Framework: This course does exactly what you'd expect, it gives you a nice introduction to the framework and a good grounding on the basics from which you can build. The course seems to generate interest and enthusiasm for the framework amongst developers.
  • Used the Zend Framework: While it was nice to shore up some of the very basics I felt the time, effort, and funds to take the course could of been better spent elsewhere. It will be nice to see Zend create a new higher level course to take developers to the next level – at least to the standard of certification and beyond. For that I would sign up immediately.












Tema Panorama de Themocracy

8 vizitatori on-line acum
6 guests, 2 bots, 0 members
Max vizitatori azi: 22 la 06:15 UTC
Aceasta luna: 23 la 24-08-2011 05:40 UTC
Acest an: 130 la 28-03-2011 22:40 UTC
Tot timpul: 130 la 28-03-2011 10:40 UTC