300 likes | 431 Views
Live Framework: Architecture and Insights. Ori Amiga Group Program Manager Microsoft Corporation. Azure ™ Services Platform. Azure ™ Services Platform. Agenda. Hard Problems Execution Engine Programming Model Summary Q & A. Observations. Devices
E N D
Live Framework: Architecture and Insights Ori Amiga Group Program Manager Microsoft Corporation
Azure™ Services Platform Azure™ Services Platform
Agenda • Hard Problems • Execution Engine • Programming Model • Summary • Q & A
Observations • Devices • Diversity of devices on the rise • My Computer My Mesh • Data • Users’ data is everywhere, in cloud,on devices • Data is often shared • Applications • Span devices • Are getting social • People • An integral part of our digital life
Hard problems • Composing data across cloud services and devices • Overlay ‘uber’ schema • Making data available, efficiently and consistently • Synchronized consistent cache • Writing robust communication code • Dealing with async and managing state • Dealing with disjoint programming models • Centralized resource management
Live Operating Environment • Live Framework’s service composition engine • Provides a programmable schemain the cloud • “cached reflection” on all my devices • Takes care of the hard problems… • Offline and sync • Centralized Resource management • Communication • Device management, user/device presence, notifications • Exists in cloud and on all devices • All the incarnations look and feel the same • Architected the same way • Provides a unified and consistent programming model to all the apps
Live Operating Environment … • Provides applications unified access to user’s data • Is everywhere • On local device (Client LOE) • In the cloud (Cloud LOE) • All incarnations share an identical architecture http://<contacts> [Client|Cloud] Live Operating Environment http://<storage> http://<directory> <peer devices>
demo Its just HTTP
Always Online WL Services WL Services WL Services Live Services Live Operating Environment (http://user.windows.net) Web Apps HTTP Cloud Device HTTP HTTP HTTP • AJAX/SL/Flash • Apps Desktop Apps Mobile Apps
Occasionally Connected WL Services WL Services WL Services Live Services Live Operating Environment (http://user.windows.net) HTTP Cloud P2P to another device Device AJAX/SL/Flash Apps Desktop Apps Live Operating Environment (http://localhost:2048) Local Cache HTTP HTTP
demo Cloud and Client Symmetry
Inside Live Operating Environment Host (Web/desktop) Live Framework Programming Model (Full /Min) CLR Live Operating Environment Engine Sync Engines Script Engine App Engine Sync Engines Sync Engines Formatters API Throttler Scheduler Cache Resource Manager Analytics FS Manager Auth/AuthZ P2P Comms Notifications Sync Engines Sync Engines Service Proxies HTTP Comms Device Mgmt
Programming Model – Building Blocks Auth Introspection Wire Formats CRUD URI-LINQ Query Sync Script/ Triggers Naming & Addressing Resources & Relationships Resource Extensibility Live Framework Infoset
Nouns • Everything interesting is a resource • Data, applications, news, subscriptions/notifications, social graph… • Resources • are URL addressable • based on a simple infoset (properties, records, collections) • projected onto wire as Atom, JSON, POX, RSS • can come from various data sources • MeshObject -- a distinguished resource meant for domain specific extensibility • Relationships • Hyperlink based across resources • Can be in-lined
Verbs • Standard HTTP methods and their interpretation • POST Create a new resource entity • PUT Update an existing resource entity • GET Read a resource entity/collection • DELETE Delete a resource entity • OPTIONS Discover the capabilities • HEAD {GET – entity body} • Consistent across the entire Resource Model • AtomPub for CRUD and FeedSync for sync • URI-LINQ mappings for queries
Resource Scripts • A domain specific language to do AtomPub and FeedSync • Grammar includes statements for CRUD, sync, control flow and data binding • Usage patterns • Powerful batching model • Pre/Post Triggers associated with resources • Programs serialized in JSON and POX in v0.1 • Native XAML and DLR bindings in future • Compensation! • Late binding of execution locality (local vs. remote) • Allows you to Visually design Live Framework programs
Resource Scripts • AtomPub statements (Request/Response) • CreateResource • ReadResource/ReadResourceCollection • UpdateResource • DeleteResource • CreateMediaResource • ReadMediaResource • UpdateMediaResource • DeleteMediaResource • FeedSync statements • SynchronizeResourceCollection
Resource Scripts • Control Flow statements • Sequence ala {…} block, executed sequentially • Interleave ala spawning a thread and executing each statement in the block on a separate thread. • Conditional ala If and If Else statement. The conditional expression is a Expression<Func<Statement, bool>> and is a lambda expression which returns a bool. • While looping construct • Assign statements • Allows for assigning properties of two statements
Resource Scripts • Basic authoring involves: • Build the statement DOM, either from • Compile the DOM • Execute the Script • Use cases: • Help avoiding chattiness/roundtrips. Single POST can execute a large program. • Modularization mechanism. Allows for factoring out all LOE interactions in a separate unit. • Can be used as triggers and sprocs. • Native Silverlight, DLR, JS support on the radarwindow.livefx.scripting.createResourceScript(/*JSON*/).compile().run();
demo Bringing data in the Mesh using Resource Scripts
demo Data Extensibility
Tips n' Tricks • Blow away the DB/MR/Assembler directory to start “fresh”. [Client re-downloads everything on first sign-in) • Local metadata store is in SQLCE (hint hint)[make sure to copy before peaking] • RMB against client/cloud helps differentiate client bugs vs. app bugs. • Monitoring the size of the Assembler vs. MR directory is a lightweight way to measure progress of enclosure fetch. • Collect logs when you run into issues. We absolutely use them.
Summary • Service composition engine on all devices (cloud is treated as a special device) • A symmetric cloud and client programming model • Platform agnostic, and lowest common denominator approach • Resource oriented approach • Everything is a resource • Resources are URL addressable • Standard HTTP verbs for CRUD, sync and scripting • Simple and open
Feedback • Email: dharmas@microsoft.com • Blog: dharmashukla.com
Evals & Recordings Please fill out your evaluation for this session at: This session will be available as a recording at: www.microsoftpdc.com
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Live Framework Resource Model Live Operating Environment Mesh Objects Notification Queue News Applications Devices Contacts Mesh Scripts Profiles Members Mappings Data Feeds News Subscription Data Entry Data Entry Media Resources