More than Just Lines on a Map: Best Practices for U.S Bike Routes
GopherMap Azure
1. GopherMap.com -Azure cloud computing social media mashup demo Roy Lachica, Bouvet ASA NNUG user group meeting, February 23. 2010
2. Agenda Background GopherMap The process towards the sky Azure Challenges Experiences Tips and tricks Azure SQL Asp.Net MVC, Twitter, Yammer, oAuth Demo Azure (14-16) Demo GopherMap (16-20) Feedback Questions (20-25)
3. Included in the prototype Windows Azure AzureSQL .Net 3.5 Extensionmethods Linq to SQL Asp.Net MVC jQuery oAuth TwitterAPI Yammer API Googlemaps API Considered: TopicMaps/RDF/Microformats Bing maps Facebookconnect FireEagleAPI LinkedIn SkyhookLoki Yahoo Upcomming, EventAPI
4. BackgroundGopherMap Why GopherMap.com Learn new stuff Want to create Experiences from previous private projects Operational problems: DNS, firewalls, disc full, logins, service packs, db index needs tuning, file level permissions, loose access when my IP changes, down time. Do not have time for operation and administration. Do not want to spend a lot of money on a private project .
5. The process towards the sky Project idea/vision (2 years ago) Started with sample code (Not Azure related) (9 months ago) Signed up for Windows Azure account (6 months ago) Started development and prepared for forthcoming Azure SQL (5 months ago) GopherMap running in the cloud (3 months ago)
6. Challenges Yammer open source code used system.diagnostics namespace which failed on Azure. Forgot to use Copy local on system.web.mvc DLL Twitter oAuthcallback could not be set to localhost Azure Sql Management studio port 1433 not open at home ISP. Had to use CerebrataBrowser based SQL Azure Database Explorer Time
7. Negative exeriencs with Windows Azure Lot of hassle with versions and service packs. Had to reinstall: Windows Azure Tools for Microsoft Visual Studio July 2009 CTP after installing a couple of windows updates. Product names and namespaces changed. New CTP’s, new paths and changes to the Windows Azure admin UI. Had to run on Vista or newer OS. VS run as administrator. Hard to read logs. Difficult to create table storage locally. Deployment hangs. Missing versioning/retract/restore in the cloud. Missing monitoring/profiling (Now part of Azure diagnostics). Azure costs even if app has not traffic (about 150$/month with minimal use?) Missing possibility for automatic load balancing. No SMTP support.
8. Positive experiences with Windows Azure Stabile deployment Fast end simple deployment Easy to scaling Good administration UI Do not have to administrate/manage/patch server (in contrary to for example Amazon and Vmwares cloud offerings) Can choose between Azure SQL, blog/queue/table storage Staging server with switch over to prodcution Easy to log errors with RoleManager.WriteToLog(string eventLogName, string message)
9. Tips and tricks Programming for Azure without Dev fabric Why would you do that: Dev fabric takes time to boot and you and change the files on the fly. Dev fabric will even sometimes hang. This makes markup and CSS development slow. twitter oAuth and possibly other services is problematic because call-backs can’t be set to localhost. Dev fabric usually runs on localhost:81 Requires Vista OS How to develop outside dev fabric Use stand alone web app and 1) copy to dev fabric or have two VS solutions then 2) deploy to Azure staging server and then 3) switch over to production. Write code that automatically detects environment and use the correct DB Connection String. Read configuration settings from web.config when running outside dev fabric. When running in Dev fabric read settings from Azure ServiceConfiguration.cscfg Write adapters that replace blobstorage when running outside dev fabric. http://screencasts.ehuna.org/2010/01/how_to_speed_up_windows_azure.html
10. How to checkwhatenvironmentyouareruning in publicenumEnvironmentType { Azure = 1, DevFabric = 2, LocalNoDevFabric = 3 } publicstaticEnvironmentTypeCurrentEnvironment { Get { if(Microsoft.ServiceHosting.ServiceRuntime.RoleManager.IsRoleManagerRunning) { if(Microsoft.ServiceHosting.ServiceRuntime.RoleManager.GetConfigurationSetting("BlobStorageEndpoint").Contains("127.0.0.1")) returnEnvironmentType.DevFabric; else returnEnvironmentType.Azure; } else { returnEnvironmentType.LocalNoDevFabric; } } } ……………………….. publicstaticstringImagesBlobStoragePath { get { if (GopherMap.Helpers.GophyEnvironments.CurrentEnvironment == GophyEnvironments.EnvironmentType.LocalNoDevFabric) return "/blobstorage/”; else returnMicrosoft.ServiceHosting.ServiceRuntime.RoleManager.GetConfigurationSetting("BlobStorageEndpoint").Trim() + "/imgs/"; } }
11. AzureSQL Pros Do not have to deal with artificial data tables (such as Azure Table storage, Google Bigtable, Amazon simpleDB) Just as working with any other database through MSSMS Cons Restrictions on port 1433 Restrictins on Sql server statements that can be used. Have to convert and strip before you migrate data.
12. ExperienceswithusingsocialAPI’s Twitter Mye data caching for å slippe å gjøre kall mot server hele tiden for alle klienter gratis autentisering og brukerprofil informasjon ulemper: ved caching så får man problemer med at app blir declined på server men cookies henger igjen oAuth med oAuth så går jeg som bruker til oAuthprovideren for å fjerne tilgang.
13. GopherMap on Azure, pros and cons in comparison to traditional hosting Pros: Less can go wrong during operational management Better security Staging environment Don’t have to worry about server been taken down Less downtime Saves time Simple scaling (Distributed caching with AppFabric former velocity) Green Cons: Can not install things on server Not free
14. Oppsummering Azuremakes lifeeasier for developers. Deploymentfaster and more simple. No need for Terminal services RDP: trenger ikke remote inn med remotedesktop og styre med å laste opp riktige filer og legge de ut på riktige steder og oppdatere ulike konfig filer osv osv. Somechildhooddiseases. Less hassle for thosewho start now. Works well for Social apps and usingAsp.Net MVC Here to stay.
15. Hvordan komme i gang En del eksempler tilgjengelig Du kan kode i C#, VB.Net, PHP Ta utgangspunkt i NerdDinner eller myTODO
17. GopherMap demo http://www.gophermap.com Lar deg finne relevante personer (relevant kompetanse) Beregnet spesielt for Konferanser og seminar Store organisasjoner
18. Lenker (howtos) Deploying an app: http://ecn.channel9.msdn.com/o9/ch9/4/4/6/6/8/4/DeployingOnWindowsAzure_2MB_ch9.wmv NerdDinnerAsp.Net MVC eksempel kode: http://www.marcmywords.org/post/NerdDinner-hosted-on-Windows-Azure-and-SQL-Azure.aspx Asp.Net MVC, jQuerypå Windows Azure med table storage eksempel: http://code.msdn.microsoft.com/mytodo
20. Questions Bouvet is hiring Open positions: .Net, Architects, SharePoint, Frontend. Contact Roy Lachica E-mail: roy.lachica@bouvet.noroy@hyposoft.no Web: http://roy.lachica.no LinkedIn: http://www.linkedin.com/in/roylachica Twitter: http://twitter.com/roylac Blog: http://fuzzzyblog.blogspot.com Also check out fuzzzy.com Web Science community
Editor's Notes
Det er så mye som skjer på ms stakken. Må ha et prosjekt for å bli motvert til å lære.Joel and jeff handler ike om verktøyene med hva man lager med deHosting via kompiser: billig men mye vedlikehold og administrering og driftsting.
tidlig ute når jeg så jeg var nummer 250 som hadde lastet ned migreringspakka.
Brukte Cerebrata gratis online database editor verktøy som proxy
så jeg må drive å kopiere kode fra arbdidsmaskina mi som er XP hjemme over til en annen maskin med Vista for så å generere deploymentpakken som lastes opp til den 17. deploymenten jeg gjorde fungerte ikke så jeg måtte slette tjenesten på Azure og opprette den på nytt. Tok ca 5 minutter å opprette tjenesten på nytt. mange som har hatt dette problemet. manuell deployment hvor man må klikke seg gjennom deployment stegene.
Devfabric er emuleringen av Azure lokalt på maskinenHvis bare css som enderes. Filer pakkes sammen og fyres opp emuleringen i azureMitt lille prosjekt tok ca 7 sek å fyre opp i devfabric på maskin som begynner å bli noen år gammel.
brukte cerebrata.com/SQLAzureClienttil å kopiere inn create script for hver enkelt tabell. http://sqlazuremw.codeplex.com/
Velocity: inmemory distribuert applikasjons cache
Setter opp firewall settingsDomenenavnet gophermap.com er koblet til siten via C-name oppføring hos dns hosting provideren jeg bruker domeneshop.no.
gophermap mål: hva om du kunne mingle med de som er mest relevant for deg,Kjører nå fra servere i USA