58
6/26/22 | SLIDE 1

Just Another Word Press Weblog But More Cloudy

Embed Size (px)

DESCRIPTION

Session at PHP Benelux conference 2010 on Wordpress and Windows Azure

Citation preview

Page 1: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 1

Page 2: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 2

www.realdolmen.com

Just another WordPress weblog, but more cloudy

Maarten Balliauw – RealDolmenE-mail: [email protected]

Blog: http://blog.maartenballiauw.be Twitter: @maartenballiauw

Page 3: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 3

WHO AM I?

Maarten Balliauw Antwerp, Belgium www.realdolmen.com Focus on web

ASP.NET, ASP.NET MVC, PHP, Azure, VSTS, … MVP ASP.NET

Interested in interoperability PHPExcel, PHPLinq, Windows Azure SDK for PHP, ...

http://blog.maartenballiauw.be http://twitter.com/maartenballiauw

Page 4: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 4

Page 5: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 5

AGENDA

Cloud computing? Windows Azure? Application architecture Using PHP with Windows Azure Wordpress Resources Q&A

Page 6: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 6

What’s in the cloud?CLOUD COMPUTING

Page 7: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 7

WHAT IS CLOUD COMPUTING ?

What is cloud computing ? Offering infrastructure, platform and software as a service

over the internet to a global market. Move on-premises management of non functional IT

assets to a provider. Difference from traditional hostings

Sold on demand “pay as you grow” Elastic scalability Service is fully managed by the provider End user centric (IW or developer) Strong focus on integration (cloud-cloud or cloud-on-

premises)

Page 8: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 8

DEFINITION OF CLOUD (NIST)

On-demand self service Standardized access Location independant resource pooling Rapid elasticity Pay per use

Page 9: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 9

IT AS A SERVICE

Private(On-Premise)

Infrastructure

(as a Service)

Platform(as a

Service)

Storage

Server HW

Networking

Servers

Databases

Virtualization

Runtimes

Applications

Security & Integration

Storage

Server HW

Networking

Servers

Databases

Virtualization

Runtimes

Applications

Security & Integration

Storage

Server HW

Networking

Servers

Databases

Virtualization

Runtimes

Applications

Security & Integration

You

man

age

Managed by vendor

Managed by vendor

You

man

age

You

man

age

Page 10: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 10

What’s in the cloud?WINDOWS AZURE

Page 11: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 11

THE WINDOWS AZURE PLATFORM

Windows Azure SQL Azure Windows Azure platform AppFabric Microsoft Codename “Dallas”

Developer tools

Page 12: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 12

AZURE SERVICE PLATFORM

Windows Azure is an Operating System as a Service for the Cloud.

Compute – auto-provisioning 64-bit application containers in Windows Server VMs; supports a wide range of application models

Storage – highly available distributed table, blob, queue, & cache

