March 2010 - Posts
Design Patterns
- Hosting Silverlight in the Cloud
- ASP.NET website hosted in Windows Azure
- XAP file hosted on the website, used in the browser
- Like an on-premises website, but has the flexibility of the Cloud
- Shared Storage Signature for WIndows Azure Storage
- Use the FromConfigurationSetting static method from the CloudStorageAccount class
- Create a SharedAccessPolicy to define the policy for how the key will be shared.
Tips and Tricks
- Silverlight
- Use .NET Framework 3.5 in the Cloud
- ASP.NET MVC is recommended as the WebRole
- Make sure you Install Static Content support in IIS
- Smooth Streaming not supported yet on Windows Azure
- WCF
- For load-balanced considerations
- Load balanced endpoint flags
- Consider connections timeouts (1 minute)
- Asynchronous patterns works well
- PollingDuplexHttpBinding expects affinity
- In this case you’ll need to store the client state yourself
- Different port mappings in the cloud
- Quick: Patch port mappings into auto-generated service reference
- Other Windows Azure Platform Services
- SQL Azure
- SQL Database in the cloud
- Provisioned on-demand with high-availability
- No physical administration required
- Windows Azure Platform AppFabric
- Service Bus
- Connect Asynchronously between on-premise services and cloud services
- Firewall transversal with message rendezvous
- Access Control
http://dev.windowsazure.com
Renaud Paquay – Senior Technical Lead – Microsoft
- Blog Support
- Live Writer Support
What is Orchard?
- Free, open source, community-based projected aimed at delivering applications and reusable components on ASP.NET
- Built in ASP{.NET MVC 2.0
- Licensed under the BSD license
- Included in the ASP.NET Open Source Gallery under the CodePlex Foundation
- Hosted
Extensibility Deep Dive
- Architecture
- Based on ASP.NET MVC
- Modules
- Pages
- Blogs
- Comments
- Pages
- Tags
- Media
- Feeds
- Scheduling
- XmlRpc
- Users
- Roles
- Themes
- Navigation
- Setup
- Settings
- Homepage
- All the modules are built in a loosely coupled way
- Modules
- Can be Areas or Module in ASP.NET MVC
- Orchard Themes
- Based on the Layout View Context component and is composed by:
- User Control that represents the View
- Page that Represents the Layout
- Page that Represents the Document that has the Layout of the View that we are requesting
- Data Composition
- ContentManager to component is responsible for the CRUD operations and will connect to the ContentItem component to get the data and to the ContentHandler components to communicate the Events that happened inside the ContentManager component.
- ContentItem component is composed by ContentParts
Partners @ MIX
- Itelios/Magelia – Commerce Module
- Magelia NetStore
- Complete e-commerce offering
- Targets Mid-Sized business
- Open Source Edition H2 2010 at CodePlex
- Commercial Version in 2011
- http://www.magelia.org
- Matt Lee (RedGate) – Reviewer application
- To support their reviewing books
- Charlie Straut (Seven Shadows) – Troav
Mike Flasko – Lead Program Manager – Microsoft
Creating OData Feeds
- Two actors in the process
- OData Producer
- Define the Metadata
- Define the Format
- OData Consumer
We can Page the results of the OData Feed using the SetEntitySetPageSize method in the WCF Data Services configuration.
A lot of cool demos.
http://odata.org/consumers
http://odata.org/producers
Ron Jacobs – Sr. Technical Evangelist – Microsoft
http://blogs.msdn.com/rjacobs
“Do the simplest thing that will possibly Work”
Scalability – Able to support the required quality of Service as the system load increases – Wiktionary
Typical Web Architecture
- Users
- Need a to get routed to same machine (ex. stick sessions)
- Web Tier
- Data Tier
Problem: “It’s simple but isn’t scalable”
Solutions:
- Keep your data near where she’s processing
- Ex. Cache
- Cache is scoped to machines / process
- machine dies
- processes recycle
- Cache memory
- Imagine “What if?”
- You could have as much cache as you wanted?
- You could share giant parts of your applications?
- What about if it was free?
- You have: Windows Server App Fabric
What is AppFabric Caching?
- An explicit, distributed, in-memory application cache for all kinds of data
- Caching clients can be across machines or processes
- Clients access the cache as if it was a large single cache
- This creates a Unified Cache View.
- Doesn’t need to be recycled or recompiled when some other process or machine is added
Data Distribution
- Scale on Data Size – more machines => more memory to cache
- Scale on Cache Throughput – more machines => keys are distributed across machines => better throughput
- It’s better to scale with several machines that with a large machine with lots of memory, because the throughput
Take control over AppFabric Cache using the DataCacheFactory class.
Steps:
- Configure the AppFabric Configuration Store
- Copy the Client Dlls
- Update the Web.Config to host the AppFabric Caching
Supports:
- Clients: .NET 4.0 and 3.5
- Cache Server: .NET 4.0
Administration
- PowerShell commands
- Performance Counters
AppFabric Cache Codeplex Tool – http://mdcadmintool.codeplex.com
Security
- Domain-Based Security Option
- Domain Account / Load Account based Authentication
- Only authorized servers can join the clusters
AppFabric Caching Logical Hierarchy
Machine –> Cache Host –> Named Caches –> Regions –> Cache Items –> Objects
- Host
- Physical processes hosting AppFabric Caching instance
- Named Caches
- Regions
- Groups that you want to treat together
Types of Data
- Reference Data
- Primary Read Only
- ex. Catalog Data
- Activity Data
- Read-Write not shared
- Ex. Shopping cart
- Resource Data
- Read-write and Shared
- Ex. Auction Data / Seat Assignment
Reference Data
- Performance
- Catalog data doesn’t change often
- Unnecessary network cost to access from different machines
- Solution – Local Cache
- Bulk Get
- Bulk Fetch from region
- 200-300k of calls per second
- better performance
Activity Data
- Session Integration
- Just define SessionState to Custom mode and use the “SessopmStoreProvider” to use AppFabric Caching
- Availability
- It’s possible to define AppFabric Caching to use High Availability and replicate the cached data
Resource Data
- Optimistic Locking
- GetCacheItem returns a version object
- Every update to an object internally increments it’s version
- Supply the version obtained along with the Put/Remove
- Pessimistic Locking
- GetAndLock return a lock handle
- Doesn’t lock the Get
Resource and Activity Data
- Get Cache Events Notifications
- Register on any client to notify changes
- Batched Notifications
Scalable Notifications
- Register the notification for a specific key
- Map keys to partition
- Poll Required nodes
- Nodes return list of changes
How to get this
- Use at the Web Platform Installer, on the Options to enable the Enterprise Tab
- Afterwards just select the Enterprise tab and install it
View the endpoint.tv Shows Channel 9
Michael S. Scherotter – Media Experience Evangelist – Microsoft
Mail – mishero@microsoft
Twitter - @synergist
Blog – http://blogs.msdn.com/synergist
Design Goals
- Out-of browser
- Offline applications
- Multiple Services Simultaneously
- Expression Blend
- A/B Testing
- SketchFlow Application
- Important to track the information about how customers are using our sketch.
- Microsoft Silverlight Media Framework Player
Build upon Silverlight Behaviors
Architecture
- Application with the Analytics Services and the TrackAction will contact the DataCollector element that will send the information to the Event Log element.
- If we are offline everything is working and the information will store all the information in the Isolated storage and whenever the application goes online all the Analytics Services will be contacted and informed about all the actions made offline.
A Complete set of Behaviors related to Silverlight Analytics are made available easily inside Blend in order to define what to track and to analyze.
Extensibility
- Analytics Services Create Behaviors
- Basically wraps Service Calls
- Control Vendors Create Behaviors or Handler via MEF
- Framework Comes with Visual Studio Templates
Building it
- New Silverlight Class Library
- Add new Item ”Analytics Behavior”
- Template for developing Analytics Behaviors
- Gives you access to Analytics Events that are placed in your application
Application Performance
Partners
- Actually inside the Framework
- Analytics Services
- AT Internet
- Google Analytics
- Quantcast
- Comscore
- Nedstat
- GlanceGuide
- Preemptive Solutions
- Controls
- Telerik
- Microsoft Silverlight Media Framework
- Smooth Streaming Media Element
- The ones that will be in the Framework
- Analytics Services
- Controls
- Infragistics
- Microsoft Silverlight Media Framework
- Smooth Streaming Media Element
Service Oriented Analytics
- Platforms
- WPF Analytics
- Silverlight 4
- Behavior that wraps the Endpoints and places the analytics in them, leveraging all the power of the Silverlight Analytics not only for Silverlight applications
- http://msaf.codeplex.com
- Open Source – MS-PL
- Community Development
- Beta Status
- Learn from the code
Bing Maps
Scott Guthrie
In PDC09 Silverlight was installed in 45% of the machines, currently is on 60%
eBay
- eBay last week open the Open eBay where you can develop Silverlight applications and monetize.
Joe Belfiore (Corporate VP Windows Phone – Microsoft)