<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Live Mesh : Behind Live Mesh</title><link>http://blogs.msdn.com/livemesh/archive/tags/Behind+Live+Mesh/default.aspx</link><description>Tags: Behind Live Mesh</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Developers, meet the Live Framework blog</title><link>http://blogs.msdn.com/livemesh/archive/2008/11/21/developers-meet-the-live-framework-blog.aspx</link><pubDate>Sat, 22 Nov 2008 01:21:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9132370</guid><dc:creator>Live Mesh Team</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/livemesh/comments/9132370.aspx</comments><wfw:commentRss>http://blogs.msdn.com/livemesh/commentrss.aspx?PostID=9132370</wfw:commentRss><description>&lt;P&gt;We've been using this blog to share information about both Live Mesh the user experience, and what we formerly referred to as Live Mesh the developer platform.&amp;nbsp; With the news at &lt;A class="" href="http://www.microsoft.com/presspass/events/pdc/default.mspx" mce_href="http://www.microsoft.com/presspass/events/pdc/default.mspx"&gt;PDC&lt;/A&gt; about &lt;A class="" href="http://dev.live.com/" mce_href="http://dev.live.com/"&gt;Live Services&lt;/A&gt; and the &lt;A class="" href="http://dev.live.com/liveframework/" mce_href="http://dev.live.com/liveframework/"&gt;Live Framework&lt;/A&gt;, it's time to re-focus this blog on just the platform experience of Live Mesh.&amp;nbsp; We'll continue to post news here about changes and updates to &lt;A href="http://www.mesh.com/"&gt;www.mesh.com&lt;/A&gt; and our client software for PC, Mac and Windows Mobile.&lt;/P&gt;
&lt;P&gt;We've created a new team blog, &lt;A href="http://blogs.msdn.com/liveframework"&gt;http://blogs.msdn.com/liveframework&lt;/A&gt;, as a home for our developer oriented content.&amp;nbsp; This is where we'll share more &lt;A class="" href="http://blogs.msdn.com/livemesh/archive/tags/Behind+Live+Mesh/default.aspx" mce_href="http://blogs.msdn.com/livemesh/archive/tags/Behind+Live+Mesh/default.aspx"&gt;Behind Live Mesh&lt;/A&gt; content, tips and tricks for writing applications using the Live Framework, and other developer-centric news and information.&amp;nbsp; Earlier today, for example, we announced a new build of the &lt;A href="http://developer.mesh-ctp.com/"&gt;Live Framework Developer Sandbox&lt;/A&gt;&amp;nbsp;and SDK are available to developers in the Live Framework CTP.&amp;nbsp; We've also got a couple team members Tweeting away about Live Framework topics at &lt;A href="http://twitter.com/liveframework"&gt;http://twitter.com/liveframework&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;Techorati: &lt;A class="" href="http://technorati.com/tags/LiveMesh" mce_href="http://technorati.com/tags/LiveMesh"&gt;LiveMesh&lt;/A&gt;, &lt;A class="" href="http://technorati.com/tags/LiveFramework" mce_href="http://technorati.com/tags/LiveFramework"&gt;LiveFramework&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9132370" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/livemesh/archive/tags/Behind+Live+Mesh/default.aspx">Behind Live Mesh</category><category domain="http://blogs.msdn.com/livemesh/archive/tags/Platform/default.aspx">Platform</category></item><item><title>Behind Live Mesh: The Pub-Sub System</title><link>http://blogs.msdn.com/livemesh/archive/2008/10/08/behind-live-mesh-the-pub-sub-system.aspx</link><pubDate>Thu, 09 Oct 2008 06:33:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8992398</guid><dc:creator>Live Mesh Team</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/livemesh/comments/8992398.aspx</comments><wfw:commentRss>http://blogs.msdn.com/livemesh/commentrss.aspx?PostID=8992398</wfw:commentRss><description>&lt;p&gt;Hey there! I&amp;#8217;m &lt;a href="http://crazyviraj.blogspot.com/"&gt;Viraj Mody&lt;/a&gt;, a developer on the Live Mesh services team. I bet some of you are curious about how the Live Mesh software running on your devices detects when others add files to your shared Live Folders, quickly changes icon colors when devices go from offline to online, or updates your Live Mesh News Feeds as changes occur. This post will give you some insight into the facilities we&amp;#8217;ve built in the Live Mesh back-end that enable client applications to do all of the above and much more.&lt;/p&gt;  &lt;p&gt;In order to be responsive and perform well, Live Mesh, like most other &lt;a href="http://msdn.microsoft.com/en-us/architecture/aa699384.aspx"&gt;software + services&lt;/a&gt; systems, requires that the cloud (services) be able to send out-of-band messages to clients (software). Most actions initiated by the client (&lt;a href="http://blogs.msdn.com/livemesh/archive/2008/05/09/behind-live-mesh-what-is-moe.aspx"&gt;MOE&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/livemesh/archive/2008/05/05/behind-live-mesh-live-desktop-architecture.aspx"&gt;Live Desktop&lt;/a&gt;) are triggered as a result of these messages sent from the Live Mesh services cloud to that specific client. These could be messages informing the client that items in the cloud have changed, that another client wants to initiate a &lt;a href="http://channel9.msdn.com/posts/Dan/David-Steere-and-Trevor-Robinson-How-Live-Mesh-P2P-Syncing-Works/"&gt;peer-to-peer&lt;/a&gt; connection to this client, and so on. Such out-of-band messages that the cloud sends to clients are called &lt;i&gt;Notifications&lt;/i&gt;. In order to keep the overall system performing well and to safeguard the privacy of clients, it is important that a client only receives Notifications for items it is interested in and has &lt;a href="http://blogs.msdn.com/livemesh/archive/2008/05/29/behind-live-mesh-authorization-and-encryption.aspx"&gt;permissions&lt;/a&gt; to access. Each client has the ability to tell the cloud what items it is interested in monitoring. This expression of a client&amp;#8217;s interest in changes to specific information in the cloud is referred to as a &lt;i&gt;Subscription&lt;/i&gt;. Together, these Subscriptions and Notifications form the building blocks of Live Mesh&amp;#8217;s Pub-Sub System.&lt;/p&gt;  &lt;p&gt;In this post, I&amp;#8217;ll go over the different back-end services that comprise the Pub-Sub System and provide an overview of how the system works end-to-end. In many ways, the Pub-Sub System can be understood by comparing it with a &amp;#8216;secure and smart postal service&amp;#8217;, where the post office only sends you mail that you&amp;#8217;re interested in receiving &lt;i&gt;and&lt;/i&gt; that the sender says you have permission to receive. A spam-free postal system &amp;#8211; wouldn&amp;#8217;t that be awesome!&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Establishing a Communication Channel&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;For the Pub-Sub system to be effective there must be some way for the cloud to identify and communicate with each client. Live Mesh exposes facilities that allow clients to create a &lt;i&gt;Queue&lt;/i&gt; which is uniquely associated with that particular client and assigns a unique name that is used to identify this queue. When creating a Subscription to a specific item, the client passes along its unique Queue name which allows Notifications to be delivered to that Queue. Going back to the postal system analogy, this Queue is like the mail box outside your home, and the unique name of the Queue is like your mailing address. Similar to how the postal system ensures that mail addressed to you only ends up in your mail box, Live Mesh services ensure that Notifications for a given client end up only in that client&amp;#8217;s Queue.&lt;/p&gt;  &lt;p&gt;The client is responsible for retrieving Notifications from its Queue. By separating delivery of Notifications from the act of retrieving them, the architecture enables various transport types to be used to retrieve Notifications from a Queue. Currently, the Live Mesh service cloud exposes two transports for retrieving these Notifications &amp;#8211; HTTP and TCP. Given the pervasiveness and ease of use of these two transports, these were the first types we decided to support. As our service offering and scope grows, we can enable more transport types without major changes to the back-end architecture. Using the HTTP resource model exposed by the Live Mesh services, clients can choose to periodically fetch Notifications from their Queue. Using TCP enables clients to establish a long-lived connection to the Live Mesh service cloud so that Notifications can be pushed to clients as soon as they arrive. Different clients have different behavior, requirements and constraints &amp;#8211; by providing various transport types we can enable several classes of clients and applications to leverage Live Mesh&amp;#8217;s Pub-Sub system. Of course, these communications are encrypted and only the owner of a Queue can retrieve Notifications from it. It&amp;#8217;s important to note that as it currently stands, the Queue and related services only support unidirectional messaging. Messages from clients to the Live Mesh service cloud do not flow via the Queue. Also, as of writing this post, the Live Mesh client available for Tech Preview doesn&amp;#8217;t yet leverage the TCP transport solution &amp;#8211; it will in a future release.&lt;/p&gt;  &lt;p&gt;Besides change Notifications, the client&amp;#8217;s Queue is also populated with a special type of Notification when another client wishes to initiate a peer-to-peer connection. Only authorized clients are allowed to send such peer-to-peer invites. The purpose of the peer-to-peer connection might be for file exchange and sync, for Live Remote connections, etc. Details about our peer-to-peer design can be found in &lt;a href="http://channel9.msdn.com/posts/Dan/David-Steere-and-Trevor-Robinson-How-Live-Mesh-P2P-Syncing-Works/"&gt;this Channel 9 video&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;All Queues and Queue-related information are managed by the &lt;i&gt;Queue Service&lt;/i&gt;. Like other services described later in this post, the Queue service is a transient-state service and is built to scale horizontally. I&amp;#8217;ll touch on both these characteristics of the services later.&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Creating Subscriptions&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;Once a client has created its Queue, it can create Subscriptions to items in the Live Mesh cloud that it wants to stay current on by providing its Queue name along with the Subscription. Typically, each Live Mesh device creates Subscriptions for user/device presence, for each Live Folder&amp;#8217;s various feeds (Membership, Contents, etc), for the news feed, and so on. In order to create a Subscription for a specific item, the client must provide proof that it has privileges to access the item. Once these Subscriptions have been created, the system ensures that the client will be informed when any of the items it has subscribed to are changed &amp;#8211; each Notification that is delivered into the client&amp;#8217;s Queue contains information about which specific resources has changed, in addition to other potentially interesting information about the changed resource.&lt;/p&gt;  &lt;p&gt;Subscriptions created by clients are held in the &lt;i&gt;PubSub Service&lt;/i&gt;. It is responsible for maintaining information about which client is interested in what item and for fanning out Notifications to the right clients when an item changes. You can think of it as the central post office of the &amp;#8216;secure and smart postal system&amp;#8217; which acts as the one location for collecting all mail and then routing it onwards to the right destination. Just like the Queue Service, the PubSub Service is a transient-state service and is built to scale horizontally.&lt;/p&gt;  &lt;p&gt;&lt;u&gt;End-to-end Flow&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;Once a client has created a Queue and all its Subscriptions, it doesn&amp;#8217;t aggressively keep refreshing information from the cloud. If using the HTTP transport to talk to its Queue, the client periodically polls the Queue to check for any Notifications that may have arrived. In cases where it&amp;#8217;s using the TCP transport, the client is waiting for a Notification to be pushed down to it over the TCP channel. When an item changes in the cloud (let&amp;#8217;s say, a file was added in a folder that the client has expressed interest in knowing about), the service responsible for that item (in this case, the storage service) informs the PubSub Service that the item has changed. The PubSub Service, which has been keeping track of all clients who are interested in that particular item, drops an appropriate change Notification in each interested client&amp;#8217;s Queue. As soon as clients retrieve these Notifications (or as soon as the Notification is pushed to them) they can react. In the case of a new file being added, they might choose to begin initiating a peer-to-peer connection in order to sync the new file.&lt;/p&gt;  &lt;p&gt;In our &amp;#8216;secure and smart postal system&amp;#8217; analogy, this is equivalent to a magazine publisher informing the post office that a new edition is available, and the post office dropping a letter in each subscriber&amp;#8217;s mail box informing them that a new edition is available. Optimally, the magazine publisher could also deliver one copy of the latest edition to the post office and the post office could be smart enough to create the right number of replicas and deliver a copy to each subscriber&amp;#8217;s mail box. Here&amp;#8217;s where the &amp;#8216;smart&amp;#8217; in &amp;#8216;smart and secure&amp;#8217; could come in!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/livemesh/WindowsLiveWriter/BehindLiveMeshThePubSubSystem_1211F/image_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="321" alt="image" src="http://blogs.msdn.com/blogfiles/livemesh/WindowsLiveWriter/BehindLiveMeshThePubSubSystem_1211F/image_thumb.png" width="486" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Pub-Sub System end-to-end flow&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Transient State Services and Scale-out&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;As I mentioned previously, all services that comprise the Live Mesh Pub-Sub System are transient-state services. Queues created by clients, Notifications that are delivered to specific Queues and Subscriptions representing a client&amp;#8217;s interest in a particular resource are only ever held in memory and never persisted to any kind of store. As you might probably guess, &lt;a href="http://en.wikipedia.org/wiki/Seek_time"&gt;performance&lt;/a&gt; was one of the biggest motivators for this design. Pub-Sub is characterized by short-lived rapidly changing data and data that needs to be readily available. Short-lived and changing because Queues, Subscriptions and Notifications are, by nature, transient &amp;#8211; once a Notification is delivered to its intended recipient, it&amp;#8217;s of no use; once a client is offline or doesn&amp;#8217;t care about receiving Notifications, its Queue is of no use; Subscriptions could come as and go as application state changes. Data must be readily available because subscriber lists can often be huge, so retrieving them from persistent stores can introduce latencies that only increase as the service grows in size. Holding these in memory allows reads and writes to be processed very fast. Since they live in memory, both Queues and Subscriptions have lifetimes associated with them &amp;#8211; clients must perform certain actions (some explicit, some implicit) to keep Queues and Subscriptions &amp;#8216;alive&amp;#8217; and prevent associated resources from being reclaimed by the server. Given the initial wave of Live Mesh experiences and applications, having these be transient-state services definitely helps ensure high throughput and low latency. Of course, the fact we chose to implement the system as a transient state system is an implementation detail &amp;#8211; as the product evolves and use cases changes, there might be reasons to prefer some kind of hybrid approach.&lt;/p&gt;  &lt;p&gt;The system is also designed to enable &lt;a href="http://www.scalingout.com/2007/10/vertical-scaling-vs-horizontal-scaling.html"&gt;horizontal scale-out&lt;/a&gt;. As the system needs more space to hold Queues and Subscriptions, we can bring up new instances of these services to increase capacity. Using a scheme based on &lt;a href="http://www.spiteful.com/2008/03/17/programmers-toolbox-part-3-consistent-hashing/"&gt;consistent hashing&lt;/a&gt;, the Live Mesh services cloud guarantees that there is ever only one specific server instance that can &amp;#8216;manage&amp;#8217; a given Queue or Subscription. The system also enables routing of messages for specific Queues and Subscriptions to the correct current manager. As new service instances come online and others go offline, the system automatically re-balances the distribution of Queues and Subscriptions to the currently available servers such that every Queue or Subscription is managed by one and only one server instance.&lt;/p&gt;  &lt;p&gt;One of the obvious concerns with the system being implemented in-memory only is data recovery &amp;#8211; when servers go down because of hardware/software issues, are re-booted, or otherwise need to be reset, all data resident in memory on those servers is also gone. For Queue Service instances, this implies that Queues belonging to several clients and potentially interesting Notifications in those Queues might be gone. For the PubSub Service, several subscriber lists might be lost when a server loses state. This is a problem we spent a huge amount of time addressing and designing for, and probably deserves a post of its own at some future time. A short summary of the solution is that in cases where one or several Queue and/or PubSub Servers go down, the system is able to detect exactly what happened and take remedial action to restore state in the cloud in cooperation with clients (because clients were the original source for all the transient data that was resident on those servers before they lost state).&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Parting Notes&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;As the future scope of the Live Mesh experience, services and platform evolves (for instance, potentially allowing third-party services to subscribe to items in Live Mesh, enabling aggregators to leverage Live Mesh Pub-Sub, etc), the current Pub-Sub System architecture will hopefully provide a good scalable foundation which we can leverage to rapidly increase capabilities of the service. &lt;/p&gt;  &lt;p&gt;We&amp;#8217;re working on exposing Pub-Sub capabilities via the Live Mesh SDK when it becomes available so that developers can leverage the system in innovative ways to build responsive applications. Be sure to visit the &lt;a href="https://www.mesh.com/web/developer.aspx"&gt;Live Mesh Developer page&lt;/a&gt; and join the &lt;a href="https://connect.microsoft.com/InvitationUse.aspx?ProgramID=2181&amp;amp;SiteID=425&amp;amp;InvitationID=DEV-VP8Q-K3KG"&gt;developer waiting list&lt;/a&gt; for announcements around the Live Mesh SDK when it&amp;#8217;s available.&lt;/p&gt;  &lt;p&gt;I hope this post gives a little more insight about how things work &lt;a href="http://blogs.msdn.com/livemesh/archive/tags/Behind+Live+Mesh/default.aspx"&gt;behind Live Mesh&lt;/a&gt;. Be sure to install Live Mesh on all your devices, &lt;a href="https://feedback.live.com/default.aspx?productkey=livemesh&amp;amp;mkt=en-us"&gt;give us feedback&lt;/a&gt; and &lt;a href="http://forums.community.microsoft.com/en/LiveMesh/threads"&gt;report any issues&lt;/a&gt; you see!&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:50e594ec-4ecb-4e9c-bc95-5948f522583a" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/LiveMesh" rel="tag"&gt;LiveMesh&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8992398" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/livemesh/archive/tags/Behind+Live+Mesh/default.aspx">Behind Live Mesh</category></item><item><title>Behind Live Mesh: Authorization and encryption</title><link>http://blogs.msdn.com/livemesh/archive/2008/05/29/behind-live-mesh-authorization-and-encryption.aspx</link><pubDate>Thu, 29 May 2008 18:31:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8558929</guid><dc:creator>Live Mesh Team</dc:creator><slash:comments>20</slash:comments><comments>http://blogs.msdn.com/livemesh/comments/8558929.aspx</comments><wfw:commentRss>http://blogs.msdn.com/livemesh/commentrss.aspx?PostID=8558929</wfw:commentRss><description>&lt;p&gt;Hi, I am Nikolai Smolyanskiy, a developer on the Accounts team. I work on the Account service that takes care of account management, and user/device authentication and authorization in &lt;a href="http://www.mesh.com"&gt;Live Mesh&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;There were many questions asked by early adopters about how their data is transmitted and stored in Live Mesh, and how access is controlled. In this post I&amp;#8217;ll talk about the security and authorization architecture behind Live Mesh, so that you understand the amount of care we take and feel better about trusting your data to the Mesh. This post can also be found &lt;a href="http://nsmoly.wordpress.com/category/live-mesh/"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Here is the diagram that illustrates all communications between user devices and Live Mesh cloud services and encryption/security mechanisms used in these communication channels:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/livemesh/WindowsLiveWriter/BehindLiveMeshAuthorizationandencryption_7743/meshauth_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="336" alt="meshauth" src="http://blogs.msdn.com/blogfiles/livemesh/WindowsLiveWriter/BehindLiveMeshAuthorizationandencryption_7743/meshauth_thumb.png" width="474" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Live Mesh security is rooted at the authentication provider (Windows Live ID, aka Microsoft Passport is our provider today) which is used for initial user and device authentication. Once a user or a device is authenticated and a corresponding authentication token is obtained, the Live Mesh client passes this token to the Live Mesh Account service to access the root of the user&amp;#8217;s mesh and to get the initial set of Live Mesh tickets. These tickets are used for further Mesh operations on other resources that this root is pointing to. All communications with the Live Mesh cloud services are done via &lt;a href="http://en.wikipedia.org/wiki/Secure_Sockets_Layer"&gt;HTTPS / SSL&lt;/a&gt;, so 3&lt;sup&gt;rd&lt;/sup&gt; parties cannot intercept and read client-server communication.&lt;/p&gt;  &lt;p&gt;All user (or device) related resources in Live Mesh are organized in a &lt;a href="http://en.wikipedia.org/wiki/Representational_State_Transfer"&gt;RESTful manner&lt;/a&gt;, i.e. they form a graph where each node is identified by a unique URL and represents a given resource. Nodes contain resource metadata and links to other resources. Mesh operations are essentially CRUD operations on the nodes of the user tree or nodes of other user trees if those users shared any data. Live Mesh cloud services check access rights in each operation by inspecting passed tickets and authorizing access only if a correct set of tickets is passed. Tickets can be obtained from the Account service or from responses to previous cloud operations. &lt;/p&gt;  &lt;p&gt;Live Mesh authorization tickets are standard &lt;a href="http://en.wikipedia.org/wiki/SAML"&gt;SAML tickets&lt;/a&gt;. They are digitally signed with the Live Mesh private key to prevent spoofing and they expire after a limited lifetime. Some tickets are used to just authenticate users or devices, other tickets contain authorization information about user/device rights. Cloud services inspect each resource request and authorize access only if it contains valid tickets (correctly signed and not expired) and these tickets specify that the requestor indeed has access to the requested resource. For example, a device X can initiate P2P data synchronization with device Y only if it presents a ticket that is correctly signed by Live Mesh and contains a record saying that both device X and Y are claimed by the same user OR if it contains a record saying that X and Y have the same Live Mesh Folder mapped on them (in the case that the devices are claimed by different users that are members of this Live Mesh Folder). Tickets are passed to the cloud services in the Authorization header using HTTPS to prevent replay attacks. &lt;/p&gt;  &lt;p&gt;Each device in Live Mesh (computers, PDAs, mobile phones) has a unique private key that is generated during Live Mesh installation and used to authenticate the device in P2P communications with other devices. When a P2P communication is being established between two devices, they first use asymmetric encryption (&lt;a href="http://en.wikipedia.org/wiki/RSA"&gt;RSA algorithm&lt;/a&gt;) to exchange encryption keys and then use symmetric encryption (&lt;a href="http://en.wikipedia.org/wiki/Advanced_Encryption_Standard"&gt;AES with 128 bit key&lt;/a&gt;) to transfer data/files over TCP/IP. The RSA exchange guards against leaking symmetric encryption keys. AES encryption protects actual data from prying eyes. Live Mesh also uses a keyed message authentication code (&lt;a href="http://en.wikipedia.org/wiki/HMAC"&gt;HMAC&lt;/a&gt;) to verify the integrity of the data exchanged on a P2P channel.&lt;/p&gt;  &lt;p&gt;If there is no direct connection between two devices (for example, if one device is behind a firewall), then the cloud communication relay located in the Microsoft data center is used to forward data packets from one device to another. All the traffic is encrypted in the same way as in the case with direct P2P link, i.e. first keys are exchanged with RSA and then traffic is encrypted with AES. The cloud relay cannot decrypt/read user data, since encryption keys are exchanged with the use of asymmetric encryption (RSA). &lt;/p&gt;  &lt;p&gt;Live Mesh cloud services help devices find each other and establish communications. They cannot read synchronized user data/files relayed through the cloud, except for the case when user files are synchronized with the cloud storage (i.e. Live Desktop). At the moment, the limited Tech Preview of Live Mesh synchronizes your files not only between your devices, but also with your cloud storage (which you can access via &lt;a href="http://nsmoly.wordpress.com/2008/05/12/live-mesh/"&gt;Live Desktop&lt;/a&gt;) until you reach your storage quota (5GB as of today). So your files and metadata that describes them are stored in the Microsoft datacenter. They are protected by strong access control mechanisms, but the data is not stored in encrypted form. After the storage quota has been reached, all files are synchronized only P2P and not stored in the cloud (only metadata is stored in the datacenter). In the future, Live Mesh will allow users to selectively choose which files or Live Mesh Folders they want to synchronize with the cloud. If you choose to synchronize your data/files between your devices only, Live Mesh will not store your files in the cloud and will only store metadata that lets the service to operate.&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:6fc7a626-25b2-4731-86a2-0f4c7814fa16" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/LiveMesh" rel="tag"&gt;LiveMesh&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8558929" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/livemesh/archive/tags/Behind+Live+Mesh/default.aspx">Behind Live Mesh</category></item><item><title>Behind Live Mesh: What is MOE?</title><link>http://blogs.msdn.com/livemesh/archive/2008/05/09/behind-live-mesh-what-is-moe.aspx</link><pubDate>Sat, 10 May 2008 01:41:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8482484</guid><dc:creator>Live Mesh Team</dc:creator><slash:comments>20</slash:comments><comments>http://blogs.msdn.com/livemesh/comments/8482484.aspx</comments><wfw:commentRss>http://blogs.msdn.com/livemesh/commentrss.aspx?PostID=8482484</wfw:commentRss><description>&lt;p&gt;Howdy!&amp;#160; This is Richard Chung, a client developer for Live Mesh. You can find me blogging sporadically as DevDuck over on &lt;a href="http://devduck.spaces.live.com/"&gt;red hot place&lt;/a&gt;.&amp;#160; I was one of the first developers on the Live Mesh team&amp;#8212;I&amp;#8217;ve been working on this stuff for over 2 years now and have been itching to talk about it!&lt;/p&gt;  &lt;p&gt;By now, you&amp;#8217;ve read all about &lt;a href="http://blogs.msdn.com/livemesh/"&gt;Live Mesh&lt;/a&gt;.&amp;#160; Hopefully, some of it makes sense to you&amp;#8212;you might even be able to envision how it can dramatically change the way you manage data across your devices, share and interact with your friends and family, and collaborate with peers or partners!&amp;#160; If not, that&amp;#8217;s ok.&amp;#160; The whole concept of Live Mesh will become clearer in the months ahead, especially as more&amp;#160; applications and experiences are created on top of the platform.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Software + Services&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;When you were first introduced to Live Mesh, you probably played with the &lt;a href="https://www.mesh.com/web"&gt;Live Desktop&lt;/a&gt;.&amp;#160; It&amp;#8217;s pretty snazzy.&amp;#160; Maybe you even uploaded a few files too.&amp;#160; Hey, it&amp;#8217;s a cool service!&amp;#160; You can store stuff in a cloud somewhere and access it anywhere using a webpage.&amp;#160; Great!&lt;/p&gt;  &lt;p&gt;As I look at the statistics on the service though, I notice that a significant portion of our users have stopped here.&amp;#160; This pains me, as there&amp;#8217;s a whole lot more you can do with Live Mesh.&amp;#160; Didn&amp;#8217;t you hear all the hoopla about &lt;a href="http://msdn2.microsoft.com/en-us/architecture/aa699384.aspx"&gt;Software + Services&lt;/a&gt;?&amp;#160; Ever wonder, &amp;#8220;Where&amp;#8217;s the software?&amp;#8221;&lt;/p&gt;  &lt;p&gt;You might have noticed that on the &lt;a href="https://www.mesh.com/Web/Devices.aspx"&gt;device ring&lt;/a&gt; there&amp;#8217;s a big orange button with a white &amp;#8216;+&amp;#8217; sign.&amp;#160; The magic happens when you click that big orange button and opt to &amp;#8220;add a device&amp;#8221; to your mesh.&amp;#160; Click &amp;#8220;Install&amp;#8221; and you&amp;#8217;ll download and install a very small program onto your machine.&amp;#160; Once set up, you may notice a process called MOE.exe running on your computer.&amp;#160; What exactly is MOE?&lt;/p&gt;  &lt;p&gt;&lt;b&gt;MOE: Mesh Operating Environment&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;MOE is an acronym for the &amp;#8220;Mesh Operating Environment.&amp;#8221;&amp;#160; MOE is a service composition runtime that provides a unified view of all Live Mesh services and a simple way for applications to interact with Live Mesh.&amp;#160; MOE is everywhere&amp;#8212;it&amp;#8217;s on all devices in your mesh (as &amp;#8220;client MOE&amp;#8221;), and it&amp;#8217;s in the cloud (&amp;#8220;cloud MOE&amp;#8221;).&amp;#160; The two are quite similar; they provide a symmetrical and consistent programming model between client and cloud.&amp;#160; If you&amp;#8217;re a developer, you&amp;#8217;ll be able to take advantage of these flexible points of entry&amp;#160; to Live Mesh in the way that&amp;#8217;s most natural for you.&lt;/p&gt;  &lt;p&gt;That&amp;#8217;s a lot to digest.&amp;#160; I won&amp;#8217;t go into the developer story today; you&amp;#8217;ll see more of that in the months ahead.&amp;#160; For the purposes of this post, I&amp;#8217;ll only focus on client MOE.&amp;#160; Client MOE is at the heart of every device connected to your mesh, be it your PC or Mac or mobile.&lt;/p&gt;  &lt;p&gt;The goals for client MOE are simple.&amp;#160; Here are some of them:&lt;/p&gt;  &lt;p&gt;&amp;#183; To allow seamless access to a user&amp;#8217;s mesh and all the data in it;&lt;/p&gt;  &lt;p&gt;&amp;#183; To abstract away common functionality, like synchronization protocols;&lt;/p&gt;  &lt;p&gt;&amp;#183; To allow existing applications to participate in a user&amp;#8217;s mesh, by optionally leveraging the local file system;&lt;/p&gt;  &lt;p&gt;&amp;#183; To provide a seamless online/offline experience (also known as &amp;#8220;occasionally connected&amp;#8221;) by synchronizing and caching metadata from the cloud;&lt;/p&gt;  &lt;p&gt;&amp;#183; To update seamlessly, providing new features and fixes in the platform; and&lt;/p&gt;  &lt;p&gt;&amp;#183; To use minimal system resources, running in the background all the time.&lt;/p&gt;  &lt;p&gt;You&amp;#8217;ll notice that the idea of &amp;#8220;seamlessness&amp;#8221; really runs through these tenets.&amp;#160; Obviously, since what we just released is a &amp;#8220;Tech Preview,&amp;#8221; we have only just started towards achieving these goals today.&amp;#160; Rest assured that we will get better!&lt;/p&gt;  &lt;p&gt;Let me elaborate on a couple of these points.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Online vs. Offline&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;In today&amp;#8217;s world, many applications just don&amp;#8217;t work if they&amp;#8217;re not connected to the Internet.&amp;#160; It&amp;#8217;s much easier to write programs that assume connectivity to a service, than not.&amp;#160; But why should it be so hard?&amp;#160; MOE abstracts all this behavior for you.&amp;#160; It caches the metadata that&amp;#8217;s in your mesh and automatically synchronizes it, so that talking to MOE is essentially like talking to the cloud.&amp;#160; And talking to MOE will always work, regardless of whether or not you have Internet connectivity.&amp;#160; MOE will do the heavy lifting for you by synchronizing changes you&amp;#8217;ve made locally, whether you are online or offline, with your mesh (when you have internet connectivity).&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Today&amp;#8217;s Applications&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;As high as our hopes are for Live Mesh, we realize that there isn&amp;#8217;t anything today that fully showcases the true power and potential of the mesh yet.&amp;#160; This is one of the reasons we&amp;#8217;ve built simple file synchronization capability as a rich experience on top of MOE.&amp;#160; This way, any existing application that writes files to disk (virtually all applications) will suddenly be able to leverage Live Mesh, without *any* changes to the application.&lt;/p&gt;  &lt;p&gt;For example, say you use &lt;a href="http://writer.live.com/"&gt;Windows Live Writer&lt;/a&gt; to collaboratively write blog posts, but it often takes several iterations before posting.&amp;#160; You can now save your blog drafts into a Live Mesh folder, and suddenly those drafts are everywhere&amp;#8212;on each of your devices and those with whom you share the folder.&amp;#160; An idea for a post pops into your head on the bus ride to work?&amp;#160; Start a post on the bus, add content to it at work, have others read it over and revise it on their own devices, add your final touches, and post at home that very evening!&amp;#160; All without even thinking about e-mailing attachments back and forth.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Working on Live Mesh&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;I&amp;#8217;ve been working on Live Mesh for over two years now.&amp;#160; Prior to this I was a developer on the &lt;a href="messenger.live.com"&gt;Windows Live Messenger&lt;/a&gt; service.&amp;#160; When I first started on Live Mesh, I thought it would be a piece of cake.&amp;#160; After working on huge scalable services that support millions of users, how hard could writing a little lightweight client be?&amp;#160; It turns out that it&amp;#8217;s quite hard.&amp;#160; Synchronization may appear to be an easy problem (and in fact, there are a ton of apps out there that do simple file sync already), but it&amp;#8217;s actually really tough to solve it in a *generic* fashion so that other applications can be built on top of it.&amp;#160; That&amp;#8217;s what we&amp;#8217;ve strived for.&amp;#160; (We&amp;#8217;ll have a future post on how Live Mesh uses &lt;a href="http://dev.live.com/feedsync/"&gt;FeedSync&lt;/a&gt; underneath the covers, and what types of extensibility and other advantages that provides.&amp;#160; Stay tuned!)&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Here, There, Everywhere&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Live Mesh is about to become your new best friend.&amp;#160; The one you can&amp;#8217;t live without and is always in the background to take care of things for you.&lt;/p&gt;  &lt;p&gt;So what are you waiting for?&amp;#160; &lt;a href="https://www.mesh.com/Web/Devices.aspx"&gt;Download&lt;/a&gt; and install Live Mesh on all your devices today!&amp;#160; You&amp;#8217;re missing out if you don&amp;#8217;t.&amp;#160; And be sure to &lt;a href="https://feedback.live.com/default.aspx?productkey=livemesh&amp;amp;mkt=en-us"&gt;give us feedback&lt;/a&gt; and &lt;a href="http://forums.community.microsoft.com/en/LiveMesh/threads"&gt;report any issues&lt;/a&gt; you see!&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:5b468bb2-9e41-45f4-98b4-581011e82861" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/LiveMesh" rel="tag"&gt;LiveMesh&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8482484" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/livemesh/archive/tags/Behind+Live+Mesh/default.aspx">Behind Live Mesh</category></item><item><title>Behind Live Mesh: Live Desktop architecture</title><link>http://blogs.msdn.com/livemesh/archive/2008/05/05/behind-live-mesh-live-desktop-architecture.aspx</link><pubDate>Mon, 05 May 2008 20:17:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8460958</guid><dc:creator>Live Mesh Team</dc:creator><slash:comments>12</slash:comments><comments>http://blogs.msdn.com/livemesh/comments/8460958.aspx</comments><wfw:commentRss>http://blogs.msdn.com/livemesh/commentrss.aspx?PostID=8460958</wfw:commentRss><description>&lt;P&gt;As the unveiling of Live Mesh is a tech preview of the platform, similarly the Live Desktop release is only a glimpse into what will be available via the web portal. The promise is a rich cross-browser web experience that requires no installations, but will offer an enhanced look-and-feel if plugins are installed. I'd like to take a moment to describe the architecture of this Live Mesh platform experience and illustrate how the design will enable it to grow into a much richer experience. Let me warn you that this is intended to be a detailed developer-focused post. The key architectural features are the &lt;STRONG&gt;generic presentation framework&lt;/STRONG&gt;; Live Mesh &lt;STRONG&gt;communication layer&lt;/STRONG&gt;; Live Desktop &lt;STRONG&gt;windowing system&lt;/STRONG&gt;; and &lt;STRONG&gt;C# to JavaScript compilation with Script#&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;The &lt;STRONG&gt;generic presentation framework&lt;/STRONG&gt; can be easily reused and extended to rapidly create performant data-driven applications. Its design resembles that of &lt;A href="http://msdn2.microsoft.com/en-us/netframework/aa663321.aspx" mce_href="http://msdn2.microsoft.com/en-us/netframework/aa663321.aspx"&gt;Windows Presentation Foundation&lt;/A&gt; in that there exist two clearly separated trees, one logical and one visual. In addition to being a natural separation for JavaScript and HTML, this has made code reuse and the addition of new features significantly faster and more seamless as logical controls can be customized with different styles for different UI components. The notable base classes in the logical tree are the UIElement and UIGroup.&lt;/P&gt;
&lt;P&gt;The UIElement is the base class and has a one-to-one relationship with a DOM Element, handles input events, supports command routing, and participates in databinding. The UIElement performs memory management by removing its associated visual element from the DOM and detaching its event listeners when disposed. Command routing offers a convenient way of bubbling events through the logical tree to notify parent containers that an event has occurred. Databinding offers a very flexible way to present data as a UIElement may listen for specific property change events and update its associated visual element when these occur. In our framework, Binding objects are reusable and are composed of a source data property, a target UIElement, and a Converter which contains the logic for rendering data.&lt;/P&gt;
&lt;P&gt;The UIGroup is a collection of UIElements and is the base class of all elements that participate in the rendering pass by the layout host. For expensive rendering events that involve more than small DOM manipulations, the UI Group will be added to the queue of items to be rendered and then its OnRender method will be called to perform the visual changes. It is worth mentioning the ItemsControl, which derives from UIGroup and represents a collection of data. The ItemsControl is instantiated with a shared visual template that is applied to render each item.&lt;/P&gt;
&lt;P&gt;The visual styles are defined in resource dictionaries, which are reusable html string snippets sent down in JavaScript files. DOM elements are instantiated from these strings, keyed by id. This offers performance benefits as each snippet is sent over the wire exactly once and cached by the browser. &lt;/P&gt;
&lt;P&gt;Let's look at a short example of how this framework is used to render the Icon View of files within a folder explorer on the Live Desktop. The files are represented by a ListBox, which derives from ItemsControl and extends it by maintaining a selected item. The style for the visual template for each item is defined in the resource dictionary as:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;div id=""$spaceIconItem""&amp;gt; 
    &amp;lt;img id=""iconItemImg"" /&amp;gt; 
    &amp;lt;div id=""folderViewNameCellLabel""&amp;gt;&amp;lt;/div&amp;gt; 
