{"id":4081,"date":"2016-02-09T19:06:44","date_gmt":"2016-02-09T19:06:44","guid":{"rendered":"http:\/\/www.odbms.org\/blog\/?p=4081"},"modified":"2016-02-09T19:06:44","modified_gmt":"2016-02-09T19:06:44","slug":"orleans-the-technology-behind-xbox-halo4-and-halo5-interview-with-phil-bernstein","status":"publish","type":"post","link":"https:\/\/www.odbms.org\/blog\/2016\/02\/orleans-the-technology-behind-xbox-halo4-and-halo5-interview-with-phil-bernstein\/","title":{"rendered":"Orleans, the technology behind Xbox Halo4 and Halo5. Interview with Phil Bernstein"},"content":{"rendered":"<blockquote><p><strong>&#8220;Orleans\u00a0is an\u00a0open-source\u00a0programming framework for .NET that simplifies the development of distributed applications, that is, ones that run on many servers in a datacenter.&#8221;&#8211; Phil Bernstein.<\/strong><\/p><\/blockquote>\n<p>I have interviewed,\u00a0<strong>Phil Bernstein,<\/strong>a well\u00a0known data base researcher\u00a0and Distinguished Scientist at\u00a0<a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/research.microsoft.com\/en-us\/default.aspx');\"  href=\"http:\/\/research.microsoft.com\/en-us\/default.aspx\">Microsoft Research<\/a>, where he has worked for over 20 years. We discussed his latest project\u00a0&#8220;Orleans&#8221;.<\/p>\n<p>RVZ<\/p>\n<p><strong>Q1. With the\u00a0project &#8220;Orleans&#8221; you and your team invented the &#8220;Virtual Actor abstraction&#8221;. What is it?\u00a0<\/strong><\/p>\n<p><strong>Phil Bernstein:\u00a0<\/strong><a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/research.microsoft.com\/en-us\/projects\/orleans\/');\"  href=\"http:\/\/research.microsoft.com\/en-us\/projects\/orleans\/\">Orleans<\/a> is an <a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/github.com\/dotnet\/orleans');\"  href=\"https:\/\/github.com\/dotnet\/orleans\">open-source<\/a> programming framework for .NET that simplifies the development of distributed applications, that is, ones that run on many servers in a datacenter. In Orleans, objects are actors, by which we mean that they don\u2019t share memory.<\/p>\n<p>In Orleans, actors are virtual in the same sense as virtual memory: an object is activated on demand, i.e. when one of its methods is invoked. If an object is already active when it\u2019s invoked, the Orleans runtime will use its object directory to find the object and invoke it. If the runtime determines that the object isn\u2019t active, the runtime will choose a server on which to activate the object, invoke the object\u2019s constructor on that server to load its state, invoke the method, and update the object directory so it can direct future calls to the object.<\/p>\n<p>Conversely, an object is deactivated when it hasn\u2019t been invoked for some time. In that case, the runtime calls the object\u2019s deactivate method, which does whatever cleanup is needed before freeing up the object\u2019s runtime resources.<\/p>\n<p><strong>Q2. How is it possible to\u00a0build distributed interactive\u00a0applications, without the need to learn complex programming\u00a0patterns?\u00a0<\/strong><\/p>\n<p><strong>Phil Bernstein: \u00a0<\/strong>The virtual actor model hides distribution from the developer. You write code as if your program runs on one machine. The Orleans runtime is responsible for distributing objects across servers, which is something that doesn\u2019t affect the program logic. Of course, there are performance and fault tolerance implications of distribution.<br \/>\nBut Orleans is able to hide them too.<\/p>\n<p><strong>Q3. Building interactive services that are scalable and reliable is hard.\u00a0How do you ensure that\u00a0Orleans applications scale-up and are reliable?<\/strong><\/p>\n<p><strong>Phil Bernstein: \u00a0<\/strong>The biggest impediment to scaling out an app across servers is to ensure no server is a bottleneck. Orleans does this by evenly distributing the objects across servers. This automatically balances the load.<\/p>\n<p>As for reliability, the virtual actor model makes this automatic. If a server fails, then of course all of the objects that were active on that server are gone. No problem. The Orleans runtime detects the server failure and knows which objects were active on the failed server. So the next time any of those objects is invoked, it takes its usual course of action, that is, it chooses a server on which to activate the object, loads the object, and invokes it.<\/p>\n<p><strong>Q4. What about the object\u2019s state? Doesn\u2019t that disappear when its server fails?<\/strong><\/p>\n<p><strong>Phil Bernstein: \u00a0<\/strong>Yes, of course all of the object\u2019s main memory state is lost. It\u2019s up to the object\u2019s methods to save object state persistently, typically just before returning from a method that modifies the object\u2019s state.<\/p>\n<p><strong>Q5. Is this transactional?<\/strong><\/p>\n<p><strong>Phil Bernstein: \u00a0<\/strong>No, not yet. We\u2019re working on adding a transaction mechanism. Coming soon.<\/p>\n<p><strong>Q6. Can you give us an example of an\u00a0Orleans application?<\/strong><\/p>\n<p><strong>Phil Bernstein: \u00a0<\/strong>Orleans is used for developing large-scale on-line games. For example, all of the cloud services for <a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/en.wikipedia.org\/wiki\/Halo_4');\"  href=\"https:\/\/en.wikipedia.org\/wiki\/Halo_4\" target=\"_blank\">Halo 4<\/a> and <a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/en.wikipedia.org\/wiki\/Halo_5:_Guardians');\"  href=\"https:\/\/en.wikipedia.org\/wiki\/Halo_5:_Guardians\" target=\"_blank\">Halo 5<\/a>, the popular <a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/en.wikipedia.org\/wiki\/List_of_Xbox_360_games');\"  href=\"https:\/\/en.wikipedia.org\/wiki\/List_of_Xbox_360_games\" target=\"_blank\">Xbox games<\/a>, run on Orleans. Example object types are players, game consoles, game instances, weapons caches, and leaderboards. Orleans is also used for <a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/en.wikipedia.org\/wiki\/Internet_of_Things');\"  href=\"https:\/\/en.wikipedia.org\/wiki\/Internet_of_Things\" target=\"_blank\">Internet of Things<\/a>, communications, and <a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/en.wikipedia.org\/wiki\/Telemetry');\"  href=\"https:\/\/en.wikipedia.org\/wiki\/Telemetry\" target=\"_blank\">telemetry<\/a> applications. All of these applications are naturally actor-oriented, so they fit well with the Orleans programming model.<\/p>\n<p><strong>Q7. Why does the traditional three-tier architecture with stateless front-ends, stateless middle tier and a storage layer have limited scalability?\u00a0<\/strong><\/p>\n<p><strong>Phil Bernstein: \u00a0<\/strong>The usual bottleneck is the storage layer. To solve this, developers add a middle tier to cache some state and thereby reduce the storage load. However, this middle tier loses the concurrency control semantics of storage, and now you have the hard problem of distributed cache invalidation. To enforce storage semantics, Orleans makes it trivial to express cached items as objects. And to avoid concurrency control problems, it routes requests to a single instance of each object, which is ordinarily single-threaded.<\/p>\n<p>Also, a middle-tier cache does data shipping to the storage servers, which can be inefficient. With Orleans, you have an object-oriented cache and do function shipping instead.<\/p>\n<p><strong>Q8. How does Orleans differ from other\u00a0Actor platforms such as Erlang and Akka?\u00a0<\/strong><\/p>\n<p><strong>Phil Bernstein:\u00a0<\/strong>In <a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/en.wikipedia.org\/wiki\/Erlang_(programming_language)');\"  href=\"https:\/\/en.wikipedia.org\/wiki\/Erlang_(programming_language)\" target=\"_blank\">Erlang<\/a> and <a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/en.wikipedia.org\/wiki\/Akka_(toolkit)');\"  href=\"https:\/\/en.wikipedia.org\/wiki\/Akka_(toolkit)\" target=\"_blank\">Akka<\/a>, the developer controls actor lifecycle. You explicitly create an actor and choose the server on which it\u2019s activated. Fixing the actor\u2019s location at creation time prevents automating load balancing, actor migration, and server failure handling. For example, if an actor fails, you need code to catch the exception and resurrect the actor on another server. In Orleans, this is all automatic.<\/p>\n<p>Another difference is the communications model. Orleans uses asynchronous RPC\u2019s. Erlang and Akka use one-way messages.<\/p>\n<p><strong>Q9. Database people sometimes focus exclusively on the data model and query language, and don\u2019t consider the problem of writing a scalable application on top of the database. How is Orleans addressing this issue?<\/strong><\/p>\n<p><strong>Phil Bernstein: \u00a0<\/strong>In a database-centric view, an app is a set of stored procedures with a stateless front-end and possibly a middle-tier cache. To scale out the app with this design, you need to partition the database into finer slices every time you want to add servers. By contrast, if your app runs on servers that are separate from the database, as it does with Orleans, you can add servers to scale out the app without scaling out the storage. This is easier, more flexible, and less expensive. For example, you can run with more app servers during the day when there\u2019s heavier usage and fewer servers at night when the workload dies down. This is usually infeasible at the database server layer, since it would require migrating parts of the database twice a day.<\/p>\n<p><strong>Q10. Why did you transfer\u00a0the core Orleans technology to <a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/www.halowaypoint.com\/');\"  href=\"https:\/\/www.halowaypoint.com\/\" target=\"_blank\">343 Industries<\/a> ?<\/strong><\/p>\n<p><strong>Phil Bernstein: \u00a0<\/strong>Orleans was developed in Microsoft Research starting in 2009. Like any research project, after several years of use in production, it was time to move it into a product group, which can better afford the resources to support it. Initially, that was <a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/en.wikipedia.org\/wiki\/343_Industries');\"  href=\"https:\/\/en.wikipedia.org\/wiki\/343_Industries\" target=\"_blank\">343 Industries<\/a>, the biggest Orleans user, which ships the Halo game. After Halo 5 shipped, the Orleans group moved to the parent organization, Microsoft Game Studios, which provides technology to Halo and many other Xbox games.<\/p>\n<p>In Microsoft Research, we are still working on Orleans technology and collaborate closely with the product group. For example, we recently published <a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/github.com\/sebastianburckhardt\/orleans');\"  href=\"https:\/\/github.com\/sebastianburckhardt\/orleans\">code to support geo-distributed applications<\/a> on Orleans, and we\u2019re currently working on adding a transaction mechanism.<\/p>\n<p><strong>Q11.\u00a0The core Orleans technology was\u00a0also made available as open source in January 2015. Are developers actively contributing to this?\u00a0<\/strong><\/p>\n<p><strong>Phil Bernstein:\u00a0<\/strong>Yes, there is a lot of activity, with contributions from developers both inside and outside Microsoft. You can see the numbers on <a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/github.com\/dotnet\/orleans');\"  href=\"https:\/\/github.com\/dotnet\/orleans\" target=\"_blank\">GitHub<\/a> \u2013 roughly 25 active contributors and over 25 more occasional contributors \u2013 with fully-tested releases published every couple of months. After the core .NET runtime and Roslyn compiler projects, Orleans is the next most popular .NET Foundation project on GitHub.<\/p>\n<p><em>\u00a0&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/em><\/p>\n<p><strong><a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/research.microsoft.com\/en-us\/people\/philbe\/');\"  href=\"http:\/\/research.microsoft.com\/en-us\/people\/philbe\/\">Phil Bernstein<\/a> <\/strong><em>is a Distinguished Scientist at <a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/research.microsoft.com\/en-us\/default.aspx');\"  href=\"http:\/\/research.microsoft.com\/en-us\/default.aspx\">Microsoft Research<\/a>, where he has worked for over 20 years. Before Microsoft, he was a product architect and researcher at Digital Equipment Corp. and a professor at Harvard University. He has published over 150 papers and two books on the theory and implementation of database systems, especially on transaction processing and data integration, which are still the major areas of his work. He is an ACM Fellow, a winner of the ACM SIGMOD Innovations Award, a member of the Washington State Academy of Sciences and a member of the U.S. National Academy of Engineering. He received a B.S. degree from Cornell and M.Sc. and Ph.D. from University of Toronto.<\/em><\/p>\n<p><strong>Resources<\/strong><\/p>\n<p><a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/research.microsoft.com\/en-us\/projects\/orleans\/');\"  href=\"http:\/\/research.microsoft.com\/en-us\/projects\/orleans\/\">Microsoft Research homepage for Orleans<\/a><\/p>\n<p><a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/github.com\/dotnet\/orleans');\"  href=\"https:\/\/github.com\/dotnet\/orleans\">Orleans code on GitHub<\/a><\/p>\n<p><a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/dotnet.github.io\/orleans\/What');\"  href=\"http:\/\/dotnet.github.io\/orleans\/What's-new-in-Orleans\">Orleans documentation<\/a><\/p>\n<p><strong>Related Posts<\/strong><\/p>\n<p><a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/www.odbms.org\/blog\/2016\/01\/on-the-industrial-internet-of-things-interview-with-leon-guzenda\/');\"  href=\"http:\/\/www.odbms.org\/blog\/2016\/01\/on-the-industrial-internet-of-things-interview-with-leon-guzenda\/\" target=\"_blank\" rel=\"nofollow\">On the Industrial Internet of Things. Interview with Leon Guzenda<\/a>\u00a0<span class=\"feed-source\">ODBMS Industry Watch,\u00a0<\/span><span class=\"feed-date\">Published on 2016-01-28<\/span><\/p>\n<p><a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/www.odbms.org\/blog\/2015\/10\/challenges-and-opportunities-of-the-internet-of-things-interview-with-steve-cellini\/');\"  href=\"http:\/\/www.odbms.org\/blog\/2015\/10\/challenges-and-opportunities-of-the-internet-of-things-interview-with-steve-cellini\/\" target=\"_blank\" rel=\"nofollow\">Challenges and Opportunities of The Internet of Things. Interview with Steve Cellini<\/a>\u00a0<span class=\"feed-source\">ODBMS Industry Watch,\u00a0<\/span><span class=\"feed-date\">Published on 2015-10-07<\/span><\/p>\n<p><strong>Follow ODBMS.org on Twitter: <a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/twitter.com\/odbmsorg');\"  href=\"https:\/\/twitter.com\/odbmsorg\" target=\"_blank\">@odbmsorg<\/a><\/strong><\/p>\n<p>##<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>&#8220;Orleans\u00a0is an\u00a0open-source\u00a0programming framework for .NET that simplifies the development of distributed applications, that is, ones that run on many servers in a datacenter.&#8221;&#8211; Phil Bernstein. I have interviewed,\u00a0Phil Bernstein,a well\u00a0known data base researcher\u00a0and Distinguished Scientist at\u00a0Microsoft Research, where he has worked for over 20 years. We discussed his latest project\u00a0&#8220;Orleans&#8221;. RVZ Q1. With the\u00a0project &#8220;Orleans&#8221; [&hellip;]<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[3,898,897,858,181,891,899,895,896,893,446,892,890,894],"_links":{"self":[{"href":"https:\/\/www.odbms.org\/blog\/wp-json\/wp\/v2\/posts\/4081"}],"collection":[{"href":"https:\/\/www.odbms.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.odbms.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.odbms.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.odbms.org\/blog\/wp-json\/wp\/v2\/comments?post=4081"}],"version-history":[{"count":4,"href":"https:\/\/www.odbms.org\/blog\/wp-json\/wp\/v2\/posts\/4081\/revisions"}],"predecessor-version":[{"id":4085,"href":"https:\/\/www.odbms.org\/blog\/wp-json\/wp\/v2\/posts\/4081\/revisions\/4085"}],"wp:attachment":[{"href":"https:\/\/www.odbms.org\/blog\/wp-json\/wp\/v2\/media?parent=4081"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.odbms.org\/blog\/wp-json\/wp\/v2\/categories?post=4081"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.odbms.org\/blog\/wp-json\/wp\/v2\/tags?post=4081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}