Building a Cloud-based Social Network withZend Framework and Doctrine 2Thorsten Rinne I 1 October 201                  1th...
Team LeadScrum MasterHead of Open Source Labs@ThorstenRinne                           Building a Cloud-based social networ...
Last year a new customer came up with an idea...             Building a Cloud-based social network I   Mayflower GmbH I 1 O...
A Social Network!          Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 4                    ...
A Social Network?          Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 5                    ...
for friends.       Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 6                            ...
for business.        Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 7                          ...
for videos.       Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 8                             ...
for photos.       Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 9                             ...
for real estate?         Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 10                     ...
The idea:Connect people, buildings    and businesses.              Building a Cloud-based social network I   Mayflower GmbH...
PeopleBuilding                                          Business                    Building a Cloud-based social network ...
People... is living at ...Building                                                      Business                          ...
People... is living at ...                       ... is the home of ...Building                                           ...
People... is living at ...                                             ... is an employee of ...                       ......
People... is living at ...                                             ... is an employee of ...                       ......
People... is living at ...                                             ... is an employee of ...                       ......
People... is living at ...                                             ... is an employee of ...                       ......
We thought:Nice idea, let‘s start!             Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 1...
4 Requirements       Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 14                         ...
1    Agile softwaredevelopment with Scrum             Building a Cloud-based social network I   Mayflower GmbH I 1 October ...
Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 16                                              ...
1 product owner (customer)              Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 16      ...
1 product owner (customer)  1 scrum master (myself)              Building a Cloud-based social network I   Mayflower GmbH I...
1 product owner (customer)  1 scrum master (myself)   1 development team              Building a Cloud-based social networ...
Scrum Return  Gift wrap Cancel  Product  backlog              Building a Cloud-based social network I   Mayflower GmbH I 1 ...
Scrum              Sprint              2 weeks Return  Gift wrap Cancel  Product  backlog                Building a Cloud-...
Scrum               Sprint               2 weeks Sprint goal    Return  Gift wrap Cancel  Product  backlog                ...
Scrum                         Sprint                         2 weeks Sprint goal    Return               Sprint           ...
Scrum                         Sprint                         2 weeks Sprint goal    Return               Sprint           ...
Scrum                         Sprint                         2 weeks Sprint goal    Return               Sprint           ...
Scrum                          Sprint                          2 weeks  Sprint goal     Return                Sprint      ...
Scrum                     24 hours                            Sprint                            2 weeks  Sprint goal     R...
2Scalability        Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 18                          ...
Classic web architecture             Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 19         ...
Browser          Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 20                             ...
BrowserAppserver 1     Appserver 2                    Building a Cloud-based social network I   Mayflower GmbH I 1 October ...
BrowserAppserver 1       Appserver 2DB Master                 DB Slave                      Building a Cloud-based social ...
We built a simple, scalable   n-tier architecture.               Building a Cloud-based social network I   Mayflower GmbH I...
Frontend NodesBackend Nodes        Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 22           ...
Frontend Nodes don‘t save     anything. Never.              Building a Cloud-based social network I   Mayflower GmbH I 1 Oc...
Backend Nodes can besharded and/or clustered.              Building a Cloud-based social network I   Mayflower GmbH I 1 Oct...
http://www.flickr.com/photos/nirak/644337888/The solution? The cloud.        Building a Cloud-based social network I   Mayfl...
http://www.flickr.com/photos/nirak/644337888/Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 26  ...
3Simplicity       Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 27                            ...
Automate as much as     possible           Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 28   ...
No new fancy things likeScala, node.js or MongoDB.              Building a Cloud-based social network I   Mayflower GmbH I ...
Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 30                                              ...
4Extensibility         Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 31                       ...
Lean StartupWe can kick/create new features all the time            Building a Cloud-based social network I   Mayflower Gmb...
Lean StartupDecoupled modules and       classes            Building a Cloud-based social network I   Mayflower GmbH I 1 Oct...
Architecture       Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 34                           ...
Frontnode 1            Frontnode 2            Varnish                Varnish             nginx                  nginx     ...
Is this scalable?          Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 36                   ...
Frontnode 1            Frontnode 2            Varnish                Varnish             nginx                  nginx     ...
Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 38                                              ...
3    Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 39                                         ...
3    Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 40                                         ...
3    Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 40                                         ...
3    Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 40                                         ...
3    Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 40                                         ...
3    Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 40                                         ...
3    Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 40                                         ...
3    Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 40                                         ...
3    Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 40                                         ...
Multiple Frontnodes         3             Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 40    ...
Multiple Frontnodes         3Backend Sharding             Building a Cloud-based social network I   Mayflower GmbH I 1 Octo...
Infrastructure        Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 41                        ...
One Ubuntu package to    rule them all.           Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 ...
Development VMsJenkins CI Server Selenium ServerMonitoring Server  Testing Server          Building a Cloud-based social n...
http://www.flickr.com/photos/nirak/644337888/   Only on production:  Frontend Nodes 11.04Backend Nodes 10.04 LTS           ...
http://www.flickr.com/photos/nirak/644337888/Mayflower DMZ                                                             amazo...
http://www.flickr.com/photos/nirak/644337888/ Mayflower DMZ Developer Laptopamazon AWS  with Ubuntu VM(Git repo + complete E...
http://www.flickr.com/photos/nirak/644337888/Mayflower DMZ            Gitorious Server                             amazon AW...
http://www.flickr.com/photos/nirak/644337888/           2 Frontnodes         3 BackendnodesMayflower DMZ    Development Moni...
http://www.flickr.com/photos/nirak/644337888/       Mayflower DMZ  2 Frontnodes                                             ...
http://www.flickr.com/photos/nirak/644337888/   ConfigurationManagement done with           Building a Cloud-based social ne...
http://www.flickr.com/photos/nirak/644337888/Configuration changes areon every VM in 5 Minutes.         #WIN              Bu...
Application      Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 52                             ...
Do you remember?         Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 53                     ...
Frontend 1              Frontend 2            Varnish                 Varnish             nginx                   nginx   ...
Backendnode 1   Backendnode 2                                                         Backendnode 3MySQL Master     MySQL ...
Backendnode 3               RabbitMQBackendnode 1 Apache Solr                Backendnode 2MySQL Master  MogileFS      PHP ...
Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 56                                              ...
Apache Solr XML REST API   Profiles     Profiles          Profiles                          Autosuggest     DE          EN   ...
Search string: „mapolis“                                                                    LL(1) parser„q=mapolis&sort=na...
Profile information           autosuggestions        user generated content                                                ...
Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 60                                              ...
Why do we need amessage broker?         Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 61      ...
Example:Editing your profile           Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 62        ...
c c                                                                                                    ynnsy              ...
Why RabbitMQ?       Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 64                          ...
Backendnode 1   Backendnode 2                                                         Backendnode 3MySQL Master     MySQL ...
Backendnode 1MySQL Master  MogileFS Memcached Backendnode 3   Backendnode 2    MySQL Slave                  RabbitMQ   PHP...
MogileFSan open source distributed filesystem                    Building a Cloud-based social network I   Mayflower GmbH I ...
Application levelNo single point of failureAutomatic file replicationShared nothing architectureLocal filesystem agnostic   ...
Client                     (API: Perl)     Trackers      Trackers                                            Storage Nodes...
Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 69                                              ...
Application  Host 1                                             Host 2R/W  MySQL       Replication                        ...
Application              Keepalive  Host 1                                             Host 2                WR/W         ...
Some notes on ourdatabase architecture.            Building a Cloud-based social network I   Mayflower GmbH I 1 October 201...
We use MySQL askey/value storage.          Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 72   ...
We implemented allrelations in the application.                Building a Cloud-based social network I   Mayflower GmbH I 1...
We already prepared thedatabase design for sharding               Building a Cloud-based social network I   Mayflower GmbH ...
Benefits:Very simple, scalable and   flexible architecture              Building a Cloud-based social network I   Mayflower G...
Drawbacks: More complexity in thePHP code. But that‘s okay.              Building a Cloud-based social network I   Mayflowe...
Frontend 1              Frontend 2            Varnish                 Varnish             nginx                   nginx   ...
Frontend 1          Frontend 2  Varnish             Varnish   nginx               nginx PHP 5.3             PHP 5.3       ...
Frontend 2               VarnishFrontend 1      nginx              PHP 5.3  Varnish   nginx PHP 5.3      Building a Cloud-...
Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 79                                              ...
Doctrine 2is a data-mapper,not ActiveRecord.          Building a Cloud-based social network I   Mayflower GmbH I 1 October ...
We use Doctrine 2 as ORM. And we think it‘s great.              Building a Cloud-based social network I   Mayflower GmbH I ...
/**     ORM with Doctrine 2  * @Entity  * @Table(name="role")  *  */class Mapolis_Entity_Role{     /**      * @Id      * @...
Working with objects/**  * Saves the personal interests of user.  *  * @param Mapolis_Entity_Person $profile  *  * @return...
Working with objects/** * Deletes a building. * * @param Mapolis_Entity_Building $building * * @return boolean */ public f...
Working with objects/**  * Show recent invitations  *  * @return array of $count recent invitations  */public function rec...
Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 86                                              ...
Why did we choose Zend     Framework?            Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I...
60 colleagues using ZendFramework in other projects.                Building a Cloud-based social network I   Mayflower Gmb...
We use Zend Frameworkmore like a component        library.            Building a Cloud-based social network I   Mayflower G...
We use Doctrine 2 instead  of Zend_Db_Table.              Building a Cloud-based social network I   Mayflower GmbH I 1 Octo...
We built our own Autoloader.         Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 91         ...
What did we use from Zend Framework?           Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 9...
Zend_Application Zend_Controller    Zend_View  Zend_ValidateZend_Translation   Zend_Locale   Zend_Cache         Building a...
Frontnode 1  Varnish   nginx  PHP 5.3       Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 94  ...
PHP 5.3 from Ubuntu 11.04             Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 95        ...
Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 96                                              ...
Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 97                                              ...
HTTP Request              Varnish HTTP accelerator  mapolis                                                 mapolis   Core...
HTTP Request             GET mapolis.com 80              Varnish HTTP accelerator  mapolis                                ...
HTTP Request             GET mapolis.com 80              Varnish HTTP accelerator  mapolis                                ...
HTTP Request             GET mapolis.com 80              Varnish HTTP accelerator  mapolis                                ...
HTTP Request              Varnish HTTP accelerator  mapolis                                                 mapolis   Core...
HTTP Request      GET mapolis.com/de/start 80              Varnish HTTP accelerator  mapolis                              ...
HTTP Request      GET mapolis.com/de/start 80              Varnish HTTP accelerator  mapolis                              ...
HTTP Request      GET mapolis.com/de/start 80              Varnish HTTP accelerator  mapolis                              ...
Frontend    Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 100                                 ...
⊕Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 101                                            ...
JavaScript Framework           Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 102              ...
Supported browsers 7          3.6          14                                              5.0 8           7        (lates...
Development      Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 104                            ...
The Team:   1 Scrum Master      2 DevOps4 PHP/JS Developers1 Frontend Developer           Building a Cloud-based social ne...
Development ToolsUsed IDE:Zend Studio, PhpStorm, vi and TextmateDatabase change management:LiquibaseCSS helper:SASS / Comp...
Development Laptop   Ubuntu VM with    Local Git repoComplete software stackant <everything>             Building a Cloud-...
Some ant commands         Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 108                   ...
Some ant commands$ ant db-development                       Building a Cloud-based social network I   Mayflower GmbH I 1 Oc...
Some ant commands$ ant db-development$ ant sync                       Building a Cloud-based social network I   Mayflower G...
Some ant commands$ ant db-development$ ant sync$ ant phpunit                       Building a Cloud-based social network I...
Some ant commands$ ant db-development$ ant sync$ ant phpunit$ ant jslint                       Building a Cloud-based soci...
Some ant commands$ ant db-development$ ant sync$ ant phpunit$ ant jslint$ ant deb                       Building a Cloud-b...
Some ant commands$ ant db-development$ ant sync$ ant phpunit$ ant jslint$ ant deb$ ant build-vm                       Buil...
Typical commit workflow            Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 109           ...
Typical commit workflow$   vi Foo.php$   ant phpunit$   ant jslint$   git add Foo.php$   git commit -m ”Bar”$   git pull$  ...
ant phpunit<target  name="phpunit"  depends="db-test"  description="Run all tests">  <exec executable="phpunit"        fai...
One click deployment           Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 1 1              ...
And how does it look now?              Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 1        ...
Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 1                                               ...
Questions?      Building a Cloud-based social network I   Mayflower GmbH I 1 October 201 I 1                               ...
Thank you very much!Please rate me @ http://joind.in/talk/view/3884Contact   Thorsten Rinne          thorsten.rinne@mayflow...
Upcoming SlideShare
Loading in...5
×

Building a Cloud-based Social Network with Zend Framework and Doctrine 2

7,913

Published on

Published in: Technology, Business
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
7,913
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
233
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Building a Cloud-based Social Network with Zend Framework and Doctrine 2

  1. 1. Building a Cloud-based Social Network withZend Framework and Doctrine 2Thorsten Rinne I 1 October 201 1th 1 © 201 Mayflower GmbH 1
  2. 2. Team LeadScrum MasterHead of Open Source Labs@ThorstenRinne Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 2 1th 1
  3. 3. Last year a new customer came up with an idea... Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 3 1th 1
  4. 4. A Social Network! Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 4 1th 1
  5. 5. A Social Network? Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 5 1th 1
  6. 6. for friends. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 6 1th 1
  7. 7. for business. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 7 1th 1
  8. 8. for videos. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 8 1th 1
  9. 9. for photos. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 9 1th 1
  10. 10. for real estate? Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 10 1th 1
  11. 11. The idea:Connect people, buildings and businesses. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 1 1th 1 1
  12. 12. PeopleBuilding Business Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 12 1th 1
  13. 13. People... is living at ...Building Business Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 12 1th 1
  14. 14. People... is living at ... ... is the home of ...Building Business Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 12 1th 1
  15. 15. People... is living at ... ... is an employee of ... ... is the home of ...Building Business Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 12 1th 1
  16. 16. People... is living at ... ... is an employee of ... ... is the home of ... ... has as employee ...Building Business Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 12 1th 1
  17. 17. People... is living at ... ... is an employee of ... ... is the home of ... ... has as employee ...Building Business ... has its office at ... Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 12 1th 1
  18. 18. People... is living at ... ... is an employee of ... ... is the home of ... ... has as employee ... ... is the office location of ...Building Business ... has its office at ... Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 12 1th 1
  19. 19. We thought:Nice idea, let‘s start! Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 13 1th 1
  20. 20. 4 Requirements Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 14 1th 1
  21. 21. 1 Agile softwaredevelopment with Scrum Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 15 1th 1
  22. 22. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 16 1th 1
  23. 23. 1 product owner (customer) Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 16 1th 1
  24. 24. 1 product owner (customer) 1 scrum master (myself) Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 16 1th 1
  25. 25. 1 product owner (customer) 1 scrum master (myself) 1 development team Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 16 1th 1
  26. 26. Scrum Return Gift wrap Cancel Product backlog Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 17 1th 1
  27. 27. Scrum Sprint 2 weeks Return Gift wrap Cancel Product backlog Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 17 1th 1
  28. 28. Scrum Sprint 2 weeks Sprint goal Return Gift wrap Cancel Product backlog Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 17 1th 1
  29. 29. Scrum Sprint 2 weeks Sprint goal Return Sprint backlog Gift wrap Cancel Product backlog Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 17 1th 1
  30. 30. Scrum Sprint 2 weeks Sprint goal Return Sprint Potentially shippable backlog product increment Gift wrap Cancel Product backlog Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 17 1th 1
  31. 31. Scrum Sprint 2 weeks Sprint goal Return Sprint Potentially shippable backlog product increment Gift wrap Cancel Coupons Product backlog Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 17 1th 1
  32. 32. Scrum Sprint 2 weeks Sprint goal Return Sprint Potentially shippable Cancel backlog product increment Coupons Gift wrap Product backlog Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 17 1th 1
  33. 33. Scrum 24 hours Sprint 2 weeks Sprint goal Return Sprint Potentially shippable Cancel backlog product increment Coupons Gift wrap Product backlog Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 17 1th 1
  34. 34. 2Scalability Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 18 1th 1
  35. 35. Classic web architecture Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 19 1th 1
  36. 36. Browser Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 20 1th 1
  37. 37. BrowserAppserver 1 Appserver 2 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 20 1th 1
  38. 38. BrowserAppserver 1 Appserver 2DB Master DB Slave Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 20 1th 1
  39. 39. We built a simple, scalable n-tier architecture. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 21 1th 1
  40. 40. Frontend NodesBackend Nodes Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 22 1th 1
  41. 41. Frontend Nodes don‘t save anything. Never. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 23 1th 1
  42. 42. Backend Nodes can besharded and/or clustered. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 24 1th 1
  43. 43. http://www.flickr.com/photos/nirak/644337888/The solution? The cloud. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 25 1th 1
  44. 44. http://www.flickr.com/photos/nirak/644337888/Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 26 1th 1
  45. 45. 3Simplicity Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 27 1th 1
  46. 46. Automate as much as possible Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 28 1th 1
  47. 47. No new fancy things likeScala, node.js or MongoDB. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 29 1th 1
  48. 48. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 30 1th 1
  49. 49. 4Extensibility Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 31 1th 1
  50. 50. Lean StartupWe can kick/create new features all the time Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 32 1th 1
  51. 51. Lean StartupDecoupled modules and classes Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 33 1th 1
  52. 52. Architecture Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 34 1th 1
  53. 53. Frontnode 1 Frontnode 2 Varnish Varnish nginx nginx PHP 5.3 PHP 5.3Backendnode 1 Backendnode 2 Backendnode 3MySQL Master MySQL Slave RabbitMQ MogileFS MogileFS Apache Solr Memcached Memcached PHP 5.3 PHP 5.3 PHP 5.3 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 35 1th 1
  54. 54. Is this scalable? Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 36 1th 1
  55. 55. Frontnode 1 Frontnode 2 Varnish Varnish nginx nginx PHP 5.3 PHP 5.3Backendnode 1 Backendnode 2 Backendnode 3MySQL Master MySQL Slave RabbitMQ MogileFS MogileFS Apache Solr Memcached Memcached PHP 5.3 PHP 5.3 PHP 5.3 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 37 1th 1
  56. 56. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 38 1th 1
  57. 57. 3 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 39 1th 1
  58. 58. 3 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 40 1th 1
  59. 59. 3 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 40 1th 1
  60. 60. 3 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 40 1th 1
  61. 61. 3 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 40 1th 1
  62. 62. 3 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 40 1th 1
  63. 63. 3 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 40 1th 1
  64. 64. 3 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 40 1th 1
  65. 65. 3 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 40 1th 1
  66. 66. Multiple Frontnodes 3 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 40 1th 1
  67. 67. Multiple Frontnodes 3Backend Sharding Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 40 1th 1
  68. 68. Infrastructure Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 41 1th 1
  69. 69. One Ubuntu package to rule them all. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 42 1th 1
  70. 70. Development VMsJenkins CI Server Selenium ServerMonitoring Server Testing Server Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 43 1th 1
  71. 71. http://www.flickr.com/photos/nirak/644337888/ Only on production: Frontend Nodes 11.04Backend Nodes 10.04 LTS Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 44 1th 1
  72. 72. http://www.flickr.com/photos/nirak/644337888/Mayflower DMZ amazon AWSEucalyptus Cloud Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 45 1th 1
  73. 73. http://www.flickr.com/photos/nirak/644337888/ Mayflower DMZ Developer Laptopamazon AWS with Ubuntu VM(Git repo + complete Eucalyptus Cloud software stack) Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 46 1th 1
  74. 74. http://www.flickr.com/photos/nirak/644337888/Mayflower DMZ Gitorious Server amazon AWS Jenkins CI Server Puppet MasterEucalyptus Cloud Selenium Server Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 47 1th 1
  75. 75. http://www.flickr.com/photos/nirak/644337888/ 2 Frontnodes 3 BackendnodesMayflower DMZ Development Monitor Staging Monitor amazon AWSEucalyptus Cloud Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 48 1th 1
  76. 76. http://www.flickr.com/photos/nirak/644337888/ Mayflower DMZ 2 Frontnodes amazon AWS2 Backendnodes Drupal Cloud Eucalyptus Live Monitor Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 49 1th 1
  77. 77. http://www.flickr.com/photos/nirak/644337888/ ConfigurationManagement done with Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 50 1th 1
  78. 78. http://www.flickr.com/photos/nirak/644337888/Configuration changes areon every VM in 5 Minutes. #WIN Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 51 1th 1
  79. 79. Application Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 52 1th 1
  80. 80. Do you remember? Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 53 1th 1
  81. 81. Frontend 1 Frontend 2 Varnish Varnish nginx nginx PHP 5.3 PHP 5.3Backendnode 1 Backendnode 2 Backendnode 3MySQL Master MySQL Slave RabbitMQ MogileFS MogileFS Apache Solr Memcached Memcached PHP 5.3 PHP 5.3 PHP 5.3 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 54 1th 1
  82. 82. Backendnode 1 Backendnode 2 Backendnode 3MySQL Master MySQL Slave RabbitMQ MogileFS MogileFS Apache Solr Memcached Memcached PHP 5.3 PHP 5.3 PHP 5.3 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 55 1th 1
  83. 83. Backendnode 3 RabbitMQBackendnode 1 Apache Solr Backendnode 2MySQL Master MogileFS PHP 5.3 MySQL Slave MogileFS Memcached Memcached PHP 5.3 PHP 5.3 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 55 1th 1
  84. 84. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 56 1th 1
  85. 85. Apache Solr XML REST API Profiles Profiles Profiles Autosuggest DE EN i18n Lucene Core Lucene Core Lucene Core Lucene Core Various transformations such aslowercasing, removing plurals, or stemming to increase relevancy. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 57 1th 1
  86. 86. Search string: „mapolis“ LL(1) parser„q=mapolis&sort=name desc&fl=name,id,country“ Search queries tokenized with a LL(1) Parser implemented in PHP. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 58 1th 1
  87. 87. Profile information autosuggestions user generated content ApacheMySQL Solr Indexing is done withasynchronous jobs with RabbitMQ. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 59 1th 1
  88. 88. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 60 1th 1
  89. 89. Why do we need amessage broker? Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 61 1th 1
  90. 90. Example:Editing your profile Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 62 1th 1
  91. 91. c c ynnsy as PHP Publish Routes Consumes PHP CLI Exchange QueueApplication Script Apache MySQL Solr Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 63 1th 1
  92. 92. Why RabbitMQ? Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 64 1th 1
  93. 93. Backendnode 1 Backendnode 2 Backendnode 3MySQL Master MySQL Slave RabbitMQ MogileFS MogileFS Apache Solr Memcached Memcached PHP 5.3 PHP 5.3 PHP 5.3 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 65 1th 1
  94. 94. Backendnode 1MySQL Master MogileFS Memcached Backendnode 3 Backendnode 2 MySQL Slave RabbitMQ PHP 5.3 MogileFS Memcached Apache Solr PHP 5.3 PHP 5.3 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 65 1th 1
  95. 95. MogileFSan open source distributed filesystem Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 66 1th 1
  96. 96. Application levelNo single point of failureAutomatic file replicationShared nothing architectureLocal filesystem agnostic Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 67 1th 1
  97. 97. Client (API: Perl) Trackers Trackers Storage Nodes Storage Nodes Trackers Storage Nodes (mogilefsd) (mogilefsd) (mogstored) (mogstored) (mogilefsd) (mogstored)Tracker‘s database (MySQL) Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 68 1th 1
  98. 98. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 69 1th 1
  99. 99. Application Host 1 Host 2R/W MySQL Replication MySQL Master Slave Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 70 1th 1
  100. 100. Application Keepalive Host 1 Host 2 WR/W R MySQL Replication MySQL Master Slave Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 70 1th 1
  101. 101. Some notes on ourdatabase architecture. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 71 1th 1
  102. 102. We use MySQL askey/value storage. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 72 1th 1
  103. 103. We implemented allrelations in the application. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 73 1th 1
  104. 104. We already prepared thedatabase design for sharding Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 74 1th 1
  105. 105. Benefits:Very simple, scalable and flexible architecture Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 75 1th 1
  106. 106. Drawbacks: More complexity in thePHP code. But that‘s okay. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 76 1th 1
  107. 107. Frontend 1 Frontend 2 Varnish Varnish nginx nginx PHP 5.3 PHP 5.3Backendnode 1 Backendnode 2 Backendnode 3MySQL Master MySQL Slave RabbitMQ MogileFS MogileFS Apache Solr Memcached Memcached PHP 5.3 PHP 5.3 PHP 5.3 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 77 1th 1
  108. 108. Frontend 1 Frontend 2 Varnish Varnish nginx nginx PHP 5.3 PHP 5.3 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 78 1th 1
  109. 109. Frontend 2 VarnishFrontend 1 nginx PHP 5.3 Varnish nginx PHP 5.3 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 78 1th 1
  110. 110. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 79 1th 1
  111. 111. Doctrine 2is a data-mapper,not ActiveRecord. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 80 1th 1
  112. 112. We use Doctrine 2 as ORM. And we think it‘s great. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 81 1th 1
  113. 113. /** ORM with Doctrine 2 * @Entity * @Table(name="role") * */class Mapolis_Entity_Role{ /** * @Id * @Column(name="id", type="integer") * @generatedValue(strategy="IDENTITY") */ protected $_roleId; /** * @Column(name="parent_id", type="integer") * @var int */ protected $_parentId; Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 82 1th 1
  114. 114. Working with objects/** * Saves the personal interests of user. * * @param Mapolis_Entity_Person $profile * * @return void */public function savePersonalInterests( Mapolis_Entity_Person $profile){ $this->getManager() ->getRepository(self::ENTITY_PERSON) ->update($profile);} Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 83 1th 1
  115. 115. Working with objects/** * Deletes a building. * * @param Mapolis_Entity_Building $building * * @return boolean */ public function deleteBuilding($building) { $this->getManager()->remove($building); return $this->getManager()->flush(); } ★ Transactional write-behind (batch writes) ★ Very fast for small UnitOfWorks Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 84 1th 1
  116. 116. Working with objects/** * Show recent invitations * * @return array of $count recent invitations */public function recent($inviter, $count = 5){ $invitations = $this->getManager() ->getRepository(self::ENTITY_INVITATION) ->findBy( array(_inviterId => $inviter), array(_modified => DESC), $count ); return $invitations;} Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 85 1th 1
  117. 117. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 86 1th 1
  118. 118. Why did we choose Zend Framework? Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 87 1th 1
  119. 119. 60 colleagues using ZendFramework in other projects. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 88 1th 1
  120. 120. We use Zend Frameworkmore like a component library. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 89 1th 1
  121. 121. We use Doctrine 2 instead of Zend_Db_Table. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 90 1th 1
  122. 122. We built our own Autoloader. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 91 1th 1
  123. 123. What did we use from Zend Framework? Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 92 1th 1
  124. 124. Zend_Application Zend_Controller Zend_View Zend_ValidateZend_Translation Zend_Locale Zend_Cache Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 93 1th 1
  125. 125. Frontnode 1 Varnish nginx PHP 5.3 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 94 1th 1
  126. 126. PHP 5.3 from Ubuntu 11.04 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 95 1th 1
  127. 127. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 96 1th 1
  128. 128. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 97 1th 1
  129. 129. HTTP Request Varnish HTTP accelerator mapolis mapolis Core Drupalnginx on port 81 nginx on port 81 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 98 1th 1
  130. 130. HTTP Request GET mapolis.com 80 Varnish HTTP accelerator mapolis mapolis Core Drupalnginx on port 81 nginx on port 81 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 98 1th 1
  131. 131. HTTP Request GET mapolis.com 80 Varnish HTTP accelerator mapolis mapolis Core Drupalnginx on port 81 nginx on port 81 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 98 1th 1
  132. 132. HTTP Request GET mapolis.com 80 Varnish HTTP accelerator mapolis mapolis Core Drupalnginx on port 81 nginx on port 81 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 98 1th 1
  133. 133. HTTP Request Varnish HTTP accelerator mapolis mapolis Core Drupalnginx on port 81 nginx on port 81 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 99 1th 1
  134. 134. HTTP Request GET mapolis.com/de/start 80 Varnish HTTP accelerator mapolis mapolis Core Drupalnginx on port 81 nginx on port 81 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 99 1th 1
  135. 135. HTTP Request GET mapolis.com/de/start 80 Varnish HTTP accelerator mapolis mapolis Core Drupalnginx on port 81 nginx on port 81 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 99 1th 1
  136. 136. HTTP Request GET mapolis.com/de/start 80 Varnish HTTP accelerator mapolis mapolis Core Drupalnginx on port 81 nginx on port 81 Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 99 1th 1
  137. 137. Frontend Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 100 1th 1
  138. 138. ⊕Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 101 1th 1
  139. 139. JavaScript Framework Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 102 1th 1
  140. 140. Supported browsers 7 3.6 14 5.0 8 7 (latest) 5.1 9 (latest) (latest)(10) (iOS) Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 103 1th 1
  141. 141. Development Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 104 1th 1
  142. 142. The Team: 1 Scrum Master 2 DevOps4 PHP/JS Developers1 Frontend Developer Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 105 1th 1
  143. 143. Development ToolsUsed IDE:Zend Studio, PhpStorm, vi and TextmateDatabase change management:LiquibaseCSS helper:SASS / Compass Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 106 1th 1
  144. 144. Development Laptop Ubuntu VM with Local Git repoComplete software stackant <everything> Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 107 1th 1
  145. 145. Some ant commands Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 108 1th 1
  146. 146. Some ant commands$ ant db-development Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 108 1th 1
  147. 147. Some ant commands$ ant db-development$ ant sync Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 108 1th 1
  148. 148. Some ant commands$ ant db-development$ ant sync$ ant phpunit Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 108 1th 1
  149. 149. Some ant commands$ ant db-development$ ant sync$ ant phpunit$ ant jslint Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 108 1th 1
  150. 150. Some ant commands$ ant db-development$ ant sync$ ant phpunit$ ant jslint$ ant deb Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 108 1th 1
  151. 151. Some ant commands$ ant db-development$ ant sync$ ant phpunit$ ant jslint$ ant deb$ ant build-vm Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 108 1th 1
  152. 152. Typical commit workflow Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 109 1th 1
  153. 153. Typical commit workflow$ vi Foo.php$ ant phpunit$ ant jslint$ git add Foo.php$ git commit -m ”Bar”$ git pull$ git push Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 109 1th 1
  154. 154. ant phpunit<target name="phpunit" depends="db-test" description="Run all tests"> <exec executable="phpunit" failonerror="true"> <arg line="--configuration ${basedir}/tests/phpunit-verbose.xml ${basedir}/tests/AllTests.php" /> </exec></target> Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 1 1th 1 10
  155. 155. One click deployment Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 1 1 1th 1 1
  156. 156. And how does it look now? Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 1 1th 1 12
  157. 157. Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 1 1th 1 13
  158. 158. Questions? Building a Cloud-based social network I Mayflower GmbH I 1 October 201 I 1 1th 1 14
  159. 159. Thank you very much!Please rate me @ http://joind.in/talk/view/3884Contact Thorsten Rinne thorsten.rinne@mayflower.de +49 89 242054-31 @ThorstenRinne Mayflower GmbH Mannhardtstr. 6 80538 München Germany © 201 Mayflower GmbH 1
  1. ¿Le ha llamado la atención una diapositiva en particular?

    Recortar diapositivas es una manera útil de recopilar información importante para consultarla más tarde.

×