Just Another Word Press Weblog But More Cloudy


Published on

Session at PHP Benelux conference 2010 on Wordpress and Windows Azure

Published in: Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Just Another Word Press Weblog But More Cloudy

  1. 1.
  2. 2. Just another WordPress weblog, but more cloudy<br />Maarten Balliauw – RealDolmenE-mail: maarten.balliauw@realdolmen.comBlog: http://blog.maartenballiauw.beTwitter: @maartenballiauw<br />
  3. 3. Who am I?<br />Maarten Balliauw<br />Antwerp, Belgium<br />www.realdolmen.com<br />Focus on web<br />ASP.NET, ASP.NET MVC, PHP, Azure, VSTS, …<br />MVP ASP.NET<br />Interested in interoperability<br />PHPExcel, PHPLinq, Windows Azure SDK for PHP, ...<br />http://blog.maartenballiauw.be<br />http://twitter.com/maartenballiauw<br />
  4. 4.
  5. 5. Agenda<br />Cloud computing?<br />Windows Azure?<br />Application architecture<br />Using PHP with Windows Azure<br />Wordpress<br />Resources<br />Q&A<br />
  6. 6. What’s in the cloud?<br />Cloud Computing<br />
  7. 7. What is Cloud Computing ?<br />What is cloud computing ?<br />Offering infrastructure, platform and software as a service over the internet to a global market.<br />Move on-premises management of non functional IT assets to a provider.<br />Difference from traditional hostings<br />Sold on demand “pay as you grow”<br />Elastic scalability<br />Service is fully managed by the provider<br />End user centric (IW or developer)<br />Strong focus on integration (cloud-cloud or cloud-on-premises)<br />
  8. 8. Definition of cloud (NIST)<br />On-demand self service<br />Standardized access<br />Location independant resource pooling<br />Rapid elasticity<br />Pay per use<br />
  9. 9. IT as a Service<br />Private<br />(On-Premise)<br />Infrastructure<br />(as a Service)<br />Platform<br />(as a Service)<br />You manage<br />Applications<br />Applications<br />Applications<br />You manage<br />Runtimes<br />Runtimes<br />Runtimes<br />Security & Integration<br />Security & Integration<br />Security & Integration<br />Managed by vendor<br />You manage<br />Databases<br />Databases<br />Databases<br />Servers<br />Servers<br />Servers<br />Managed by vendor<br />Virtualization<br />Virtualization<br />Virtualization<br />Server HW<br />Server HW<br />Server HW<br />Storage<br />Storage<br />Storage<br />Networking<br />Networking<br />Networking<br />
  10. 10. What’s in the cloud?<br />Windows Azure<br />
  11. 11. The Windows Azure Platform<br />Windows Azure<br />SQL Azure<br />Windows Azure platform AppFabric<br />Microsoft Codename “Dallas”<br />Developer tools<br />
  12. 12. Azure Service Platform<br />Windows Azure is an Operating System as a Service for the Cloud.<br /><ul><li>Compute– auto-provisioning 64-bit application containers in Windows Server VMs; supports a wide range of application models
  13. 13. Storage– highly available distributed table, blob, queue, & cache
  14. 14. Languages – .NET 3.5 (C#, VB.NET, etc.), IronRuby, IronPython, PHP, native Win32 code</li></ul>SQL Azure is a Relational Database for the Cloud. <br /><ul><li>RDBMS – Tables, Views, Indexes, Stored Procedures, Triggers, ...
  15. 15. Programmability – Managed ADO.NET data access, native ODBC, support for PHP
  16. 16. Tools – SQLCMD and the SQL Azure Database account portal</li></ul>AppFabric is the glue between on-premises and the cloud. <br /><ul><li>Service Bus – connectivity to on-premises applications; secure, federated fire-wall friendly Web services messaging intermediary; durable & discoverable queues
  17. 17. Identity Management – rules-driven federated identity; AD federation; claims-based authorization</li></ul>Live Services is a building block within the Azure Services Platform.<br /><ul><li>Live Mesh
  18. 18. Live ID
  19. 19. Live Contacts
  20. 20. Live …</li></ul>Live Services<br />
  21. 21. Windows Azure<br />Flexible application hosting<br />Lights-out service management<br />Provide code & service model, hit ENTER<br />Storage at massive scale<br />Compute<br />Storage<br />Management<br />There’s an SDK for this: http://phpazure.codeplex.com<br />
  22. 22. Windows Azure<br />
  23. 23. SQL Azure<br />Relational database as a service<br />Highly available, automatically maintained<br />Extension of the SQL Server Data Platform<br />Business Analytics<br />Reporting<br />Data Sync<br />Database<br />There’s a driver for this: http://sqlsrvphp.codeplex.com<br />
  24. 24. SQL Azure<br />Relational database, provided as a service<br />Highly symmetrical development and tooling experience (use TDS protocol and T-SQL)<br />Highly scaled out, on commodity hardware<br />Built on the SQL Server technology foundation<br />Beyond “hosted database”<br />High availability, DB provisioning, and DB management are provided by the service<br />Pay for what you use<br />
  25. 25. Windows Azure AppFabric<br />Secure connections between services<br />Across organizational boundaries<br />Claims-based access control<br />ServiceBus<br />AccessControl<br />There’s an SDK for this: http://dotnetservicesphp.codeplex.com/<br />
  26. 26. Windows Azure AppFabric - Service Bus<br />Securely connect applications<br />Over the internet<br />Across any network topology<br />Across organizational boundaries<br />Primary application patterns<br />Eventing: <br />Notify applications and/or devices<br />Service Remoting: <br />Securely project on-premises services out to the cloud<br />Tunneling: <br />App-to-app communication with NAT/Firewall traversal<br />
  27. 27. Service Bus Overview<br />
  28. 28. Microsoft Codename “Dallas”<br />Content brokerage and discovery platform <br />Available as a CTP at commercial launch<br />Microsoft Codename “Dallas”Information Services<br />
  29. 29.
  30. 30.
  31. 31. Developer tools<br />Development<br />Use your favourite editor<br />Local debugging<br />Windows with IIS 7.x<br />Visual Studio<br />Windows Azure tools for Eclipse<br />Packaging<br />Windows Azure SDK<br />Deployment<br />Any browser<br />I’m whining for this one!<br />
  32. 32. What’s in the cloud?<br />Application Architecture<br />
  33. 33. Typical Architecture on Azure<br />Service Unavailable<br />VIP<br />Worker Role<br />Web Role<br />Windows Azure Storage <br />(Blob, Table, Queue)<br />
  34. 34. Web + Worker Role Service Model<br />Worker Role<br />Service Still Available<br />Worker Role<br />Web Role<br />VIP<br />Worker Role<br />Web Role<br />Worker Role<br />Worker Role<br />Windows Azure Storage <br />(Blob, Table, Queue)<br />
  35. 35. What’s in the cloud?<br />Using PHP with Windows Azure<br />
  36. 36. Using PHP with Windows Azure<br />It’s all about…<br />Running PHP Code in Windows Azure<br />Eclipse Tooling<br />Build, Test, Deploy PHP Projects<br />Create New or Use Existing PHP Projects<br />Scaling PHP Apps<br />Using Cloud Storage from PHP<br />Using Windows Azure Storage<br />Using SQL Azure<br />
  37. 37. Running PHP in Windows Azure<br />How to Do It<br />Host in Web role (like .NET)<br />Supply PHP runtime<br />Point to runtime via FastCGIconfiguration in<br />Web.config<br />Web.roleConfig<br />Eclipse Tooling athttp://windowsazure4e.org does the above for you<br />PHP <br />Web Role<br />Instance 1<br />VIP<br />Load Balancer<br />PHP <br />Web Role<br />Instance 2<br />
  38. 38. PHP + Cloud Storage<br />Windows Azure Storage<br />On-Premise<br />VIP<br />PHP<br />Web Role<br />Load Balancer<br />PHP App<br />SQL Azure<br />Windows Azure Platform<br />
  39. 39. PHP with Windows Azure Storage<br />Windows Azure SDK for PHP at http://phpazure.codeplex.com<br />PHP programming model for Windows Azure Storage<br />Features <br />PHP classes for Blobs, Tables & Queues<br />Store PHP sessions in Table Storage<br />File system wrapper for Blob Storage<br />
  40. 40. PHP with SQL Azure<br />SQL Server Driver for PHP at http://sqlsrvphp.codeplex.com/<br />Supports PHP access to SQL Azure<br />Features<br />Choose between SQL Server and SQL Azure by changing connection string<br />Use from on-premise apps or in Windows Azure<br />
  41. 41. PHP with AppFabric<br />AppFabric SDK for PHP developers athttp://dotnetservicesphp.codeplex.com/<br />Supports PHP on service bus and access control<br />Features<br />Expose on-premise apps on an external endpoint without opening firewall<br />Pub/sub scenario’s<br />…<br />
  42. 42. What’s in the cloud?<br />Wordpress<br />Finally!<br />
  43. 43. Wordpress<br />Blogging engine<br />Widely used<br />Easy installation<br />Gazillion plugins<br />Huge community around it<br />Free and open-source<br />
  44. 44. But...<br />Runs on top of MySQL<br />Has no database abstraction layer<br />So: only runs on MySQL<br />Windows Azure has Table Storage and SQL Azure<br />I feellots of work coming…<br />
  45. 45.
  46. 46. There are ways around!<br />Easy way out<br />Wordpress on Windows Azure<br />MySQL on-premise / at other hoster<br />Medium way out<br />Wordpress on Windows Azure<br />MySQL as well<br />Hard way out<br />Wordpress on Windows Azure<br />MySQL out, SQL Azure in<br />
  47. 47. The easy way out<br />Windows Azure Storage<br />VIP<br />PHP<br />Web Role<br />Load Balancer<br />MySQL<br />Windows Azure Platform<br />On-Premise / hosted<br />
  48. 48. The easy way out<br />Fresh Windows Azure project in Eclipse<br />Fresh Wordpress.org download<br />Point wp-config.php to some MySQL server<br />Package & deploy<br />
  49. 49. The medium way out<br />Windows Azure Storage<br />VIP<br />PHP<br />Web Role<br />Load Balancer<br />WorkerRole<br />runningMySQL<br />Windows Azure Platform<br />On-Premise / hosted<br />
  50. 50. The medium way out<br />Fresh Windows Azure project in Eclipse<br />Fresh Wordpress.org download<br />“Windows Azure MySQL PHP Solution Accelerator”<br />http://code.msdn.microsoft.com/winazuremysqlphp<br />Some configuration<br />Some anger<br />Some configuration<br />Point wp-config.php to the above MySQL server<br />Package & deploy<br />
  51. 51. So...<br />Yes, you can run MySQL on Windows Azure!<br />More “solution accelerators”:<br />MySQL<br />http://code.msdn.microsoft.com/winazuremysqlphp<br />Memcached<br />http://code.msdn.microsoft.com/winazurememcached<br />MediaWiki<br />http://code.msdn.microsoft.com/winazuremediawiki<br />Tomcat<br />http://code.msdn.microsoft.com/winazuretomcat<br />
  52. 52. The hard way out<br />Windows Azure Storage<br />VIP<br />PHP<br />Web Role<br />Load Balancer<br />SQL Azure<br />Windows Azure Platform<br />On-Premise / hosted<br />
  53. 53. The hard way out<br />Fresh Windows Azure project in Eclipse<br />Fresh Wordpress.org download<br />Point wp-config.php to SQL Azure<br />Package & deploy<br />Fail!<br />There’s no SQL Server / SQL Azure support in Wordpress, remember?<br />
  54. 54. Have you ever looked at Wordpress?<br />MySQL queries all over the place!<br />“Data layer” (wp-db.php) = very thin<br />Raw MySQL queries passed from app to db<br />Logging<br />Some other stuff<br />That’s nowhere near a database abstraction...<br />
  55. 55. Strategic options<br />Required:<br />Re-build wp-db.php using SQL Server Driver for PHP<br />http://www.microsoft.com/sqlserver/2005/en/us/PHP-Driver.aspx<br />Options...<br />Re-write every single query in Wordpress<br />Future proof?<br />Insane!<br />Build a query translation tool, rewriting queries on-the-fly<br />Future proof!<br />Insane!<br />
  56. 56. Here’s what we did...<br />Hooks in Wordpress<br />Wp-contents/db.php<br />Wp-includes/wp-db.php<br />Strategy<br />Create wp-db.php class on top of SQL Server Driver for PHP<br />http://www.microsoft.com/sqlserver/2005/en/us/PHP-Driver.aspx<br />Create custom DB schema, compatible with SQL Server<br />Build a query translation tool, rewriting queries on-the-fly<br />Someone at Microsoft had this laying around<br />
  57. 57. But there’s also... resources<br />Resources<br />Images, other file uploads, ...<br />Normally stored on server disk<br />But this may not survive on Windows Azure...<br />Solution<br />Plugin using Windows Azure SDK for PHP<br />Storing everything on Blob Storage<br />Serving everything from Blob Storage<br />There’s a CDN available!<br />
  58. 58.
  59. 59. What’s in the cloud?<br />Demo time<br />If the Internet works...<br />
  60. 60. What’s in the cloud?<br />Resources<br />
  61. 61. Resources<br />Windows Azurehttp://www.azure.com<br />Windows Azure SDK for PHPhttp://phpazure.codeplex.com<br />SQL Server Driver for PHPhttp://sqlsrvphp.codeplex.com<br />AppFabric SDK for PHP developershttp://dotnetservicesphp.codeplex.com<br />PDChttp://microsoftpdc.com<br />PHP Architect December 2009 issuehttp://www.phparch.com<br />Steve Marxhttp://blog.smarx.com/<br />Clemens Vastershttp://vasters.com/clemensv/<br />Simon Guesthttp://simonguest.com/blogs/smguest<br />My bloghttp://blog.maartenballiauw.be/category/Azure.aspx<br />RealDolmen blogs is running on Azure!http://www.realdolmenblogs.com<br />
  62. 62. AZUG.BE – Azure User Group Belgium<br />Focus on the Azure Services Platform<br />Community-driven<br />Focus on architecture<br />And development<br />And the business value of Azure<br />www.azug.be<br />
  63. 63. And one more announcement...<br />Get a free t-shirt at the Microsoft booth!<br />
  64. 64. Before skipping to Q&A...<br />Is the source code available?<br />No, not at this time.<br />Do I need Visual Studio / Eclipse?<br />Only for local debugging.<br />Do I need Windows & the Windows Azure SDK?<br />Only for packaging.<br />I’ll keep whining to make this available on Linux.<br />
  65. 65. Questions, possibly Answers…<br />?<br />Maarten Balliauw – RealDolmenBlog: http://blog.maartenballiauw.beTwitter: @maartenballiauw<br />
  66. 66. THANK YOU!<br />Maarten Balliauwhttp://blog.maartenballiauw.be<br />