Your SlideShare is downloading. ×
0
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Building A Platform From Open Source At Yahoo
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Building A Platform From Open Source At Yahoo

8,643

Published on

Building a platform from symfony at Yahoo! …

Building a platform from symfony at Yahoo!

Presented at symfonyLive 2010 in Paris, France by Dustin Whittle.

Join us for a case study on using open source tools to build a platform for enterprise web applications with symfony. The focus of this session will be on how Yahoo! has built web applications that scale with symfony. Find out what worked and what didn't when building scalable web applications with the symfony framework.

* Why symfony?
* symfony vs ysymfony
* Social Search: Delicious and Answers
* YOS: Developer Tool & Application Platform
* Internal Tools: Customer Care + Dashboards
* The Platform + Components
* Yahoo! symfony Plugins
* Developer Tools - YUI3, YQL, Design Patterns, etc

Published in: Technology, Education
1 Comment
27 Likes
Statistics
Notes
  • wow nice one.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
8,643
On Slideshare
0
From Embeds
0
Number of Embeds
12
Actions
Shares
0
Downloads
312
Comments
1
Likes
27
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Building a platform from open source<br />Dustin Whittle<br />
  • 2.
  • 3. Overview<br />Why symfony?<br />symfony vs. ysymfony<br />What does scaling really mean?<br />Social Search: Delicious and Answers<br />International: ShopGenie.co.uk, FoxyTunes, Wretch.cc<br />Yahoo! Open Strategy<br />What is the Yahoo! Open Stack?<br />Developer Tools<br />YUI, Design Patterns, Tutorials<br />Data & Social APIs<br />YQL: Yahoo! Query Language<br />Profiles, Connections, Updates, …<br />Geo, Flickr, Delicious, Upcoming<br />YOS SDK for PHP<br />
  • 4. Who am I?<br />Working with symfony since open source<br />symfony Core Team Member<br />Responsible for the development and support of ysymfony at Yahoo!<br />Worked with Y! Answers, Delicious, Y! Widgets, Y! Bookmarks, Yahoo! Application Platform<br />Developer advocacy for Yahoo! Developer Network<br />Consultant<br />Commercial symfony support + training (USA)<br />
  • 5. EXAMPLES | TUTORIALS | CODE SAMPLES<br />developer.yahoo.com<br />
  • 6. Freebsd | linux | apache | php | mysql | BUGZILLA | hadoop | symfony<br />Yahoo! Is powered by open source technologies<br />
  • 7. W3C | MICROFORMATS | OAUTH | OPENID | OPENSOCIAL<br />YAHOO! embraces open standards<br />
  • 8. YUI | BROWSER PLUS | DESIGN PATTERNS | R3 | YSLOW + PERFORMANCE RULES<br />YAHOO! gives back to open source<br />
  • 9. YQL | PIPES | BOSS | CONTACTS | UPDATES | MAIL | DELICIOUS | FLICKR | UPCOMING | HOTJOBS | MAPS | FIREEAGLE | GEOLOCATION | LOCAL | TRAFFIC | WEATHER | MUSIC | ANSWERS | SHOPPING | FINANCE | TRAVEL<br />YAHOO! SHARES ITS DATA THROUGH OPEN APIs AND WEB SERVICES<br />
  • 10. Conferences | Hack Days | HackU | Tech Talks | YDN Theater<br />YAHOO! ENGAGES COMMUNITIES WITH OPEN HACK EVENTS around the world<br />
  • 11.
  • 12. Users<br />LoadBalancers<br />Frontend<br />Backend<br />Linux<br />ysymfony/ YUI<br />Apache<br />Custom Modules<br />PHPAPC, PEAR, PECL, Custom Extensions<br />UserAPI<br />MySQL/Memcache<br />Web Services<br />Ad API<br />
  • 13. Why a frontend platform?<br />Rasmus says “frameworks are not well suited for Yahoo!”<br />Build applications to requirements<br />Do exactly what you need: no more, no less<br />Understand that frameworks add a lot of overhead<br />Choosing functional components is a better fit<br />Despite choosing open source or building your own<br />Everyone uses a framework<br />If you use open source, use only the pieces you need<br />
  • 14. Y! needs from a frontend platform<br />Fit existing environment (RHEL/PHP5/Apache)<br />Development Cycle – How easy to develop, test, and deploy?<br />Clean separation between data, logic, and display (MVC) <br />Independent model layer to fit service oriented architecture<br />Extensible and pluggable<br />Internationalization and localization support<br />Detailed documentation and active community of support<br />Open source and ability to contribute back<br />
  • 15. Why a framework at all?<br />Another software layer (ysymfony, yphp, yapache)<br />Factors out common patterns<br />Code Layout<br />Configuration<br />URL Routing<br />Authentication / Security<br />Form Validation / Repopulation<br />Internationalization / Localization<br />Encourages good design<br />Abstraction &gt; Consistency &gt; Maintainability<br />
  • 16. The choice to adopt symfony?<br />Philosophy<br />Full-stack framework for building complex web applications<br />Adopt best ideas from anywhere, using existing code if available (Mojavi, Prado, Rails, Django)<br /> Design<br />Clean separation between Model, View, and Controller<br />Controller using modules and actions<br />Views using templates in straight PHP with helpers<br />Easy to reuse view modules to compose a page<br />Layouts, Components, Partials, Slots<br />
  • 17. The choice to use symfony<br />Configurability / Flexibility<br />Features we do not want are easily disabled<br />Use of factories for easy customization<br />Documentation / Support Community<br />The Definitive Guide to symfony<br />Askeet, Jobeet, Cookbooks, Advents<br />Active community with wiki, mailing lists, forums, irc channel<br />
  • 18. Why ysymfony for Yahoo! teams?<br />Eliminate common patterns by adding a layer on PHP<br />Code layout/structure (MVC)<br />Configuration<br />Internationalization<br />ysymfony is just a toolkit<br />Learn one set of tools<br />Shift between multiple projects<br />Consistency<br />Long term maintainability through platform<br />
  • 19.
  • 20. How Yahoo! uses symfony<br />Full Stack<br />Yahoo! Bookmarks<br />Yahoo! Answers<br />Delicious<br />Yahoo! Widgets<br />Yahoo! Application Platform<br />ShopGenie.co.uk, Foxytunes, Wretch.cc<br />Internal Dashboards + Reporting Tools<br />Components<br />Dependency Injection<br />Forms<br />Caching (APC/Memcache)<br />Routing<br />
  • 21. symfony MVC framework<br />
  • 22.
  • 23.
  • 24. A look at Yahoo! Answers<br />http://answers.yahoo.com<br />Yahoo! Answers is the largest collection of human knowledge on the Web with more than 135 million users and 515 million answers worldwide (Yahoo! Internal Data, March 2008).<br />Yahoo! Answers is the 2nd ranked education & reference site on the web (comScore)<br />Available in 26 markets and 12 languages<br />
  • 25. Yahoo! Answers at the beginning<br />Started as a small development team on PHP4 from a fork of Yahoo! Taiwan Knowledge+<br />Launched December 2005 by December 2006 there were 60 million users and 65 million answers<br />The code base eventually became difficult to maintain and iterate new features<br />Large distributed development teams (US / UK)<br />
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32. The big picture<br />A complete platform for building web applications from frameworks<br />PHP Framework<br />JavaScript Framework<br />CSS Framework<br />UI Design Patterns + Best Practices<br />Development Tools (logger, profiler, debugger, docs)<br />Unit + Functional Testing Frameworks (LIME / YUI Test)<br />Deployment Tools (rsync deployment system)<br />
  • 33. What does Yahoo! change?<br />Minor changes to fit our environment<br />Most changes are easily implemented via factories/plugins<br /> Dropped the ORM and pushed down the stack (SOA)<br />Added a parallel API Dispatcher (ysfAPIClientPlugin)<br />Added dimensions to configurations (ysfDimensionsPlugin)<br />Integrated R3 translation/template management (ysfR3Plugin)<br />R3 - http://developer.yahoo.com/r3/ <br />Created a build and deployment solution (ysfBuildPlugin)<br />Uses internal tools for packaging/deployment<br />Integrate support for Y! User Interface libraries (ysfYUIPlugin)<br />
  • 34. Propel or Doctrine or ???<br />No ORM for large projects<br />Doctrine for medium sized projects<br />Service Oriented Architecture<br />Platforms/Backendsas services (reusable to all)<br />Thin Controller/Fat Model (where model == services)<br />Use PHP as the frontend glue<br />No heavy lifting in PHP = Push down the stack<br />Java/C++/Erlang + JSON/XML<br />
  • 35. Localizing with dimensions<br />Cascading Configuration based on YAML<br />Framework -&gt; Project -&gt; Application -&gt; Module<br />Extending the cascade to be based on dimensions<br />Dimensions can be anything (and can be chained together)<br />Data Center + Environment for customizing configurations<br />Culture for localizing user interface + data<br />Theme for customizing look and feel<br />User info (is user on corporate intranet?)<br />Caching<br />
  • 36. symfony I18n + L10n<br />Translation + Template Management<br />Integrated with symfony i18n + view layers<br />&lt;r3:trans&gt;hello&lt;/r3:trans&gt; vs __(‘hello’)<br />Dictionary Management (YALA)<br />SQLite/XLIFF Backend<br />Added additional tasks<br />Importing/Exporting XLIFF dictionary<br />Generating sample translations for projects<br />Find missing strings<br />
  • 37. A build and deployment system<br />Aggregate and minify stylesheets and javascripts<br />Rewrite templates, css, js for CDN (Akamai, S3, …)<br />Generate translations for configurations + templates<br />Generate configuration cache<br />Aggregate core classes + remove debug statements<br />Run lint, unit, functional tests<br />Package applications as .tgz<br />Deployment via packages<br />Integrated with Yahoo! internal tools<br />
  • 38. Hello World Performance<br />Hello world benchmarks are generally not a useful measurement<br />You don’t use a framework to write hello world<br />die(‘hello world’);<br />Performance is relative to the features you use<br />ORM<br />I18N<br />Output Escaping<br />Forms/Validation<br />Ability to scale != performance<br />
  • 39. What does it mean to scale?<br />A system whose performance improves after adding hardware, proportionally to the capacity added, is said to be a scalable system.<br />High Availability + Scalability + Performance<br />Bigger dataset, more traffic, maintainable<br />Not about performance<br />PHP is slow, but it is very rarely your bottleneck<br />Languages do not scale, architectures do<br />Planning to grow and planning to fail<br />Capacity Planning<br />Business Continuity Planning<br />
  • 40. Scaling – Planning<br />Planning hardware purchases and hosting options to have as much as you need without breaking your wallet<br />Partitioning and distributing databases to support large datasets and simultaneous transactions<br />Offline transactions and queuing<br />Monitoring your applications to find and clear bottlenecks<br />Providing service APIs and using services from other providers to increase your site&apos;s reach and capabilities<br />Think Minimal, Plan to grow, Plan to fail<br />
  • 41. Scaling – The basics in PHP<br />PHP is rarely the bottleneck (even though it can be slow)<br />“Most performance comes not from the language, but from application design” – Rasmus<br />Share Nothing Architecture<br />Independent, self-sufficient, no single point of contention<br />No local storage = No PHP Sessions<br />Use a database (works for distributed)<br />Use a small signed cookie (ideal)<br />Important data in database<br />Individual expiration on session objects<br />Small data items<br />Use a distributed cache<br />Memcache<br />Forget about small efficiencies<br />Premature optimization is the root of all evil.<br />“ vs. ‘, echo vs. print<br />
  • 42. Scaling Databases – The basics<br />Drop the ORM<br />It’s a choice of convenience over performance<br />Master/Slave Replication<br />First steps<br />Helps with reads, writes are still bottleneck<br />Partitioning<br />Segmenting data<br />Sharding (horizontal partitioning)<br />Segmenting data onto different physical machines<br />Make problems smaller, easier to grow<br />
  • 43. Improving latency with Caching<br />Always use PHP opcode cache (APC, Xcache, etc)<br />Use for routing and i18n cache<br />Memcache (distributed cache)<br />Use for view cache<br />Distributed invalidation can be a pain<br />sfViewCacheManager makes this easy!<br />Be intelligent about cache_keys (uri, user, state)<br />There is a fine line to caching<br />At what point do you spend more time managing the cache, than reading from it?<br />
  • 44. Tweaking Performance<br />Do not use .htaccess (move to real apache config)<br />Set a minimal include path<br />Increase realpath_cache_size + realpath_cache_ttl<br />Use apc.stat=0<br />Don’t use features you do not need<br />Disable in settings.yml/ factories.yml<br />Use core_compile to aggregate classes to reduce file i/o<br />Remove debug statements + optimize file lookups<br />sfOptimizerPlugin / project:optimize<br />Use @routeName and use caching for factories<br />
  • 45. Symfony (v2)<br />Symfony 2 is a set of cohesive yet decoupled components<br />This makes it much easier to use single component to solve a single problem<br />Which makes it easier to build micro frameworks that solve very specific problems<br />Yahoo! Teams generally prefer solutions that are specific to their exact problem<br />Selling the full stack can be difficult when a team only wants a few components<br />Symfony 2 is the right direction, even if it breaks backwards compatability<br />
  • 46. Do it yourself for cheap<br />Open source software = Free<br />Apache<br />PHP<br />MySQL<br />Memcache / Perlbal / MogileFS / Squid / Gearman<br />symfony / Doctrine / Propel / Swift<br />Nagios / Cacti<br />Amazon Shared Infrastructure = Cheap<br />EC2 Cloud<br />S3 Storage + Cloudfront<br />SimpleDB<br />
  • 47. Y! OS – The Open Stack<br />
  • 48. What Yahoo! offer developers<br /><ul><li>Yahoo! Developer Network
  • 49. Developer Tools (YUI, etc)
  • 50. Social APIs
  • 51. Profiles
  • 52. Connections
  • 53. Updates
  • 54. Data APIs
  • 55. Flickr, Delicious, Search, etc
  • 56. Yahoo! Query Language
  • 57. Yahoo! Application Platform
  • 58. OpenSocial</li></li></ul><li>
  • 59. developer.yahoo.com<br />
  • 60. What is Yahoo! Developer Network?<br />The Yahoo! Developer Network offers open source tools and open data APIs to make it easy for developers to build applications and mashups.<br />50+ APIs / Web Services<br />Developer Dashboard to create/manage Oauth applications<br />Tutorials + Code Samples on using our apis<br />Complete API Documentation<br />Yahoo! User Interface libraries<br />ASTRA Flash Components<br />Design Patterns Library<br />Evangelism: Conferences / Theater / Blogs / Events<br />
  • 61.
  • 62. JavaScript Framework<br />Utilities - YAHOO, Dom, Event, Animation, Browser History Manager, Connection Manager, Cookie, DataSource, Drag and Drop, Element, Get, ImageLoader, JSON, Resize, Selector, Loader<br />Controls / Widgets - AutoComplete, Button, Calendar, Charts, Color Picker, DataTable, ImageCropper, Rich Text Editor, Slider, Uploader<br />Container (Module, Overlay, Panel, Tooltip, Dialog), Layout Manager, Menu, TabView, TreeView<br />Debug – Logger, Profiler, Test<br />Y! Developer Network – YUI Javascript<br />
  • 63. CSS Foundation<br />Reset - Neutralizes browser CSS styles<br />Base - Applies consistent style foundation<br />Fonts - Foundation for typography and font-sizing<br />Grids - Thousands of wireframe layouts<br />User Interface Design Patterns Library<br />Proven solutions to common interfaces<br />http://developer.yahoo.com/ypatterns/<br />Grade Browser Support / Progressive Enhancement<br />Y! Developer Network – YUI CSS<br />
  • 64. More than 275 functional examples<br />http://developer.yahoo.com/yui/examples/<br />YSlow + Performance Rules<br />http://developer.yahoo.com/performance<br />YUI Blog<br />http://yuiblog.com/<br />Mailing List @ Yahoo! Groups<br />http://tech.groups.yahoo.com/group/ydn-javascript/<br />Y! Developer Network – Documentation<br />
  • 65. A Query Language for the Web<br />SELECT * FROM INTERNET<br />
  • 66. Thousands of web services that provide valuable data<br />Require developers to read documentation and form URLs/queries.<br />Data is isolated and can not be combined<br />Needs combining, tweaking, shaping even after it gets to the developer.<br />Before YQL<br />
  • 67. SQL-Like Language<br />Synonymous with Data access<br />Familiar to developers<br />Expressive enough to get the right data<br />Self Describing - show, desc table<br />Allows you to query, filter and join data across Web Services.<br />Y! Open Stack – YQL<br />
  • 68.
  • 69. YQL – Open Tables<br />Twitter<br />Google<br />Facebook<br />Friendfeed<br />Wesabe<br />Whitepages<br />Zillow<br />Search<br />Weather<br />Flickr<br />Upcoming<br />Delicious<br />Dopplr<br />Github<br />New York Times<br />Shopping<br />…any web service can be as easy as SQL<br />Available on github - http://github.com/spullara/yql-tables/<br />
  • 70. YQL – Open Tables<br />
  • 71. YQL – Open Tables<br />
  • 72. YQL – Open Tables<br />
  • 73. select * from social.connections<br />select * from delicious.feeds.popular<br />select * from flickr.photos.interestingness<br />select * from friendfeed.status<br />select * from github.checkins<br />YQL - Examples<br />
  • 74. OAuth Endpoint<br />http://query.yahooapis.com/v1/yql?q=...<br />Public Endpoint <br />http://query.yahooapis.com/v1/public/yql?q=<br />YQL Console <br />http://developer.yahoo.com/yql/console<br />YQL – API End Points<br />
  • 75. Books worth reading<br />
  • 76. (I will be around for the whole event, so please say hello and ask questions)<br />Questions?<br />
  • 77. enjoy the rest ofsymfonylive 2010<br />EXAMPLES | TUTORIALS | CODE SAMPLES<br />developer.yahoo.com<br />
  • 78. Want to join Yahoo?We are hiring!<br />

×