Stacked '13 Conference Notes
Thursday 17 Jan 2013 at 21:12
Conferences
|
conferences
development
microsoft
windows
This blog post represents my rough notes taken during the Stacked '13 full-day conference held at the LJMU Redmond Building in Liverpool.
A Lap Around Windows Azure Mobile Services - Mike Taulty
- Mikes talk is about building a quick, simple back-end for an app in the cloud using Windows Azure Mobile Services. The back-end isn’t just for a mobile app but could be used for a web app / desktop app too!
- Mikes app is about managing a conference and the rating against it. He starts with a simple data model, attributed as a DataContract with DataMembers. He also has a class for “cloud access”.
- Mike provisions the “Service” from the server explorer in VS2013. You can create the service via a dialog and it will provision a SQL Server and a web server that will serve up the service.
- Annoyingly, when adding a “connected service” to a VS app (connected service is the azure mobile service), it adds a public static field to the app.cs file (within a XAML app) to exposed to the whole app.
- After adding the connected service to the app, VS will pull down the details for the service and supply delete, insert, read, update javascript scripts within the VS app. These scripts run on the server (azure) within node.js!
- Remote “tables” from the database are exposed in the client as IMobileServiceTable
(where T is your data model class). - The data behind the service is fully accessible and browsable from the Windows Azure Portal.
- The Mobile Service “out of the box” support a few OAUTH providers for identity (Microsoft, Facebook, Twitter & Google). Hooking this up in the app is as simple as calling the .LoginAsync method on the globally exposed object (from the app.cs). This works after setting up the OAUTH Secrets within the Windows Azure portal.
- API endpoints can be created for the service within Windows Azure portal allowing public API access to service. In Mike’s app, he’s allowing public access to “rate” the conferences he’s previously created within his XAML app. This endpoint allows rating with a simple HTTP GET request.
- VS2013 allows adding a “push notification” an app. This is really a “mobile-services powered push notification” and simplifies the “dance” of setting up/registering with the provider supplied service for performing push notifications.
- Once created within the app, there’s a class created with an “UploadChannel” method which uses the PushNotificationChannelManager class within the .NET framework. This allows creating a “channel” (which is a per-user, per-app, per-device “channel” for push notifications) within Windows Azure.
- Note that push notifications via Azure ONLY work if the “app” that will get notified is available from the Windows Store!
Getting your nerd on with Microsoft’s Cloud Data Services - Scott Klein
- Scott’s talk focuses on the PaaS (Platform as a service) rather than the IaaS (Infrastructure as a service - VM’s etc.) or SaaS (Software as a service).
- SQL Azure is basically the same a normal SQL, but with a “service layer” in between client and server. The service layer is a TDS endpoint that the client connects to and is responsible for provisioning, billing & metering and connection routing.
- SQL Azure’s idle connections die after 30 mins of inactivity. Transactions are killed after 24 hours of running (!).
- SQL Azure uses soft & hard throttling. Soft throttling is SQL Azure scaling back your resources, and hard throttling is killing all connections etc. You have to be quite bad to even get soft throttled!
- It’s important to use retry logic for re-connecting to SQL Azure. (e.g. Use Enterprise library “Transient Fault Handling Application Block” etc.)
- SQL Azure uses database sharding to provide the scale-up and scale-down ability.
- Microsoft’s approach to scaling SQL Azure is around two strategies. One is to pre-define the quantity of shards required in advance (and further scaling around that is manual). The other is around dynamic scaling where some servers are created in advance, a “workload group” config is defined for the meta-data around how shards are created and balanced (max users, max db size etc.).
- A “shard map” is created and stored in SQL Azure so that
SELECT * FROM Users where UserID = 4
- SQL Azure , using the map, will know which shard contains UserID 4. - Scott moves on to “Azure Tables”. These are non-relational data storage Its a key-value storage, like a NoSQL db but not quite.
- Azure tables are schema-less but only have one index per table. (unlike, say, MongoDB). Azure Tables can be partitioned using a partition key.
- In code, a table record/entity is derived from TableEntity.
- Azure Tables will automatically partition in the background when tables get to a certain size. As a developer, you don;t have to worry about doing it
- Azure tables are priced based on data stored AND transactions against that data. SQL Azure is priced based only on data stored, and NOT per transaction.
Windows 8.1 - What’s new for developers? - Gill Cleeren
- There are a few breaking changes for any existing Windows 8 code (targeting a Metro interface). Some classes have been deprecated!
- There’s a lot of updated API’s in 8.1 (Input ,Control, HTML5/css, XAML). XAML has had major enhancements.
- 8.1 has a whole new HTTP stack along with support for 3D printers!
- The old “Search Contract” from Win8 (which required apps to “register” with the built-in Windows Search functionality is being phased out. Search is going back into individual applications.
- SnapView is also being phased out. Multiple apps can be open in Metro and can be resized independently to any size the user desires.
- Win8 has more controls for HTML/JS than in XAML. Win8.1 corrects this.
- XAML finally has a date/time picker (whose unit tests take Microsoft 12 hours to run!). XAML also now has “flyouts”. Flyouts are similar to “tooltips” but can be customized by the developer and the user can interact with flyouts (i.e. they can have custom buttons and other ui elements on them!). There’s a built in flyout called “MenuFlyout” for pop-up menus. There’s also a “SettingsFlyout” which is the Metro setting dialogues that appear from the right-hand side of the screen.
- Flyouts can be entirely defined within pure XAML.
- The Hub control has been improved to allow individual sections to be populated from different data sources (they all had to be the same datasource in Win8).
- There’s also a new AppBarButton control in XAML which allows easier creation of the circular buttons that are displayed at the bottom of a metro app.
- As part of the removal of the “global” search, there’s a new Windows.UI.XAML.Controls.SearchBox control. This is the search box that goes inside your own application rather than registering and using the global windows search UI. The API hasn’t changed though.
- The new HTTP API in Win8.1 is brand new for WinRT.
- WinRT also has a new “GeoFence”. This allows a developer to have an app that performs some function when the user is in a specific geographic area!
- Win8.1 gets the ability to be able to interact with the built-in Contacts on the windows device (it was previously impossible to interact with either contacts or appointments on Win8).
- Win8.1 also now has a Speech API supporting Text-to-Speech only (not understanding your voice). The voices are pre-defined though (you can;t use your own). It creates a stream which is passed to a XAML MEdiaElement to play the stream.
- The old “snapview” (320px wide metro ui thingy) from Windows8 is now optional. Now the minimum is based upon 500px, but the user can select to size a “docked” or “snapped” application to any size they want.
- VS2013 loses the ability to create Windows 8 apps. only create Windows 8.1 apps!
- Apparently the XAML designer in VS2013 is much improved and a lot faster! (About time!)
Windows Azure & Infrastructure as a service - Steve Plank
- Steve first clarifies the language used: IaaS (Infrastructure as a service) is VMs, Servers, Instances & Services. (these terms are interchangeable!)
- Steve mentions that by far the biggest part of any Windows Azure monthly bill is the charge for “compute hours”.
- Steve explains that the servers you can create in Azure all include the cost of licences in their “per-hour” charge. There’s even Oracle database that’s currently in preview but you need a separate license direct from Oracle for this. In the future, you’ll be able to get Oracle on Azure without the Oracles license (MS will pay oracle on your behalf from the per-hour cost.)
- Pretty much all MS products can run in Azure. One notable exception is Exchange. That doesn’t exist, but Steve says that in the fullness of time (5-7 years) ALL MS Software will be cloud enabled.
- Windows Azure is NOT Active Directory running in Windows Azure. It’s for managing things like organisation-wide MSDN subscriptions etc. (i.e. central management per org. - MSDN Organisational Accounts)
- IaaS - hardware is managed for you but you still need to manage things like OS patches etc. PaaS - you only need to worry about your own applications and data. SaaS - pretty much everything is dealt with for you.
- Microsoft Open Tech has a “VM Depot” (vmdepot.msopentech.com) to house VM images that can be created and consumed by anyone (for opensource softwar/OSs of course - linux etc.)
- Steve shows a powershell script to create a complete azure “virtual network” of some SQL servers, with associated VHD’s (multiple for SQL - 1 for data drive and 1 for log drive) and 3 web front ends with Sharepoint. It even includes it’s own DNS server for resolution to allow hitting one IP address then accessing 3 different ports that actually map to the same port but on 3 different machines.
- Steve says there is also “Cloud Services” whereby you can go from a full infrastructure architectural diagram to an actual deployment in around 15 minutes! This is done via an XML document that provisions the entire infrastructure and can also include deployment of your own software/applications as part of this. This is what the “Cloud Services” option in the Windows Azure portal menu does. It basically automates the provisioning of a complete “environment” (i.e. staging environment with 2 SQL boxes, 5 web boxes etc.) you create this with the XML config file that defines your entire environment infrastructure along with a “package” file (that can be created from Visual Studio) that contains your own software that needs to be deployed as part of the provisioning process. (i.e. your own software that you want to be tested).
- Free training kit for this: http://aka.ms/watk
Building Zudio - Mark Rendle
- Zudio is an Azure cloud storage toolkit, it’s basically like SQL Server management studio but for Azure Storage (blobs, queues, tables etc.). It’s a web app and itself uses Azure Websites to house it’s files.
- Mark explains the need for Zudio to have a global presence. He wants the Zudio web application to be served from the same data centre that each customers data is stored on. He currently has customers in Europe, USA and East Asia etc.
- Azure websites are very quick and easy to deploy to (much easier and quicker than the Cloud Services). Mark’s current release “script” is: git push origin release
- Azure has a Node.js package called Azure-CLI which allows deployments (and reverting to previous deployments) via Node.js!
- Scaling UP an azure vm or cloud service means a complete re-provisioning. Scaling up Azure websites is simply a button click on the Azure Portal.
- Scale by Metric is currently only by CPU. but more metrics will come in the future such as requests per second or memory consumption.
- Mark suggests that the philosophy from the Node.js devs is that to build a big web app is actually to build lots of little apps, but make them look like one big app from the users browser
- A forthcoming version Zudio will be CORS (cross-origin Resource Sharing) to allow different subdomains - each running a small application that makes us a part of the complete application - to share resources.
- Azure’s Traffic manager allows having a sort of load balancer that performs the same geo-locating balancing (ala CDN’s).
- Mark says that his “Simple.Web” project (which Zudio is written using) is essentially a replacement for Microsoft’s original Web API - Mark says MS “broke” WebAPI?
- Mark has continuous integration but uses a Azure VM which has TeamCity and Octopus Deploy on it to provide the build and test part of the process.
- Mark uses Background workers in Zudio to allow for very long running processes (i.e. copying an entire storage object from one data centre to another). These use “Worker Roles” in Azure which is the same as a “Web Role” but without IIS
- App settings and connection strings config settings in the Azure portal effectively override the equivalent parts of an ASP.NET web app’s web.config file.
- The new Visual Studio online editor has a console (REPL) that allows (for example) installation of npm modules etc.
- Azure websites now also include the ability to remotely debug the site from the VS on your local machine.
- Mark uses Require.js which allows fallback of JS frameworks from a CDN to another CDN or your own local copy.
- Mark says that “spriting images” (making lots of small images into one big one!) has a big impact on web page load performance. Use Compass for spriting images or icomoon.io to create a web font from images.
Search
Categories
Tags
conferences (27)
development (27)
dotnet (21)
ddd (20)
c# (8)
asp.net (8)
microsoft (6)
razor (5)
certification (5)
database (4)
ssh (4)
sql (3)
cloud (3)
ssl (3)
bitbucket (3)
github (3)
intellisense (3)
extensions (3)
aws (2)
jquery (2)
knockout (2)
windows (2)
mercurial (2)
javascript (2)
powerbi (1)
analytics (1)
staticanalysis (1)
software (1)
review (1)
visualstudio (1)
analysis (1)
codeclones (1)
entityframework (1)
mysql (1)
automapper (1)
upgrade (1)
binding (1)
select (1)
validation (1)
putty (1)
hosts (1)
ci (1)
git (1)
nuget (1)
files (1)
encoding (1)
stacked (1)
azure (1)
owin (1)
authorisation (1)
webapi (1)
mvc (1)
web (1)
testing (1)
security (1)
sourcecontrol (1)
administrator (1)
keyboard (1)
motivation (1)
autonomy (1)
fizzbuzz (1)