{"id":1662,"date":"2018-06-29T17:39:31","date_gmt":"2018-06-29T21:39:31","guid":{"rendered":"https:\/\/blogs.mathworks.com\/developer\/?p=1662"},"modified":"2018-07-09T13:38:27","modified_gmt":"2018-07-09T17:38:27","slug":"on-cloud-reference-architectures","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/developer\/2018\/06\/29\/on-cloud-reference-architectures\/","title":{"rendered":"Running MATLAB in the Cloud with Reference Architectures"},"content":{"rendered":"<div class=\"content\"><!--introduction--><p>The incredible growth and adoption of cloud based services make it an exciting time to be working at MathWorks with its rich history of technology to supercharge scientific computing workflows.<\/p>\r\n\r\n<p>The scale and power of the public and private cloud offerings make it amenable to tackle increasingly large computation and simulation workloads while vastly simplifying the operational aspects of doing so. As MathWorks users are discovering the many benefits of leveraging the cloud, we strive to support their needs and enable their success.<\/p>\r\n\r\n<p>For starters, I have seen incredible advances in the scale of computation with our products. Our conversations about results are discussed in orders of millions of MATLAB and Simulink simulations. As the scale of these systems explode, it is also remarkable to note the shrinkage of the time to run these huge simulation workloads - often in the orders of hours, minutes and seconds when running the appropriate stack of tools.<\/p>\r\n\r\n<p>This summer, MathWorks introduced a one-stop landing page to address these use-cases and you can find it at <a href=\"https:\/\/www.mathworks.com\/cloud.html\" rel=\"noopener\" target=\"_blank\">https:\/\/www.mathworks.com\/cloud.html<\/a>. The full spectrum of our evolving support for cloud services can be found there. This support takes the form of the MathWorks Cloud as well as our support for the Public Cloud environments like Amazon Web Services (AWS), Microsoft Azure and other cloud systems.<\/p>\r\n\r\n<p>Taking it further, MathWorks has released a set of reference architectures to support workflows ranging from prototyping in MATLAB, to full production quality stacks that can be provisioned on the cloud allowing our users to put their MATLAB models into production within their systems.<\/p>\r\n<!--\/introduction-->\r\n\r\n<p><b>Reference architectures<\/b><\/p>\r\n<p>The term reference architecture refers to a template solution detailing an architecture that involves our products composed in a configuration that adheres to current best practices.  Given the wide variety of use-cases and scenarios that it attempts to address, it is intended to be used as a guideline, often in conjunction with various other building blocks of a complete solution. With these reference architectures, it is easy to get up-and-running with MATLAB by automating many of the steps in provisioning and configuring cloud infrastructure.<\/p>\r\n\r\n<p>I have blogged in the past about our approach to being <a href=\"https:\/\/blogs.mathworks.com\/developer\/2015\/12\/18\/open-and-extensible\/\" rel=\"noopener\" target=\"_blank\">open and extensible<\/a>. These architectures are no exception and have been released on <a href=\"https:\/\/github.com\/\" rel=\"noopener\" target=\"_blank\">github.com<\/a> to allow full transparency into how they work and what they do - allowing users to use them standalone or fork and tailor to their needs. You can find them at:<a href=\"https:\/\/github.com\/mathworks-ref-arch\" rel=\"noopener\" target=\"_blank\">https:\/\/github.com\/mathworks-ref-arch<\/a><\/p>\r\n\r\n<p>Reference architectures themselves can be defined at various levels of abstraction, so let us take a closer look at a small sample of these templates.<\/p>\r\n\r\n<p><b>MATLAB&#174;<\/b><\/p>\r\n<p>Templates for our flagship product, MATLAB, can be found for AWS and Azure. For the purposes of the rest of this post, I will use the terminology for AWS and Azure alternatingly to be fair to our users on these systems. (eg: cloud formation templates on AWS and Azure resource manager templates - aka ARM templates).<\/p>\r\n\r\n<p>You can find the template for MATLAB on Amazon Web Services at: <a href=\"https:\/\/github.com\/mathworks-ref-arch\/matlab-on-aws\" rel=\"noopener\" target=\"_blank\">https:\/\/github.com\/mathworks-ref-arch\/matlab-on-aws<\/a> and MATLAB on Microsoft Azure at: <a href=\"https:\/\/github.com\/mathworks-ref-arch\/matlab-on-azure\" rel=\"noopener\" target=\"_blank\">https:\/\/github.com\/mathworks-ref-arch\/matlab-on-azure<\/a><\/p>\r\n\r\n<p>This reference architecture provisions a MATLAB instance in a VM running on the cloud and sets up the network and security required to access it. In pictures, this looks like:<\/p>\r\n\r\n<p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"http:\/\/blogs.mathworks.com\/developer\/files\/aws-matlab-diagram.png\" alt=\"\"><\/p>\r\n\r\n<p>If you are signed in to a valid cloud account, you can launch these stacks with no more than a few clicks.<\/p>\r\n\r\n<p>Users can connect to the provisioned instance via remote desktop clients or if necessary via clientless access methods like <a href=\"http:\/\/novnc.com\/info.html\" rel=\"noopener\" target=\"_blank\">noVNC<\/a> or <a href=\"https:\/\/guacamole.apache.org\/\" rel=\"noopener\" target=\"_blank\">Apache Guacamole&#8482;<\/a>. All it should take is a click of button and the selection of a few configuration options and Viola! MATLAB R2018a (Linux)... on the cloud.<\/p>\r\n\r\n<p><b>MATLAB Distributed Computing Server&#8482;<\/b><\/p>\r\n<p>A single MATLAB presents our development environment but your problem may be bigger, gnarlier and require a lot more horsepower. The next reference architecture of interest provisions a complete cluster of the MATLAB Distributed Computing Server product. This supports development workflows to scale the computational power of a single MATLAB session and give it more bite when applied to your problem.<\/p>\r\n\r\n<p>In pictures, this looks like: \r\n<a href=\"https:\/\/blogs.mathworks.com\/developer\/files\/Azure_Solution_Scale_Set.png\"><img decoding=\"async\" loading=\"lazy\" width=\"575\" height=\"350\" src=\"https:\/\/blogs.mathworks.com\/developer\/files\/Azure_Solution_Scale_Set.png\" alt=\"\" class=\"alignleft size-full wp-image-1670\" \/><\/a>\r\n<\/p>\r\n\r\n<p>You can find this template for Microsoft Azure at: <a href=\"https:\/\/github.com\/mathworks-ref-arch\/mdcs-on-azure\" rel=\"noopener\" target=\"_blank\">https:\/\/github.com\/mathworks-ref-arch\/mdcs-on-azure<\/a> and for Amazon Web Services at: <a href=\"https:\/\/github.com\/mathworks-ref-arch\/mdcs-on-aws\" rel=\"noopener\" target=\"_blank\">https:\/\/github.com\/mathworks-ref-arch\/mdcs-on-aws<\/a><\/p>\r\n\r\n<p>Using it with your Azure account is as simple as clicking the deploy or launch button which will launch a cluster of our latest product R2018a on a cluster sized to your choosing.<\/p>\r\n\r\n<p><b>MATLAB Production Server&#8482;<\/b><\/p>\r\n<p>Mature workflows in MATLAB allow users to explore their data and develop a model or function. MathWorks Production Server enables developers to serve these models as scalable services that can be called from anywhere.<\/p>\r\n\r\n<p>In pictures, this would look like:<\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"http:\/\/blogs.mathworks.com\/developer\/files\/FinalArchitecture60.png\" alt=\"\"> <\/p>\r\n\r\n<p>Read more about using it on Amazon Web Services at: <a href=\"https:\/\/github.com\/mathworks-ref-arch\/mps-on-aws\" rel=\"noopener\" target=\"_blank\">https:\/\/github.com\/mathworks-ref-arch\/mps-on-aws<\/a> or on Microsoft Azure at: <a href=\"https:\/\/github.com\/mathworks-ref-arch\/mps-on-azure\" rel=\"noopener\" target=\"_blank\">https:\/\/github.com\/mathworks-ref-arch\/mps-on-azure<\/a> <\/p>\r\n\r\n<p>In the past I have blogged about <a href=\"https:\/\/blogs.mathworks.com\/developer\/2016\/07\/13\/build-a-product-build-a-service\/\" rel=\"noopener\" target=\"_blank\">examples<\/a> of taking a MATLAB model quickly from prototype to production without costly inefficiencies. Many of those <a href=\"https:\/\/blogs.mathworks.com\/developer\/2018\/01\/15\/leveraging-cloud-capabilities-from-matlab\/\" rel=\"noopener\" target=\"_blank\">examples<\/a> are powered by such stacks of our software on the cloud. The wider view of this stack is that it enables MATLAB technology to work well with the rest of your solution and scale to meet the demands of the enterprise as needed.<\/p>\r\n\r\n<p><b>Integrate with other solutions<\/b><\/p>\r\n<p>MathWorks products play well both in workflows that are standalone as well as instances where they need to function as a part of a much bigger solution stack. There are other reference architectures for connecting these MathWorks stacks to products like <a href=\"https:\/\/www.mathworks.com\/products\/reference-architectures\/tibco-spotfire.html\" rel=\"noopener\" target=\"_blank\">TIBCO Spotfire&#174;<\/a>. The end objective of all of this is to provide you, the reader, easy access to our products on the Cloud environment of your choice.<\/p>\r\n\r\n<p><b>Putting it all together to build something real<\/b><\/p>\r\n<p>The building blocks above can now be composed into much richer full solutions. For example, below is the architecture of a MathWorks powered analytics platform addressing the needs for both streaming analytics and batch analysis of data coming from a collection of connected cars. There are several ways to build such a system with managed services such as <a href=\"https:\/\/thingspeak.com\/\" rel=\"noopener\" target=\"_blank\">ThingSpeak<\/a> or as services within a custom application specific platform.<\/p>\r\n\r\n<p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"http:\/\/blogs.mathworks.com\/developer\/files\/SampleArchitecture.png\" alt=\"\"> <\/p><p>While the system architecture picture looks complicated, each of the light grey patches on the picture correspond to the reference architectures for MATLAB, MATLAB Distributed Computing Server and MATLAB Production Server discussed above, provisioned on the cloud with a few clicks.<\/p>\r\n\r\n<p>Architectural pictures such as the one above may look strange and puzzling to someone who is seeing it for the first time, but they can be made as easy to develop and launch - as easy as clicking some of the buttons on reference architecture documentation pages.<\/p>\r\n\r\n<p>In conclusion, if you are on the cloud, we've got your back. If you are on the developer side of DevOps practices, the key takeaway is that building these systems to best practices can be easy with proper reference patterns. If the word <a href=\"https:\/\/en.wikipedia.org\/wiki\/DevOps\" rel=\"noopener\" target=\"_blank\">DevOps<\/a> is new to you... well... that is a fertile topic for another day. Please stay tuned!<\/p>\r\n\r\n<script language=\"JavaScript\"> <!-- \r\n    function grabCode_cb1bc9bf81eb4b14a847b5022b7361e0() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='cb1bc9bf81eb4b14a847b5022b7361e0 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' cb1bc9bf81eb4b14a847b5022b7361e0';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        copyright = 'Copyright 2018 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n\r\n        d.title = title + ' (MATLAB code)';\r\n        d.close();\r\n    }   \r\n     --> <\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_cb1bc9bf81eb4b14a847b5022b7361e0()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n      the MATLAB code <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; R2018a<br><\/p><\/div><!--\r\ncb1bc9bf81eb4b14a847b5022b7361e0 ##### SOURCE BEGIN #####\r\n%% \r\n% *Cloud Reference Architectures*\r\n% The incredible growth and adoption of cloud based compute offerings make\r\n% it an exciting time to be working at the MathWorks with its rich history \r\n% of technology to supercharge scientific computing workflows.\r\n% \r\n% The scale and power of the public and private cloud offerings make it\r\n% amenable to tackle increasingly large computation and simulation\r\n% workloads while vastly simplifying the operational aspects of doing so.\r\n% As MathWorks users are discovering the many benefits of leveraging the\r\n% cloud, as a company, we strive to support their needs and enable their \r\n% success.  \r\n% \r\n% For starters, I have seen incredible advances in the scale of the\r\n% computation with our products. Our conversations about results are \r\n% discussed in orders of millions of MATLAB and Simulink simulations. As \r\n% the scale of these systems explode, it is also remarkable to note the \r\n% shrinkage of the time to run these huge simulation workloads - often in \r\n% the orders of hours, minutes and seconds when running the appropriate stack \r\n% of tools.\r\n% \r\n% This summer, MathWorks introduced a one-stop landing page to address these\r\n% use-cases and you can find it at https:\/\/www.mathworks.com\/cloud.html.\r\n% That page discusses the full spectrum of our support for managed\r\n% services in the form of the MathWorks Cloud as well as our support for\r\n% the Public Cloud environments like Amazon Web Services (AWS), Microsoft\r\n% Azure and other cloud systems.\r\n% \r\n% Taking it further, MathWorks has also released a set of reference\r\n% architectures to support workflows ranging from prototyping in MATLAB, to\r\n% full production quality stacks that can be provisioned on the cloud\r\n% allowing our users to put their MATLAB models into production within\r\n% their systems.\r\n% \r\n%% \r\n% *Reference architectures*\r\n% The term reference architecture refers to template solution detailing an\r\n% architecture that involves our products composed in a configuration that\r\n% adheres to current best practices. \r\n% \r\n% Given the wide variety of use-cases and scenarios that it attempts to\r\n% address, it is intended to be used as a guideline, often in conjunction\r\n% with various other building blocks of a complete solution. \r\n% \r\n% I have blogged in the past about our approach to being open and\r\n% extensible. These architectures are no exception and have been released \r\n% on github.com to allow full transparency into how they work and what they\r\n% do - allowing users to use them standalone or fork and tailor to their\r\n% needs. You can find them all at:\r\n% \r\n% https:\/\/github.com\/mathworks-ref-arch\r\n%\r\n% Reference architectures themselves can be defined at various levels of\r\n% abstraction, so let us take a closer look at what these templates look like:\r\n% \r\n% *MATLAB on the cloud*\r\n% Templates for our flagship product, MATLAB, can be found for AWS and\r\n% Azure. For the purposes of the rest of this post, I will use the\r\n% terminology for AWS and Azure alternatingly to be fair to our users \r\n% on these systems. (eg: cloud formation templates on AWS and Azure \r\n% resource manager templates - aka ARM templates). \r\n% \r\n% You can find the template for MATLAB on Amazon Web Services at:\r\n% https:\/\/github.com\/mathworks-ref-arch\/matlab-on-aws\r\n% \r\n% At the heart, the architecture of this reference architecture is quite \r\n% simple as all it does is provision a MATLAB instance in a VM running \r\n% on the cloud.\r\n% \r\n% <<aws-matlab-diagram.png>>\r\n% \r\n% If you are signed in to AWS with a valid cloud account, you can launch \r\n% these stacks from anywhere, including from right here on the blog. \r\n% \r\n% <<aws-launch-stack.png>>\r\n% \r\n% Users can connect to the provisioned instance via remote desktop clients \r\n% or if necessary via clientless access methods like noVNC or Apache Guacamole. \r\n% All it should take is a click of button and the selection of a few \r\n% configuration options and Viola! MATLAB R2018a (Linux)... on the cloud.\r\n% \r\n% *MDCS on the cloud*\r\n% A single MATLAB presents our development environment but your problem may be\r\n% bigger, gnarlier and require a lot more horsepower. The next reference \r\n% architecture of interest provisions a complete cluster of the MATLAB \r\n% Distributed Computing Server\u00e2\u201e\u00a2 product. This supports development workflows \r\n% to scale the computational power of a single MATLAB session and give \r\n% it more bite. \r\n% \r\n% In pictures, this would look like:\r\n% <<Azure_Solution_Scale_Set.png>>\r\n% \r\n% You can find this template at:\r\n% https:\/\/github.com\/mathworks-ref-arch\/mdcs-on-azure\r\n% \r\n% And using it with your Azure account is as simple as clicking the button\r\n% which will launch our latest product R2018a on a Windows Server powered\r\n% cluster sized to your choosing.\r\n% \r\n% <<azure-deploy.png>>\r\n% \r\n% *MPS on the cloud*\r\n% At the end of the simulation, development, data exploration workflow \r\n% is typically a stable algorithm \/ model. Products such as the \r\n% MathWorks Production Server allow developers serve these models as \r\n% scalable services that can be called from anywhere. \r\n% \r\n% In pictures, this would look like:\r\n% \r\n% <<FinalArchitecture60.png>>\r\n% \r\n% Read more about it at:\r\n% https:\/\/github.com\/mathworks-ref-arch\/mps-on-aws\r\n% \r\n% or launch it here:\r\n% <<aws-launch-stack.png>>\r\n% \r\n% In the past I have blogged about examples of taking a MATLAB model \r\n% quickly from prototype to production without costly inefficiencies. Many\r\n% of those examples are powered by such stacks of software on the cloud. The \r\n% wider view of this stack is that it enables MATLAB technology to work well \r\n% with the rest of your solution and scale to meet the demands of the enterprise\r\n% as needed. \r\n% \r\n% *Integrate with other solutions*\r\n% These building blocks allow MathWorks products to play well both in\r\n% workflows that are standalone as well as instances where they need to\r\n% function as a part of a much bigger solution stack. There are other\r\n% reference architectures for connecting these MathWorks stacks to products \r\n% like TIBCO Spotfire. The end objective of all of this is to provide you, \r\n% the reader, easy seamless access to our products on the Cloud environment \r\n% of your choice.\r\n% \r\n% *Putting it all together*\r\n% The building blocks below can now be composed into much richer full \r\n% solutions. For example, below is the architecture of a demo \r\n% solution addressing the needs for both streaming analytics and batch \r\n% analysis of data coming from a collection of connected cars. \r\n% \r\n% <<SampleArchitecture.png>>\r\n% \r\n% While the system architecture picture looks complicated, each of the\r\n% light grey patches on the picture correspond to the reference\r\n% architectures for MATLAB, MATLAB Distributed Computing Server and MATLAB\r\n% Production Server discussed above.\r\n% \r\n% It may look strange to someone who is seeing it for the first time, but\r\n% they can be made as easy to develop and launch as clicking the buttons on\r\n% this blog post. \r\n% \r\n% In conclusion, if you are on the AWS or Azure cloud, we've got your back.\r\n% Please do drop us a comment at cloud-support@mathworks.com or in the\r\n% comment section below to provide us feedback.\r\n##### SOURCE END ##### cb1bc9bf81eb4b14a847b5022b7361e0\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img src=\"https:\/\/blogs.mathworks.com\/developer\/files\/FinalArchitecture60.png\" class=\"img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"\" decoding=\"async\" loading=\"lazy\" \/><\/div><!--introduction--><p>The incredible growth and adoption of cloud based services make it an exciting time to be working at MathWorks with its rich history of technology to supercharge scientific computing workflows.... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/developer\/2018\/06\/29\/on-cloud-reference-architectures\/\">read more >><\/a><\/p>","protected":false},"author":135,"featured_media":1674,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[9,22,21],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/developer\/wp-json\/wp\/v2\/posts\/1662"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/developer\/wp-json\/wp\/v2\/users\/135"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/developer\/wp-json\/wp\/v2\/comments?post=1662"}],"version-history":[{"count":31,"href":"https:\/\/blogs.mathworks.com\/developer\/wp-json\/wp\/v2\/posts\/1662\/revisions"}],"predecessor-version":[{"id":1740,"href":"https:\/\/blogs.mathworks.com\/developer\/wp-json\/wp\/v2\/posts\/1662\/revisions\/1740"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/developer\/wp-json\/wp\/v2\/media\/1674"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/developer\/wp-json\/wp\/v2\/media?parent=1662"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/developer\/wp-json\/wp\/v2\/categories?post=1662"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/developer\/wp-json\/wp\/v2\/tags?post=1662"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}