PHP, Cloud And Microsoft Symfony Live 2010

  • 3,302 views
Uploaded on

Cloud and evolution of the Microsoft platform

Cloud and evolution of the Microsoft platform

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
3,302
On Slideshare
0
From Embeds
0
Number of Embeds
4

Actions

Shares
Downloads
48
Comments
0
Likes
2

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. Cloud and evolutions of the Microsoft platform What’s new for Open Source, PHP and Cloud Computing in the Microsoft environment. Pierre Couzy - Microsoft Laurent Bonnet - Microsoft
  • 2. Agenda • The (relatively) new Microsoft/OSS story • A new PHP platform on Windows • Running PHP on Windows • PHP apps on Windows • Opening Windows products to PHP • Cloud story : PHP on Windows Azure • The Why • The How
  • 3. Introduction PHP on Windows : • Has been around for a decade • Actually, most PHP development is done on Windows • And yet, the Microsoft-PHP story has been difficult for years.
  • 4. Open Source at Microsoft ? Open Source Technology Center 3 goals : I. Get Involved with Open Source communities II. Ensure major projects run correctly on the Windows Operating Systems III. Open our products and platform to non- Microsoft stacks
  • 5. OSTC : in the early days … Founded in 2004 2 computers One guy…
  • 6. OSTC today • Hosted in Redmond • Staffed by OSS and Linux experts • 300 servers of varying types • 340+ Linux distros available for testing • Tests interoperability of OSS and Windows • Research of OSS technologies
  • 7. Results ?
  • 8. A SQL Server driver for PHP ? • Done in collaboration with the PHP community • Published on CodePlex with an OSI-approved license (http://sqlsrvphp.codeplex.com/). • Can access any Sql Server instance (Express, 2005, 2008, 2008 R2, Azure) from PHP • Work in progress : enable Sql Server access to major PHP projects & frameworks
  • 9. And also
  • 10. OSTC has changed Microsoft • We contributed to the linux kernel • GPL developers do exist in Redmond • On-going collaboration • With the Apache Software Foundation • With communities • There’s still room for improvement • A typical project is still 1 month dev, 3 months stabilization, 1 year legal…
  • 11. Agenda • The (relatively) new Microsoft/OSS story • A new PHP platform on Windows • Running PHP on Windows • PHP apps on Windows • Opening Windows products to PHP • Cloud story : PHP on Windows Azure • The Why • The How
  • 12. A PHP Windows platform ? • Application: PHP • DB: SQL Server, MySql, etc. • Web Server: Internet Information Services (IIS) • OS: Windows Server 2008 / 2008 R2
  • 13. From CGI to FastCGI One request, One PHP runtime lives PHP runtime CGI ISAPI FastCGI process in IIS or in a handled by a surrogate process process pool The good The good • Very stable The good • Very fast • Faster than CGI The bad The bad • More robust than ISAPI • *SLOW* on Windows (spawning a new • Stability • No more threading process) • Thread safety issues
  • 14. Démo
  • 15. Also available on Server Core • A “distro” that minimizes footprint and attack surface • PHP runs on Server Core since Windows Server 2008
  • 16. Creating a new Build Process Using better tools to do a better job Unix ‘configure’-style makefiles Created a clean, unified build • Makefiles are generated using Unix-style •Using tools built by the OSTC, we have constructed a configure scripts. Functionality is emulated with better build process which opens many new JScript possibilities, yet can easily adapt to new changes by developers using older technologies. No Optimizations One unified set of properties • Makefiles are generated with no ability to •Generated project files use a single set of build optimize entire builds, nor take advantage of configuration files, allowing 100% of the code to be better tools, compilers, etc. built to the same specifications. Independent Dependencies Optimizations everywhere • Libraries never compiled with the same •The new process lets us take advantage of high- settings. performance PGO technology to improve the performance of PHP by leaps and bounds. Undefined process Limitless opportunities • Very few people had all the right bits/tools to •With the new process, we can now do instrumented even compile the Windows PHP binaries— builds of the entire stack, allowing us to analyze and Certainly impossible to replicate an exact build. improve PHP for any environment.
  • 17. Using VC 9 What a difference the compiler makes VC 6 builds VC 9 builds • Visual C++ 6.0, being over a decade old, • Visual C++ 9.0 provides technologies that would not produce code optimized for allow us to target today’s operating modern operating systems and systems and hardware. hardware. New Compiler Older Compiler • By just changing the compiler, generates • PHP on Windows was being left behind, code that performs better, even before simply because it was nearly impossible using advanced PGO technologies. to build with any other compiler Now, 64 bit support No 64 bit support • We are now building 64bit snapshot • VC 6 offered no ability to build for 64 bit builds alongside the 32 bit builds, 95%+ Windows libraries are 64 bit too.
  • 18. Going native Using Windows APIs on Windows… Eliminated POSIX emulation Heavy use of POSIX emulation • Dropped the POSIX emulation libraries, and • PHP has been built with POSIX in mind, and code has been written to use Win32 APIs therefore, on Windows it was natural to adopt correctly. emulation libraries to accomplish similar tasks. Choosing the Win32 Way Using wrong methods • Implemented features in a way that doesn’t • Often, the way to do something on Unix, is not mimic the method on Unix, just the results. the way to do it on Windows. Use native libraries/APIs Non-standard Implementations • Replaced that code with calls to the natively • Many libraries were being used to supply provided APIs. functionality that was already present in Windows (Crypto, DNS, etc) Targets new OS, gracefully Targeted oldest OS possible • Recent code changes now allow us to target features on the latest versions of Windows, and • Windows 98 was considered a primary target… provides graceful failure on down-level ‘nuff said! platforms.
  • 19. Testing and QA Using Windows APIs on Windows… Unix was the primary platform Windows is a primary platform • If it worked on a Unix platform, it was done... Windows was never given any attention, nor •Windows is now a primary platform, and changes care by hardly anyone which break Windows must be addressed. 98%+ tests now pass on Windows. Tests did not have high pass rate. •Over 98% of tests now pass on Windows, and we’re • The standard PHP test suite did not pass with a aiming to close the gap completely. strong success rate. Windows is now represented Security was a Unix concern. •Windows developers are now on the security mailing • Security considerations for Windows were not lists, and can take action at the same time. taking place, no Windows developers were on the Security Mailing Lists New Testing Tools •The OSTC has created new tools for testing FastCGI No tools for doing automated testing. and PHP builds that can be included in the official build process, providing PGO and instrumentation • Nearly no tools to assist in automation of data to the developers. testing on Windows at all.
  • 20. Release Process Same Day Service…with a smile Windows is a primary platform Unix was the primary platform • Windows gets the same ability to push • Unix Platforms was the only concern. back on Release Dates, and builds are done on both platforms on the same day. Single point of failure. Easy to replicate. • Builds for Windows were constrained by a single person’s ability to make the build • It is now simple for anyone to rebuild the happen. exact same PHP stack on Windows as the release build. No attention to details. New work on the installer. • Hardly anyone worked on Windows releases, and the installer was poor. • New work is being done to improve the installer for the Windows platform.
  • 21. Where are we now ? • PHP is at last maintained on Windows. • And ready for production • http://windows.php.net • Performance tuning is on its way • We are getting on par with LAMP • Ongoing work on caching • We still lack many modules for 5.3 • That’s our top priority right now
  • 22. Web Plaform Installer http://www.microsoft.com/web • A tool to install and configure • IIS • Frameworks and runtimes (.NET / PHP) • Databases (SQL Server, MySQL) • Tools (Visual Web Developper 2008, Silverlight 3 Tools for VS) • And Web apps • Blogs (phpBB, WordPress, DasBlog, …) • Wikis, Galleries, etc. • CMS (DotNetNuke, Drupal, SilverStripe, ...)
  • 23. What’s next Windows Cache Extension 1.0 for PHP PHP Connectivity to Windows Azure Word and Excel reading and writing Windows Live services PDO Driver for Sql Server … Working in sync with you on the most popular applications
  • 24. Web Platform Installer
  • 25. Agenda • The (relatively) new Microsoft/OSS story • A new PHP platform on Windows • Running PHP on Windows • PHP apps on Windows • Opening Windows products to PHP • Cloud story : PHP on Windows Azure • The Why • The How
  • 26. Cloud terms & actors in a nutshell • Infrastructure as a Service : bring your OS • Platform as a service : bring your App • Infrastructure as a service : use our App
  • 27. How does your app handle load ? peak load Usage Idle time Jan Apr Jul Oct Cloud Cloud p1 p2 p3 Web Tier B/L Tier Web Tier B/L Tier Database Web Tier B/L Tier Database Web Tier B/L Tier
  • 28. How does your app share data ? I love I love you! you too! Server Data Company A
  • 29. Scenarios for Data In-browser Application (JSON & AtomPub Support in Azure) Public Cloud Server Data Server Server Company B Server Data Server Company A
  • 30. Your app, my accounts ? Federated Identity Your App Your App Provider Account DB Your Your Entreprise for a web University OpenID … directory app account account
  • 31. The Windows Azure cloud infrastructure
  • 32. We Start with Lots of Blinking Lights and Cables
  • 33. We Put them Into Racks
  • 34. Then, we add software • A hypervisor, on top of which a Host Virtual Machine, on top of which many Virtual Machines CPU: x64 OS : Windows 2008 Web Server : IIS 7 Apps : .Net, PHP, C++, etc.
  • 35. Then, we add redundancy logic Front-end Node Front-end Node Front-end Node REST/SOAP REST/SOAP REST/SOAP front-end ACE Logic ACE Logic ACE Logic Data Access Library Data Access Library Data Access Library Master Cluster Service Management Health Master Node Master Node Provisioning Deployment Monitoring Partition Manager Partition Manager Data Node Data Node Components Components Data Cluster Data Node Data Node Data Node Data Node Data Node SQL SQL SQL SQL SQL Server Mgmt. Server Mgmt. Server Mgmt. Server Mgmt. Server Mgmt. Services Services Services Services Services Fabric Fabric Fabric Fabric Fabric Fabric Fetch Partition SQL Replication Map Client
  • 36. Which leads to :
  • 37. Running code on Azure • We re-use the existing IIS infrastructure • FastCGI allows us to plug in almost every language • For example, you can package PHP, • .. Including your own extensions and configuration, • Point PHP files to PHP-CGI.exe, • .. And run them directly • Let’s see that in action.
  • 38. Running code on Azure
  • 39. Data on Azure • A basic storage infrastructure : Azure Storage • Blobs (think files) • Tables (think Flat File database) • Queues (messages) • Access is done using REST • A SQL-Server engine : SQL Azure • A subset of SQL Server 2008 • Including Views, Stored Procedures, etc. • Access is done using TDS
  • 40. Using Azure Storage • http://phpazure.codeplex.com/ • Overview • Enables PHP developers to take advantage of the Microsoft Cloud Services Platform – Windows Azure. • Provides consistent programming model for Windows Azure Storage (Blobs, Tables & Queues) • Features • PHP classes for Windows Azure Blobs, Tables & Queues (for CRUD operations) • Helper Classes for HTTP transport, AuthN/AuthZ, REST & Error Management • Manageability, Instrumentation & Logging support • Support for storing PHP sessions in Azure Table Storage • Licence : BSD
  • 41. Using Sql Azure • http://www.codeplex.com/SQLSRVPHP • Licence : Microsoft Public License (Ms-PL) • Gives access to SQL Server databases, • But also SQL Azure
  • 42. Consuming Sql Azure ... in PHP … with Eclipse
  • 43. We do our best to be technology-agnostic Azure Services Platform ™
  • 44. Thank you, and stay tuned for more (Symfony on Azure ?)
  • 45. Links • www.azure .com : main entry point • http://sqlazuremw.codeplex.com/ • Migration Wizard (Sql Server -> Sql Azure) • http://www.codeplex.com/SQLSRVPHP • Accessing data using TDS (Sql Server, Sql Azure) • http://phpazure.codeplex.com/ • Accessing Azure Storage in PHP • http://windows.php.net • Latest PHP binaries & Source • http://www.microsoft.com/downloads/details.aspx?FamilyID=413E 88F8-5966-4A83-B309-53B7B77EDF78&displaylang=en • Standard Azure Training Kit, contains samples to run PHP on Azure • http://phpdataservices.codeplex.com/ • Accessing REST data using PHP