Languages – .NET 3.5 (C#, VB.NET, etc.), IronRuby, IronPython, PHP, native Win32 code

SQL Azure is a Relational Database for the Cloud.

RDBMS – Tables, Views, Indexes, Stored Procedures, Triggers, ...

Programmability – Managed ADO.NET data access, native ODBC, support for PHP

Tools – SQLCMD and the SQL Azure Database account portal

AppFabric is the glue between on-premises and the cloud.

Service Bus – connectivity to on-premises applications; secure, federated fire-wall friendly Web services messaging intermediary; durable & discoverable queues

Identity Management – rules-driven federated identity; AD federation; claims-based authorization

Live Services is a building block within the Azure Services Platform.

Live Mesh

Live ID

Live Contacts

Live …

Live Services

Page 13: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 13

WINDOWS AZURE

Flexible application hosting Lights-out service management

Provide code & service model, hit ENTER

Storage at massive scale

Compute StorageManagement

There’s an SDK for this: http://phpazure.codeplex.com

Page 14: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 14

WINDOWS AZURE

Page 15: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 15

SQL AZURE

Relational database as a service Highly available, automatically maintained

Extension of the SQL Server Data Platform

Database

Business AnalyticsReporting Data Sync

There’s a driver for this: http://sqlsrvphp.codeplex.com

Page 16: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 16

SQL AZURE

Relational database, provided as a service Highly symmetrical development and tooling experience (use

TDS protocol and T-SQL) Highly scaled out, on commodity hardware Built on the SQL Server technology foundation

Beyond “hosted database” High availability, DB provisioning, and DB management are

provided by the service Pay for what you use

Page 17: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 17

WINDOWS AZURE APPFABRIC

Secure connections between services Across organizational boundaries

Claims-based access control

ServiceBus

AccessControl

There’s an SDK for this: http://dotnetservicesphp.codeplex.com/

Page 18: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 18

WINDOWS AZURE APPFABRIC - SERVICE BUS

Securely connect applications Over the internet Across any network topology Across organizational boundaries

Primary application patterns Eventing:

Notify applications and/or devices Service Remoting:

Securely project on-premises services out to the cloud Tunneling:

App-to-app communication with NAT/Firewall traversal

Page 19: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 19

SERVICE BUS OVERVIEW

Page 20: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 20

MICROSOFT CODENAME “DALLAS”

Content brokerage and discovery platform Available as a CTP at commercial launch

Microsoft Codename “Dallas”

Information Services

Page 21: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 21

Page 22: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 22

Page 23: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 23

DEVELOPER TOOLS

Development Use your favourite editor

Local debugging Windows with IIS 7.x Visual Studio Windows Azure tools for Eclipse

Packaging Windows Azure SDK

Deployment Any browser

I’m whining for this one!

Page 24: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 24

What’s in the cloud?APPLICATION ARCHITECTURE

Page 25: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 25

TYPICAL ARCHITECTURE ON AZURE

Windows Azure Storage (Blob, Table, Queue)

VIP Web

RoleWorker

Role

Service Unavailable

Page 26: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 26

WEB + WORKER ROLE SERVICE MODEL

Windows Azure Storage (Blob, Table, Queue)

Worker RoleWeb

Role

VIP

Web Role

Worker Role

Worker Role

Worker Role

Worker RoleService Still Available

Page 27: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 27

What’s in the cloud?USING PHP WITH WINDOWS AZURE

Page 28: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 28

USING PHP WITH WINDOWS AZURE

It’s all about…

Running PHP Code in Windows Azure

Eclipse Tooling Build, Test, Deploy PHP Projects Create New or Use Existing PHP Projects

Scaling PHP Apps

Using Cloud Storage from PHP Using Windows Azure Storage Using SQL Azure

Page 29: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 29

RUNNING PHP IN WINDOWS AZURE

How to Do It Host in Web role (like .NET) Supply PHP runtime Point to runtime via FastCGI

configuration in Web.config Web.roleConfig

Eclipse Tooling athttp://windowsazure4e.org does the above for you

PHP Web RoleInstance 2

VIP

Load

Bala

nce

r

PHP Web RoleInstance 1

Page 30: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 30

PHP + CLOUD STORAGE

PHPWeb Role

VIP

Load

Bala

nce

r

Windows Azure Storage

SQL Azure

PHP App

Windows Azure Platform

On-Premis

e

Page 31: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 31

PHP WITH WINDOWS AZURE STORAGE

Windows Azure SDK for PHP at http://phpazure.codeplex.com

PHP programming model for Windows Azure Storage

Features PHP classes for Blobs, Tables & Queues Store PHP sessions in Table Storage File system wrapper for Blob Storage

Page 32: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 32

PHP WITH SQL AZURE

SQL Server Driver for PHP at http://sqlsrvphp.codeplex.com/

Supports PHP access to SQL Azure

Features Choose between SQL Server and SQL Azure by changing

connection string Use from on-premise apps or in Windows Azure

Page 33: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 33

PHP WITH APPFABRIC

AppFabric SDK for PHP developers athttp://dotnetservicesphp.codeplex.com/

Supports PHP on service bus and access control

Features Expose on-premise apps on an external endpoint without

opening firewall Pub/sub scenario’s …

Page 34: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 34

What’s in the cloud?WORDPRESSFinally!

Page 35: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 35

WORDPRESS

Blogging engine Widely used Easy installation Gazillion plugins Huge community around it Free and open-source

Page 36: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 36

BUT...

Runs on top of MySQL Has no database abstraction layer So: only runs on MySQL Windows Azure has Table Storage and SQL Azure

I feel lots of work coming…

Page 37: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 37

Page 38: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 38

THERE ARE WAYS AROUND!

Easy way out Wordpress on Windows Azure MySQL on-premise / at other hoster

Medium way out Wordpress on Windows Azure MySQL as well

Hard way out Wordpress on Windows Azure MySQL out, SQL Azure in

Page 39: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 39

THE EASY WAY OUT

PHPWeb Role

VIP

Load

Bala

nce

r

Windows Azure Storage

MySQL

Windows Azure PlatformOn-Premise / hosted

Page 40: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 40

THE EASY WAY OUT

Fresh Windows Azure project in Eclipse Fresh Wordpress.org download Point wp-config.php to some MySQL server Package & deploy

Page 41: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 41

THE MEDIUM WAY OUT

PHPWeb Role

VIP

Load

Bala

nce

r

Windows Azure Storage

Windows Azure PlatformOn-Premise / hosted

WorkerRolerunningMySQL

Page 42: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 42

THE MEDIUM WAY OUT

Fresh Windows Azure project in Eclipse Fresh Wordpress.org download “Windows Azure MySQL PHP Solution Accelerator”

http://code.msdn.microsoft.com/winazuremysqlphp

Some configuration Some anger Some configuration Point wp-config.php to the above MySQL server Package & deploy

Page 43: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 43

SO...

Yes, you can run MySQL on Windows Azure!

More “solution accelerators”: MySQL

http://code.msdn.microsoft.com/winazuremysqlphp Memcached

http://code.msdn.microsoft.com/winazurememcached MediaWiki

http://code.msdn.microsoft.com/winazuremediawiki Tomcat

http://code.msdn.microsoft.com/winazuretomcat

Page 44: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 44

THE HARD WAY OUT

PHPWeb Role

VIP

Load

Bala

nce

r

Windows Azure Storage

SQL Azure

Windows Azure PlatformOn-Premise / hosted

Page 45: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 45

THE HARD WAY OUT

Fresh Windows Azure project in Eclipse Fresh Wordpress.org download Point wp-config.php to SQL Azure Package & deploy Fail!

There’s no SQL Server / SQL Azure support in Wordpress, remember?

Page 46: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 46

HAVE YOU EVER LOOKED AT WORDPRESS?

MySQL queries all over the place! “Data layer” (wp-db.php) = very thin

Raw MySQL queries passed from app to db Logging Some other stuff

That’s nowhere near a database abstraction...

Page 47: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 47

STRATEGIC OPTIONS

Required: Re-build wp-db.php using SQL Server Driver for PHP

http://www.microsoft.com/sqlserver/2005/en/us/PHP-Driver.aspx

Options... Re-write every single query in Wordpress

Future proof? Insane!

Build a query translation tool, rewriting queries on-the-fly Future proof! Insane!

Page 48: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 48

HERE’S WHAT WE DID...

Hooks in Wordpress Wp-contents/db.php Wp-includes/wp-db.php

Strategy Create wp-db.php class on top of SQL Server Driver for PHP

http://www.microsoft.com/sqlserver/2005/en/us/PHP-Driver.aspx Create custom DB schema, compatible with SQL Server Build a query translation tool, rewriting queries on-the-fly

Someone at Microsoft had this laying around

Page 49: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 49

BUT THERE’S ALSO... RESOURCES

Resources Images, other file uploads, ...

Normally stored on server disk But this may not survive on Windows Azure...

Solution Plugin using Windows Azure SDK for PHP Storing everything on Blob Storage Serving everything from Blob Storage

There’s a CDN available!

Page 50: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 50

Page 51: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 51

What’s in the cloud?DEMO TIMEIf the Internet works...

Page 52: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 52

What’s in the cloud?RESOURCES

Page 53: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 53

RESOURCES Windows Azure

http://www.azure.com

Windows Azure SDK for PHPhttp://phpazure.codeplex.com

SQL Server Driver for PHPhttp://sqlsrvphp.codeplex.com

AppFabric SDK for PHP developershttp://dotnetservicesphp.codeplex.com

PDChttp://microsoftpdc.com

PHP Architect December 2009 issuehttp://www.phparch.com

Steve Marxhttp://blog.smarx.com/

Clemens Vastershttp://vasters.com/clemensv/

Simon Guesthttp://simonguest.com/blogs/smguest

My bloghttp://blog.maartenballiauw.be/category/Azure.aspx

RealDolmen blogs is running on Azure!http://www.realdolmenblogs.com

Page 54: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 54

AZUG.BE – AZURE USER GROUP BELGIUM

Focus on the Azure Services Platform Community-driven Focus on architecture

And development And the business value of Azure

www.azug.be

Page 55: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 55

AND ONE MORE ANNOUNCEMENT...

Get a free t-shirt at the Microsoft booth!

Page 56: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 56

BEFORE SKIPPING TO Q&A...

Is the source code available? No, not at this time.

Do I need Visual Studio / Eclipse? Only for local debugging.

Do I need Windows & the Windows Azure SDK? Only for packaging. I’ll keep whining to make this available on Linux.

Page 57: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 57

QUESTIONS, POSSIBLY ANSWERS…

?Maarten Balliauw – RealDolmen

Blog: http://blog.maartenballiauw.beTwitter: @maartenballiauw

Page 58: Just Another Word Press Weblog   But More Cloudy

APRIL 11, 2023 | SLIDE 58

THANK YOU!

Maarten Balliauwhttp://blog.maartenballiauw.be