&amp;lt;/div&amp;gt;&lt;/PRE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The image represents an icon specific to mime type and the label represents the name of that file. When the visual template is executed to render an individual item, it sets up databinding for each of these DOM Elements:&lt;/P&gt;&lt;PRE&gt;image.SetBinding( 
   "Src",  CommonBindings.MimeTypeToMediumIconOneTimeOneWay); 
label.SetBinding( 
   "Text", CommonBindings.NameOneWay);&lt;/PRE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The image source databinding will be executed only once, and will set the src property of the img to be that of the appropriate icon url. The label text will be updated whenever the name of the file changes and will modify the InnerText of the div. The ListBox will be added to the rendering queue of the layout host whenever the collection of files changes, for example by navigating into a new folder, and will instantiate each of its DOM children by invoking the above visual template.&lt;/P&gt;
&lt;P&gt;For completeness in discussing the presentation framework, it is important to note that each collection of data in memory is stored in an ObservableCollection, which maintains a list of items and fires unique change events when items are added, items are removed, or the entire collection changes. This enables an ItemsControl to intelligently decide whether to render an individual data item or the entire collection.&lt;/P&gt;
&lt;P&gt;The Live Mesh &lt;STRONG&gt;communication layer&lt;/STRONG&gt; updates the ObservableCollections by performing incremental data requests on corresponding data feeds on a recurring interval. This layer also performs the http operations that result from user actions. It maintains a queue of operations and associated callbacks. It understands the Live Mesh cloud API and provides a layer of abstraction between app-specific transactions and the semantics of the Live Mesh platform. &lt;/P&gt;
&lt;P&gt;With all of the above infrastructure in place, it was straightforward to build a &lt;STRONG&gt;windowing system&lt;/STRONG&gt; into the Live Desktop. The list of windows is maintained as an ObservableCollection. There are three different templates applied to render each window depending on whether it is in the taskbar, on the desktop, or in the window toggle control (shift+tab to see this view). Activating a window simply means setting the ActiveWindow property true, as the css class of the DOM Element is bound to that property. Opening or closing a window will fire a granular change event from the ObservableCollection that the ItemsControl listens for and will respond to by adding or removing the individual item from view.&lt;/P&gt;
&lt;P&gt;The architectural complexity and heavy usage of inheritance described above were greatly facilitated by &lt;STRONG&gt;&lt;A href="http://projects.nikhilk.net/ScriptSharp/Default.aspx" mce_href="http://projects.nikhilk.net/ScriptSharp/Default.aspx"&gt;Script#&lt;/A&gt;&lt;/STRONG&gt;, &lt;STRONG&gt;a C# to JavaScript compiler&lt;/STRONG&gt; developed by &lt;A href="http://www.nikhilk.net/" mce_href="http://www.nikhilk.net/"&gt;Nikhil Kothari&lt;/A&gt;. The strong IDE support from Visual Studio and compile-time syntax checking that this offers have been crucial as the Live Desktop codebase has grown.&lt;/P&gt;
&lt;P&gt;What all this means is that the foundation has been laid to add many more exciting features to your Live Desktop. When you view it today, you should see a visually appealing view of a desktop that works well cross-browser, performs responsively once loaded (and will soon load faster), and enables you to traverse your cloud. You might also think to yourself "I wish I could upload more than one file at once" or "I wish this SilverLight media view wasn't one-size fits all and only worked on a subset of my data". The good news is that these features and many more are planned and that the Live Desktop architecture will facilitate adding these new components rapidly. While we have a clear set of features that we think will make this offering more compelling, we are eager to hear ideas from you.&lt;/P&gt;
&lt;P&gt;- Alex Himel, developer for Live Desktop&lt;/P&gt;
&lt;DIV class=wlWriterSmartContent id=scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e3876a58-0212-47e8-ba7a-9635faef76f3 style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;Technorati Tags: &lt;A href="http://technorati.com/tags/LiveMesh" rel=tag mce_href="http://technorati.com/tags/LiveMesh"&gt;LiveMesh&lt;/A&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8460958" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/livemesh/archive/tags/Behind+Live+Mesh/default.aspx">Behind Live Mesh</category></item><item><title>Behind Live Mesh: How we run cloud services</title><link>http://blogs.msdn.com/livemesh/archive/2008/04/30/behind-live-mesh-how-we-run-cloud-services.aspx</link><pubDate>Wed, 30 Apr 2008 11:11:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8443835</guid><dc:creator>Live Mesh Team</dc:creator><slash:comments>10</slash:comments><comments>http://blogs.msdn.com/livemesh/comments/8443835.aspx</comments><wfw:commentRss>http://blogs.msdn.com/livemesh/commentrss.aspx?PostID=8443835</wfw:commentRss><description>&lt;P&gt;A quick self-introduction: I’m Alex Mallet, one of the development leads on the Live Mesh project. I’ve been at Microsoft since ’97, except for an abortive [but instructive] side trip to graduate school in an attempt to get a PhD in computational biology. Just about all of my time has been spent working on distributed systems, of gradually increasing scale – I started out working on IIS, moved to &lt;A href="http://technet.microsoft.com/en-us/appcenter/default.aspx" mce_href="http://technet.microsoft.com/en-us/appcenter/default.aspx"&gt;Application Center 2000&lt;/A&gt;, worked on our &lt;A href="http://msdn2.microsoft.com/en-us/library/aa816481(VS.85).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/aa816481(VS.85).aspx"&gt;P2P API toolkit&lt;/A&gt; and finally ended up on the Live Mesh team about a year and a half ago.&amp;nbsp; On Live Mesh, my team and I are responsible for making sure our datacenter services are easy to deploy and manage, and for providing common functionality needed by our cloud services. So, on the heels of the previous blog posts that have introduced the “big picture” view, I thought I’d give you a bit more insight into some of the details of the “services” part of “Software + Services”, by talking about our services that run in the cloud. &lt;/P&gt;
&lt;P&gt;Our general philosophy when building our cloud services was to adhere to the tenets of &lt;A href="http://roc.cs.berkeley.edu/roc_overview.html" mce_href="http://roc.cs.berkeley.edu/roc_overview.html"&gt;Recovery-Oriented Computing&lt;/A&gt; (ROC): programs will crash, hardware will fail, and they will do so regularly, so your system should be prepared to deal with these failures. While it’s easy to espouse these principles in theory, the obvious next question is how to turn them into practice, and here we were aided by a great “best practices” survey paper written by &lt;A href="http://www.mvdirona.com/jrh/work/" mce_href="http://www.mvdirona.com/jrh/work/"&gt;James Hamilton&lt;/A&gt;, namely &lt;A href="http://www.mvdirona.com/jrh/TalksAndPapers/JamesRH_Lisa.pdf" mce_href="http://www.mvdirona.com/jrh/TalksAndPapers/JamesRH_Lisa.pdf"&gt;“On Designing and Deploying Internet-Scale Services”&lt;/A&gt;.&amp;nbsp; I won’t claim that we managed to do everything that’s in his paper [we’re only at the Tech Preview stage, after all &lt;SPAN style="FONT-FAMILY: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;FONT size=3&gt;J&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;], but I think we’ve done a decent job so far, and are heading in the right direction overall. &lt;/P&gt;
&lt;P&gt;Enough philosophy, on to some more detail. &lt;/P&gt;
&lt;P&gt;From a functionality perspective, our cloud services can be grouped into four buckets: dealing with feed and data synchronization, providing authentication and authorization, maintaining and fanning out the system’s transient state [like the various notifications provided in the Live Mesh Bar], and the connectivity services for synchronization and remote desktop access to work across any network topology. Sliced along the “state” axis, we have stateless front-end services, back-end services that maintain in-memory state, and persistent storage layers that handle both structured and unstructured data. From a scaling perspective, our plan is to scale out, not up. Thus, we’ve invested in making sure that we have as many stateless services as possible, as well as having facilities that allow us to partition our state [both persistent and transient] across multiple machines, and reconfigure these partitions as necessary. Overall, we have close to 20 different services, with each service consisting of multiple, redundant instances of a particular bit of code, striped across several racks of machines in the datacenter – in keeping with the ROC assumptions, our goal is to be resilient to multiple hardware and software failures.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Our front-end services are accessible [only] via HTTPS – all of the traffic that flows in and out of our system is encrypted. Our back-end services use a mixture of HTTPS and custom protocols layered on top of TCP. The vast majority of the services are written in C#, with the only exceptions being services that needed deep integration with Windows functionality that isn’t [easily] accessible to an application written in managed code. &lt;/P&gt;
&lt;P&gt;All of our services sit on top of a runtime library that contains facilities commonly needed by each service: process lifetime management, HTTP and TCP listeners, a debug logging facility, a work queue facility, APIs to generate monitoring data like performance counters, etc. This common runtime also contains debugging, testing and monitoring hooks; for example, we have the ability to inject random delays and failures into our HTTP pipeline, which allows us to test our failure monitors and the overall response of the system to slow and failing services. &lt;/P&gt;
&lt;P&gt;Building a full-scale datacenter deployment and management system is a huge undertaking, so we chose the &lt;S&gt;lazy&lt;/S&gt; smart route and went with an existing, battle-tested system, namely &lt;A href="http://research.microsoft.com/users/misard/abstracts/osr2007.html" mce_href="http://research.microsoft.com/users/misard/abstracts/osr2007.html"&gt;the Autopilot framework&lt;/A&gt;, which was developed, and is being used, by the Windows Live Search team to manage their tens of thousands of datacenter machines [we’re not at that scale yet, but we hope to be, with your help &lt;SPAN style="FONT-FAMILY: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;FONT size=3&gt;J&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;]. We use Autopilot to manage our code and data deployments, for [some of our] failure monitoring and self-healing, and to give us insight into the current state of our datacenter machines and services. &lt;/P&gt;
&lt;P&gt;On the monitoring front, we actually monitor the system at several levels – via simple Autopilot-style watchdogs, with more extensive tests called “runners”, by hitting our service from various points outside our datacenter, and also using a variety of tools that scan our logs for error messages, highlight machines that appear to be having problems, look for crashing services etc. Of course, all these monitors are still somewhat untested – I’m sure we’ll be making lots of tweaks, and adding new tools over the coming weeks and months as we start having to troubleshoot and keep a real live system up and running. &lt;SPAN style="FONT-FAMILY: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;FONT size=3&gt;J&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Ok, I think that’s enough for one post. If this is a topic of interest to you, and you’d like more detail on some of the stuff I’ve talked about, please leave suggestions and questions in the comments, and I’ll address them in follow-up posts. &lt;/P&gt;
&lt;P&gt;And, of course, don’t forget to &lt;A href="http://www.mesh.com/" mce_href="http://www.mesh.com/"&gt;sign up for Live Mesh&lt;/A&gt; and give us feedback !&lt;/P&gt;
&lt;DIV class=wlWriterSmartContent id=scid:0767317B-992E-4b12-91E0-4F059A8CECA8:f23b917e-cb8c-45a0-8e65-54109f1d1098 style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;Technorati Tags: &lt;A href="http://technorati.com/tags/LiveMesh" rel=tag mce_href="http://technorati.com/tags/LiveMesh"&gt;LiveMesh&lt;/A&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8443835" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/livemesh/archive/tags/Behind+Live+Mesh/default.aspx">Behind Live Mesh</category></item></channel></rss>