<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shankhabrata Chowdhury on Medium]]></title>
        <description><![CDATA[Stories by Shankhabrata Chowdhury on Medium]]></description>
        <link>https://medium.com/@conchchow?source=rss-e180c0f35569------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*yykBOC1fp8S6Lczk9y85XA.jpeg</url>
            <title>Stories by Shankhabrata Chowdhury on Medium</title>
            <link>https://medium.com/@conchchow?source=rss-e180c0f35569------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 09:22:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@conchchow/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Cloud First — Cloud Ready — Cloud Native — Cloud Enabled ….]]></title>
            <link>https://conchchow.medium.com/cloud-first-cloud-ready-cloud-native-cloud-enabled-4bbf90a8eaeb?source=rss-e180c0f35569------2</link>
            <guid isPermaLink="false">https://medium.com/p/4bbf90a8eaeb</guid>
            <category><![CDATA[cloud-optimization]]></category>
            <category><![CDATA[cloud-first]]></category>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[cloud-based]]></category>
            <category><![CDATA[cloudready]]></category>
            <dc:creator><![CDATA[Shankhabrata Chowdhury]]></dc:creator>
            <pubDate>Mon, 23 Jan 2023 06:17:41 GMT</pubDate>
            <atom:updated>2023-01-23T06:17:41.466Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cloud First — Cloud Ready — Cloud Native — Cloud Enabled ….</h3><p>So many terms &amp; jargon !! Struggling to differentiate ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ji-ic7Zxk7pY_VPithL6kw.jpeg" /></figure><h3>Introduction/Context :</h3><p>In many discussions either we hear or we use different terms related to cloud, e.g. “Cloud First”, “Cloud Native”, “‘Cloud Optimized”, “Cloud Ready”, and many many more. And sometimes we struggle either to differentiate those or finding correct terms to use.</p><p>This article will try to explain the different terms in my way, how I define them.</p><p>This understanding is totally of mine and some may disagree or interpret differently, but after talking with some experts, I can assure that the variance in understanding will not be much.</p><blockquote><strong>Note : </strong>This article will not explain the different Cloud deployment model terms, e.g. “Hybrid-Cloud”, “Multi-Cloud”, “Heterogeneous-Cloud”, “Distributed-Cloud”, etc.</blockquote><h3>Cloud Ready:</h3><p>Mostly used during operation and future readiness perspective. But sometimes also refer for an application perspective. So based on the context sometimes we use the “Cloud-Ready” term for a team/organization to be cloud ready, and sometimes we refer an application to be cloud ready.</p><h4>Does Imply:</h4><ul><li>How an organization, or a division or an application/project team, or the support team will be <strong>ready</strong> to handle, build, operate any application migration to cloud or creating new application on cloud. Strategy to follow the path towards the cloud.</li><li>Operational/execution guidelines how cloud migration at a broader level will work.</li><li>How a team will be trained/skilled to be ready for cloud technology, cloud operation, etc.</li><li>Cloud-Ready implies being prepared for the impact on the customer facing users or even the impact to the customers who are going to use the new application running on cloud.</li><li>Any planning for migration, or process selecting a new vendor for any specific enterprise wide used application to be running on cloud. e.g On-Prem NFS, On-prem Active directory how those will be cloud ready for future.</li><li>A safe and progressive cloud-ready approach is most of the times a hybrid cloud solution that combines cloud environments with onsite hardware.</li><li>When used with an application (“Cloud Ready” Application), then it has the same meaning as “Cloud Optimized/Cloud aware/ Cloud compatible”, which is described in the subsequent section of this document.</li></ul><h4>Doesn’t Imply :</h4><ul><li>Cloud-Ready term generally does not imply on how the architecture, design or build of system architecture would be.</li><li>Cloud-Ready does not mean your app is already in the cloud. For example, a Cloud-Ready App still can be running on On-Prem, a cloud-ready strategy can still be executed next year.</li></ul><h3>Cloud First / Cloud Centric:</h3><p>It is an approach or strategy to cloud computing for adoption of cloud technologies for all new applications, platforms, infra and also how to move/migrate existing applications to cloud.</p><p>“Cloud-First” approach suggests you design system components to be running on cloud as the first option, running on-prem is the last option. For example, if you need directory domain service then think of using Azure AD , if not possible then on-prem AD, another example if you need file storage system, then try to use AWS S3 ( or similar in another cloud platform), if not possible then On-Prem NFS system.</p><h4>Does Imply:</h4><ul><li>Used with organization’s strategy/direction, e.g. Cloud First Organization, Cloud First approach, cloud first strategy, we never say cloud first application, cloud first platform.</li><li>This cloud-first approach is a difficult path to follow. Often, companies will utilize cloud-first strategies only after they have been cloud-ready or cloud-enabled for quite some time.</li></ul><h4>Doesn’t Imply :</h4><ul><li>“Cloud First” isn’t in reference to a service or product, but rather to a business strategy that aligns with cloud-native initiatives.</li><li>Not always cheap, at least in the short terms.</li></ul><h3>Cloud Optimized / Cloud aware/ Cloud compatible/ Cloud Enabled/ Cloud Based / Cloud Ready</h3><p>Those terms are used to describe an application’s transition state between on-prem and being fully cloud native. In this transitional state applications run on hybrid architecture pattern using a mix of legacy VM’s and PaaS services.</p><h4>Does Imply:</h4><ul><li>Application/platform not built for cloud. but can run/support on cloud with workaround, bandage, gauze. They were once typically deployed in traditional data center environments but have been retrofitted/optimized for cloud compatibility.</li><li>Good and wise intermediate path to achieve full cloud native app/platform, instead of jumping directly to be cloud-native taking high risk.</li><li>In this pattern, Existing systems can be applied to a cloud environment. But, while it can work, it doesn’t mean it necessarily should.</li><li>Cloud-compatible or cloud-enabled software/applications mean they are tested to be run on cloud though they were not designed/built initially keeping cloud in mind. Though it doesn’t mean the software/application is taking full advantage of the benefits of Cloud.</li><li>Having a mix of some components running fully on serverless cloud, some running on VMs/Managed instances on cloud and some components on-prem, of the same application/system.</li></ul><h4>Doesn’t Imply :</h4><ul><li>Does not follow all the factors of “The Twelve-Factor app” principles (<a href="https://12factor.net/">https://12factor.net/</a>), but follows some.</li><li>While “cloud compatible/optimizes/aware” applications/platforms do provide access to the cloud, the true benefits of cloud technology aren’t usually realized.</li></ul><h3>Cloud Native:</h3><p>The term “cloud-native” is mostly used for applications on how to be built and implementation techniques. Cloud-Native application/platform born and brought up in the cloud, built in and for the cloud.</p><h4>Does Imply :</h4><ul><li>Refer to the actual implementation level, not at strategy level.</li><li>Cloud vendor agonistics. can run on any cloud platform ( with very very little changes). [at least that is the desire]</li><li>Mostly running on cloud vendor managed PaaS services/platform, preferably platform is widely supported.</li><li>Follow all factors of “The Twelve-Factor app” principles (<a href="https://12factor.net/">https://12factor.net/</a>).</li><li>Can also run on-prem cloud PaaS platform (e.g. OpenShift, Pivotal running on-prem).</li><li>End and ultimate desire outcome of solid Cloud First/Cloud Centric strategy, kind of end goal to envy of.</li><li>Balanced scale-speed-spend.</li><li>Easy, if you are building the app from scratch, though for existing application modernization.</li><li>Cloud-native applications can consume services natively over the public internet.</li><li>Mostly Cloud vendor agonists.</li><li>Some people suggest Serverless “Function as a Service” based architectures/application falls under Cloud Native, but I don’t believe so, because FaaS is not cloud vendor neutral, but Serverless Container PaaS hosted applications are cloud native.</li><li>Cloud-native apps offer optimal containerization, portability, faster deployment times, and vastly improved scalability. According to a 2022 report by Tigera, 75% of companies are now focusing on developing cloud-native applications.</li></ul><h4>Doesn’t Imply :</h4><ul><li>Don’t refer to strategy level or org direction level discussion. Though this may be the outcome of Cloud-First strategy.</li><li>Not easy for an existing application to modernized as cloud native</li><li>Not necessarily always the perfect fit architecture for your needs. Cloud-Native application/architecture is not the solution of every need/problem.</li><li>We don’t use “Cloud-Native” with organization, strategy. “cloud-native” term used for application/pattern/architecture. For example, we don’t say cloud-native organization or cloud-native strategy, Rather we say cloud-native application, cloud-native architecture.</li></ul><h3>Cloud adoption maturity graph :</h3><p>Below is a pictorial representation of how the type of an application/system changes along with the maturity of an organization’s cloud adoption model/strategy.</p><figure><img alt="Cloud Adoption maturity map" src="https://cdn-images-1.medium.com/max/916/1*eR0D5Bp5eh8J6t38ISn3Og.png" /><figcaption><strong>Cloud Adoption maturity map</strong></figcaption></figure><blockquote><strong>Note:</strong> Opinions and approaches expressed in this article are solely my own and do not express the views or opinions of my employer, any cloud vendors or any other organization.</blockquote><blockquote>Some of the product names, logos, brands, diagrams are property of their respective owners.</blockquote><blockquote><strong>Please:</strong> Post your comments to express your view where you agree or disagree, and to provide suggestions.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4bbf90a8eaeb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Choosing the right cloud platform for Pega]]></title>
            <link>https://conchchow.medium.com/choosing-the-right-cloud-platform-for-pega-20e4fbd34821?source=rss-e180c0f35569------2</link>
            <guid isPermaLink="false">https://medium.com/p/20e4fbd34821</guid>
            <category><![CDATA[pegasystems]]></category>
            <category><![CDATA[pegaplatfrom]]></category>
            <category><![CDATA[pega]]></category>
            <category><![CDATA[cloudforpega]]></category>
            <dc:creator><![CDATA[Shankhabrata Chowdhury]]></dc:creator>
            <pubDate>Sun, 24 Jul 2022 16:11:12 GMT</pubDate>
            <atom:updated>2023-01-20T05:51:14.106Z</atom:updated>
            <content:encoded><![CDATA[<h4>A guide to selecting the right cloud platform &amp; deployment model for hosting &amp; running Pega.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*ZkvXPRpHTfPWe0tmkx6ARg.jpeg" /></figure><h3>Introduction/Context :</h3><p>Gone are the days of cloud environments being a luxury for the modern enterprise — today they are a complete necessity, from the last few years could journey become a norm. And when it comes to choosing the right cloud platform for Pega projects, it can quickly get confusing. Questions come from different teams, different stakeholders like below….</p><p>Q1. Our organization is moving most of the applications to the cloud, for Pega projects which cloud platform I should select?<br>Q2. PegaSystems is trying very hard to convince us to use Pega Cloud, Should I go for that?<br>Q3. Can I run Pega in Private cloud ?<br>Q4. So many cloud platforms and hosting options that Pega platform supports, which one will be best for us?<br>Q5. In which Cloud platform Pega will be more performant, but still cheap ?</p><p>And many such questions.</p><p>This article will guide you to think in the right directions and choose the best cloud platform and deployment model for your specific need to run Pega applications in the cloud.</p><p>This Article will <strong>NOT</strong> cover below.</p><ul><li>Is Pega really Cloud Native?</li><li>Will there be any technical issues if I run Pega in cloud, or on any specific cloud vendor platform?</li><li>What will be the migration journey or delivery execution model?</li><li>What will be compute capacity planning changes required for cloud hosting?</li><li>Will there be any impact on performance or latency ?</li></ul><h3>Driving and decisioning Criteria:</h3><p>What will be your target cloud platform, deployment models, it depends upon your <strong>“to-be-in-cloud need”</strong>, your <strong>“Technical, Non Functional , Operational need”</strong>, your <strong>“current strength/capabilities &amp; Constraints”</strong> and your <strong>“organizations’ future strategies”</strong>. Analyzing and collating answers of those questions will help you to select the right one.</p><h4>&gt;&gt; First determine why your Pega application need to be on cloud:</h4><p>Some of the possible reasons could be as below</p><ul><li>You don’t have any specific problem with your Pega projects, there is a drive in your organization for cloud journey, hence you are evaluating the same for Pega projects</li><li>You want to reduce the infra cost for your Pega project</li><li>You are looking for better performance</li><li>You want to reduce your operational overhead</li></ul><p>Please identify and list down the reasons behind the cloud journey needed for your Pega project, and we will see in this article how those needs drive the cloud platform selection.</p><h4>&gt;&gt; What is your organization&#39;s future strategies:</h4><p>Stay with your organization’s overall strategy, don’t define strategy for your few Pega applications in isolation. So check your organization’s long term goal, such as below</p><ul><li>Has your organization selected any specific single cloud vendor for cloud journey ? For example, all other enterprise applications are in Azure, but if you are selecting AWS for your Pega or you are selecting Pega Cloud Service with AWS flavor, then there could be some challenges.</li><li>Does your organization will support private cloud as future strategy</li><li>As part of app modernization, is your company promoting the use of Managed services &amp; PaaS offering from cloud vendors.</li><li>Does your organization encourage “No Technical lock-in”, “No Vendor lock-in”, “Multi cloud portability”, “vendor neutrality”, “Freedom to build. Flexibility to change”. All are the same thing with different names, ensuring your app can run on any cloud vendor platform.</li><li>Are you organization goals for adopting containerized applications?</li><li>Does your organization allow Hybrid cloud</li><li>What is important for your organization, money vs operational efficiency vs future ready-technology. By bringing operation efficiency you save cost on the support/maintenance team.</li></ul><h4>&gt;&gt; Define your Technical, Non Functional, Operational need :</h4><p>Please evaluate whether you need any specific control or flexibility over the platform where Pega will run, because that requirement may change the dynamics of choosing the correct platform. Such requirement samples are below</p><ul><li>Do you have any needs for a specific Security process, running specific security tools, or specific encryption criteria.</li><li>What is your Data localization &amp; Data Privacy policy for the specific Pega applications</li><li>Does your organization have a defined DevSecOps process and tools? Will that be supported in the selected platform where Pega will be hosted.</li><li>Do you need more granular control &amp; flexibility to change ( over network, ingress, load balancers, auto-scaling, DR/HA, Security, Scanning versioning/patching, backup/purging/archival, monitoring)</li></ul><h4>&gt;&gt; Check your current capabilities &amp; Constraints :</h4><p>Check you current strength and constraints of Operational &amp; echnical capabilities, such as below</p><ul><li>Are the current project team members aware/trained of Cloud and its basic services.</li><li>Is there one or two resources aware of DevOps(CI-CD)</li><li>Does the specific Pega application have strong integration requirements with other applications which may or may not be in the same cloud platform or may be in On-Premises?</li><li>Any security concerns of your applications</li><li>Does the current team are trained or already have experience in Container &amp; Kubernetes</li><li>Does your organization have any Container/K8S CoE or operation team?</li><li>Are your team ready to setup, maintain VPC, security, and database? Are you ok to maintain a team for patching, upgrading platforms ?</li><li>Do you have experience or are ready to invest initial time to install/configure Pega.</li><li>Are you ok to install, configure, upgrade Pega strategic application (Pega industry framework) by your own in your target cloud platform or do you need a fully managed platform from IaaS, PaaS to Pega and Pega industry FW?</li></ul><p>When you are better equipped with the answer to all the above questions, then you should try to match the Pega platform options available for your need of priorities.</p><h3>Platform /Deployment options &amp; decision matrix :</h3><p>Below is the tree of platform options available to host/run Pega in cloud. In the options tree below we have not considered the classic Pega installation in on-premises server, because we are talking here Pega on cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CTsxPftpjWnQ65OuqVVMjg.png" /><figcaption>Pega-Platform choice tree</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2gUrjYynDgaP6cxh9hoSHQ.png" /></figure><p>At first I thought of drawing a decision matrix as a flow chart, but it became a spider web and hard to follow. So representing in rating/scale chart format which will help you to decide easily by calculating the cumulative score based on your needs of factor for different platform options.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wJW3Wm92mcEpzDVfsPO2nw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eD1UPlYj0NgMiHmKQ4PB6Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iHiO6g-JMybasLe2hohfWw.png" /></figure><h3>Frequent Questions comes in Mind</h3><p><strong>Why Should I Opt PegaSystem Cloud Service?</strong></p><ul><li>It brings Operational efficiency, Peace of mind.</li><li>No need to maintain a team for Platform setup, maintenance, monitoring</li><li>No Need to main a team for installation of Pega or It’s Framework</li><li>Hasslefree Pega platform Upgrade.</li><li>Ready on day-one to start your development, no need to wait even for 1 week to set up your own platform &amp; Pega, even on Public Cloud</li></ul><p><strong>Why should I not go with PegaSystem Cloud?</strong></p><ul><li>Pega Cloud hosted on AWS, now if your other interfacing application is running on Azure or GCP then setting the connectivities among cross cloud could be challenging (though not impossible) and time consuming and also may pose some security concerns.</li><li>Flexibility of setting your choice of DR (Disaster Recovery) strategies is limited.</li><li>Deployment region constraint, There could be (very less chance) a scenario where you need a specific geographical deployment cloud region for Data regulation, and Pega CLoud Service not supported for that region.</li><li>Pega Cloud Service runs on AWS in its own VPC, Cross VPC connectivity setup with your own network, or Direct connect setup could be challenging even if you are already in AWS.</li><li>Fixed price, no clarity or no usage based pricing. Sometimes it is based on the number of Pega Cases, sometimes best on relationship, sometimes based on how many Pega Framework you are using, sometimes based on relationship. so it is more Pega product centric pricing rather cloud resource usage based pricing. In this point I may be wrong, as I have no clarity how Pega priced to all different customers.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VXLnzvqDsp-79FZfSlBlSA.png" /><figcaption><a href="https://aws.amazon.com/marketplace/pp/prodview-2lsxpozhzafn6">https://aws.amazon.com/marketplace/pp/prodview-2lsxpozhzafn6</a></figcaption></figure><ul><li>You will not have flexibility to configure scalability in your way.</li><li>Running Custom Pega image could be challenging in Pega Cloud.</li><li>Running your own security scanning tool/process could be challenging if you are using Pega Cloud</li></ul><h3>Conclusion :</h3><h4><strong>So many complex criteria and options, So what is the simple way to decide ? </strong>What is your recommendation?</h4><p>Let’s follow this simple rule. If you want peace of mind with extra money to spend, then go for Pega Cloud. If you want multi cloud portability and better control &amp; flexibility then go for Kubernetes PaaS platform like AWS EKS/Azure AKS/GCP GKE, provided you have some level of cloud operation maturity.</p><h4>The best of both worlds :</h4><p>I have seen some clients who are having the best of both worlds. To do a quick start in their project, they are using the Pega Cloud to start with during the design &amp; Development phase. After gaining experience, maturity and initial momentum, they are using either Private Cloud or Public Cloud to run a pega application for Stage and/Or PROD env on their own.</p><h4>Note:</h4><ul><li>Always perform an assessment for cloud readiness of the Pega application you are planning to run on a cloud platform. Even Pega as a platform can run on cloud but your Pega application may not ready.</li><li>Currently if you are not operating in Private cloud mode, then only for Pega no need to choose Private Cloud path, better to go on Public Cloud route.</li><li>If your pega application needs to interface other applications which are running in NON AWS cloud platform, then better to avoid Pega Cloud.</li></ul><h3>Hybrid Cloud:</h3><p>Have you thought of having the Pega DB (heart or engine of pega) being in a Private cloud or Private Data center (within the client’s firewall, on-premises) but the App server on Public Cloud ? I am leaving it here without any input, as food for thought for you.</p><blockquote><strong>Note:</strong> Opinions and approaches expressed in this article are solely my own and do not express the views or opinions of my employer, Pegasystems, any cloud vendor, or any other organizations.</blockquote><blockquote>Some of the product names, logos, brands, diagram are property of their respective owners.</blockquote><blockquote><strong>Please:</strong> Post your suggestions and comments to express your view where you agree or disagree.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20e4fbd34821" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LCNC vs ServiceNow vs Container vs Serverless]]></title>
            <link>https://conchchow.medium.com/lcnc-vs-servicenow-vs-container-vs-serverless-98798fe3768f?source=rss-e180c0f35569------2</link>
            <guid isPermaLink="false">https://medium.com/p/98798fe3768f</guid>
            <category><![CDATA[lcnc]]></category>
            <category><![CDATA[application-modernization]]></category>
            <category><![CDATA[app-modernization]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[containers]]></category>
            <dc:creator><![CDATA[Shankhabrata Chowdhury]]></dc:creator>
            <pubDate>Sun, 03 Jul 2022 19:06:50 GMT</pubDate>
            <atom:updated>2022-07-20T12:35:17.491Z</atom:updated>
            <content:encoded><![CDATA[<h4>Which platform to choose while modernizing your application?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4IaASciNGiVqxO1yrIe8fw.jpeg" /></figure><h3>Introduction:</h3><p>I have seen many times the question comes during discussions that “which platform should we select for an application to build or modernize? Container or Serverless or LCNC (Low Code No Code) or ServiceNow etc.” And this question comes mostly when we either try to build a new application or when we try to modernize an existing application. This sometime known as Re-platform vs Re-Purchase during cloud journey.</p><p>From my experience of each of these platforms, in this article I will try to represent my view and what runs in my mind when I face that question.</p><p>While going through each option, I will explain in two modes, when to consider and when Not to consider.</p><blockquote><strong>Note:</strong></blockquote><blockquote><em>* There are many products/platforms/COTS (Commercial off-the-shelf), such as OutSystems, Mendix, PowerApp, etc. But in this article I will refer mostly to PowerApps which more or less represent other LCNC platforms.</em></blockquote><blockquote><em>* Here, in this article I am not considering Pega as LCNC, why? That is a separate topic for discussion and arguments.</em></blockquote><blockquote><em>* Also I am not considering Salesforce, SAP, Workday or any other SaaS Vendor, COTS here as options, because in my experience Salesforce or any other SaaS platform has its own established defined domain of usage, and generally rarely comes in confusing discussion while choosing platform for an application.</em></blockquote><blockquote><em>* Nowadays, ServiceNow is also treated as LowCode platform, still I am showing it separately as an option, as it competes with other LCNC platforms during such discussions.</em></blockquote><h3>Key Principles and Drivers</h3><p>There are no straight or defined rules to determine, but generally we analyze and consider below factors to determine which platform best fit for an application to be newly built or an existing application to be modernized.</p><p><strong>Internal or External Users:</strong> Whether your application users are all from within your organization or there will be users from external to your organization.</p><p><strong>Anonymous users:</strong> Will there be users who will access/use your application or some parts/web pages/modules of your application anonymously (without authenticating themselves).</p><p><strong>DB Migration complexity:</strong> If the application already exists and you want to modernize, then assess the existing DB migration complexity and the complexity of data structure. If you are not planning to migrate the existing DB, then you need to check portability of your existing DB with the new target platform which will host the application. For new app to build, this may no be a major factor.</p><p><strong>Vendor/COTS app :</strong> Check whether some vendor SaaS platform or COTS are available in the market to fulfill the business use cases of the application you are planning to build or modernize, and of course without any major customization.</p><p><strong>Custom App or Customization:</strong> Validate whether you definitely need pure custom home grown app because your application needs so. Maybe you don’t have to build a custom app from scratch, but check whether you need major customization for a targeted/chosen platform to fulfill your specific business use case.</p><p><strong>New build or existing app:</strong> Are you planning to built a new application from scratch or modernizing an existing application (re-platform/re-host/re-purchase). When you are building a new app, you may have luxary to evaluate many option, for existing application modernization that is not the case.</p><p><strong>Security and data privacy categorization:</strong> Check your application’s security requirement and data privacy category, whether it will allow it to move to public cloud or in SaaS platform, or you need to keep the app in your operational radius.</p><p><strong>Initial development time :</strong> Check how much static inertia you can absorb for initial development time require for initial platform setup, building the application and to host it. This can be treated as your CAPEX.</p><p><strong>Long term recurring licensing cost:</strong> While you are checking your initial effort and cost for initial development and hosting setup, it is also very important to calculate your long term running cost of the application, e.g. recurring licensing cost, platform hosting monthly charge, etc. This can be treated as your OPEX.</p><p><strong>Operational overhead:</strong> What is your appetite for operation overhead like patching, maintenance, backup, monitoring, scaling etc. Are you ok to sacrifice some control, security and customization to bring operational efficiency? This can be treated as your OPEX.</p><p><strong>Citizen Developer:</strong> Is your organization promoting the Citizen Developer model to reduce developer involvement? This can be treated as your OPEX reduction. In this model, business users are Citizen Developers who can design a lot of screens easily, define workflows independently with limited training.</p><p><strong>Integration type and number:</strong> What kind of integration your application will use with other peripheral systems. e.g. REST, SOAP, IMAP, SFTP, SMTP, gRPC, UDP, WebSocket. And how many integrations we are considering with other systems. Does the application need auto retry, failover, requeuing mechanism on integration failure? Some of the protocol and integration patterns could be roadblock for specific target platforms.</p><p><strong>Current team’s capability</strong>: Does your current team have expertise/experience in any special language, platform? Do they have any affinity to any specific tech stack while being stakeholders of the current applications.</p><p><strong>Responsive UI:</strong> Whether the UI of the application has to be responsive so that it works seamlessly with all resolutions of the UI available on different types of devices.</p><p><strong>Offline mobility:</strong> Is the application mainly a mobile app, does it also need offline support?</p><p><strong>State persistence:</strong> Please verify whether your application is stateless or stateful. Some platforms may not support the state persistence.</p><p><strong>Nature of business use case :</strong> What is the overall purpose of the application? What kind of application is it ? e.g. MDM (master data management), Analytics, Messaging, reporting, analytics, big data, simple workflow, ETL, complex BPM, CRM, ticketing, data streaming, etc. Accordingly select the right SaaS, COTS, Vendor app or build custom app and deploy in the proper platform.</p><p><strong>Control over DevSecOps:</strong> Does your organization have a defined DevSecOps platform or pattern which you must follow? For example, Jenkins or Azure Devops is the platform of choice in your organization’s DevOps pipeline, or all applications have to be scanned via a specific security scanning tool (e.g. aqua, sysdig, snyk, etc.) before it get deployed to production. Also check whether you have any specific code repository related branching, reviewing, scanning practice or requirements supported by specific platforms or not. Roll back strategy is also another major concern while deciding the target platform.</p><p><strong>Control over scalability &amp; capacity planning:</strong> Do you have a requirement to custom control over scalability and capacity planning, for example, on weekends only one server ( schedule scaling) needed, on weekdays scale based on load of CPU ( auto scaling), for batch load spot instance needed, During Diwali 50 servers always. And check such custom scaling and capacity planning supported by the platforms of choices.</p><p><strong>Infrastructure Agnostic:</strong> Your or your organization goal is NO vendor lock-in strategy, then chosen platform need to support that.</p><p><strong>Architecture Pattern:</strong> Do you have any specific requirements of any specific architectural pattern, e.g. micro service, pub-sub (async), batch, real time-stream. And check whether those must have architecture patterns requirements supported by the platforms in your wish list.</p><p><strong>Deployment architecture:</strong> (availability, reliability, scalability). Does your application have any specific deployment architecture requirement? for example any need of geo-location/ geo-proximity load balancing, specific backup strategy, failover requirement, allowed deployment downtime, deployment model (blue/green, canary, rolling, etc.). Accordingly match the supportability of those requirements against different platforms.</p><p><strong>Long term strategy:</strong> Stay informed and aligned with your organization’s long term strategies. Maybe your organization has a strategic partnership with a specific platform, or has a license discount for a specific vendor, or your organization’s strategic goal is to increase operational efficiency.</p><h3><strong>Container Platfrom :</strong></h3><p>There are many container platforms, for example Docker on VM, VMware Tanzu, K8s over OpenShift, AWS ECS Farget, AWS EKS, Azure AKS, Google GKE and many more. We will not go into discussion of comparing different container platforms. In general we will see when to consider your application to be containerized and running on any container platform.</p><blockquote>Though there are many container platforms, I prefer and suggest serverless container platform (e.g. AWS ECS-Farget, EKS-Farget etc.)</blockquote><h4>When to consider :</h4><p>If any one or many of below criteria are fulfilled then you may consider your application to be hosted in container platforms.</p><ul><li>If the application has to be a Custom app and can be containerized.</li><li>You need Multi Cloud Platform portability, for no vendor lock-in.</li><li>You already have a team experienced in a specific programming language and you don’t want to lose time to train them in a new platform, as they already know existing applications.</li><li>Vendor apps provide their container image and you want to run in your private cloud or in your managed public cloud instance.</li><li>If the application has a lot of integrations. or any specific integration protocol which is not supported by other SaaS/COTS platforms.</li><li>The application has some network dependency with your own data center, which is a roadblock for using other SaaS/COTS platforms.</li><li>When Security, data privacy is the concern, and you want to manage those yourselves.</li><li>Need more control over DevSecOps.</li><li>Planning for Extensibility and more choice of design patterns.</li><li>You want to avoid recurring licensing costs (for the application). Less OPEX.</li><li>Your application has to support internal and/or external users.</li><li>Application needs high demand of scalability with more control, Options to decouple services so independent scalability of different services is possible. All platforms options provide scalability and auto managed, but for container platform scalability in your control.</li><li>Taking advantage of other cloud vendor specific services (AWS S3, SES, SQS, etc.), and easy integration with those in your application.</li><li>Need more control over Data and Data Structure.</li><li>During app modernization, it is an easier migration path compared to Serverless.</li></ul><h4>When NOT to consider :</h4><p>If any one or many of below criteria fulfilled then its better NOT to consider your application to be hosted in Container platform</p><ul><li>The application is a Data platform or reporting platform</li><li>This is a new application and you have very little time before 1st go-live.</li><li>Functionality of the application’s use case is readily available with SaaS/COTS vendors with no or little customization.</li><li>You are NOT ok to spend effort creating UI or modernizing UI to be responsive. You don’t have time &amp; effort for creating UI or modernizing UI to be responsive (content that adjusts smoothly to various screen sizes based on different devices.).</li><li>If the Vendor app does NOT provide a container image to be run by you.</li><li>Your application has strong accessibility requirements and you need to spend a lot of effort in building that, in that case some SaaS/COTS platform provides that as in build solution/features.</li></ul><h3>Serverless (FaaS — Function As A Service)</h3><h4>When to consider :</h4><p>If any one or more of below criteria are fulfilled then you may consider your application to be hosted in Serverless platform.</p><ul><li>If you are planning for a short running work load, low compute consuming application components/modules.</li><li>Goes well with event driven architecture or Micro services.</li><li>If you are building an api driven stateless application.</li><li>Less operational overhead is your major consideration.</li><li>You application has non predictable ad hoc load, and yet not too much invocations ( e.g. not more than 80K api call per month)</li><li>You are liking the model pay/bill per invocation/execution, pay only for the time your functions are running. Zero cost for idle time.</li></ul><h4>When NOT to consider :</h4><p>If any one or more of below criteria are fulfilled then its better NOT to consider your application to be hosted in Serverless platform.</p><ul><li>If any preferred language of coding which is not supported by the desired serverless platform.</li><li>Application/module with long running work load, high compute consuming application component/modules. Resource heavy processing.</li><li>You need stateful application,</li><li>You fear vendor lock-in.</li><li>During app modernization, moving to serverless is a complex and tough migration path compared to Container.</li><li>Sometimes running costs may be higher if load usage patterns are not analyzed and monitored properly.</li><li>Complex apps can be hard to build over serverless.</li><li>Serverless pattern/platform not for front-end modules to build.</li></ul><h3><strong>Service Now:</strong></h3><h4>When to consider :</h4><p>If any one or more of below criteria are fulfilled then you may consider your application to be hosted in ServiceNow platform.</p><ul><li>Application is for Generic Ticketing system, service desk/ticketing/workflow, Incident management, service request rising, follow up, resolution. OR the application has something related to IT service management.</li><li>Your application has to support only internal users. If the users of the application are your own organization. internal user facing, not for External users (outside of your organization)</li><li>Less operation overhead (Savings from patching, stay current). Ease of deployment, administration, and maintenance.</li><li>Your application tagged with less security concern.</li><li>Just be careful not to customize too much.</li><li>The licenses are expensive and recurring .</li><li>If your future envisioned scope/requirement/architecture can be fulfilled within this ServiceNow platform only.</li></ul><h4>When NOT to consider :</h4><p>If any one or many of below criteria are fulfilled then its better NOT to consider your application to be hosted in ServiceNow platform.</p><ul><li>Your application has to support External users.</li><li>Does not involve any incident or service request or ticketing or tracking requirements or similar kind of resolution workflow.</li><li>Requirement of complex architecture or design patterns which are not supported.</li><li>Lots of customization needed.</li><li>For existing applications DB layer migration is challenging</li><li>Complex architecture, aggressive performance tuning required.</li><li>There will be users who will access/use your application or some parts/web pages/modules of your application anonymously (without authenticating themselves)</li></ul><h3><strong>LCNC (e.g. PowerApps) :</strong></h3><p>Though below points are for LCNC, but mainly keeping PowerApps in mind.</p><h4>When to consider :</h4><p>If any one or many of below criteria are fulfilled then you may consider your application to be hosted in the LCNC platform.</p><ul><li>Application having basic/standard business processes, involve some workflow. Application has a well defined business process.</li><li>Build Faster is your aim. Low development time accelerates application development.</li><li>Business User is Citizen Developer. A business person can design a lot of screens easily, Define workflows, with limited training.</li><li>Your application has to support only internal users. If the users of the application are your own organization. Applications having internal users facing, not for External users (outside of your organization).</li><li>Application has less security concern.</li><li>Application needs less and easy Integrations. Simple integration preferably over REST/SOAP ( 80/443).</li><li>Creating Responsive UI is not a headache.</li><li>Just be careful not to customize too much.</li><li>The licenses are expensive and recurring.</li><li>Your future envisioned scope/requirement/architecture can be fulfilled within this LCNC platform only.</li></ul><h4>When NOT to consider :</h4><p>If any one or many of below criteria are fulfilled then its better NOT to consider your application to be hosted in the LCNC platform.</p><ul><li>Your application has to support External users.</li><li>Does not have any workflow requirement or defined process.</li><li>Application is for Master Data management.</li><li>Lots of complex and low latency integration requirements.</li><li>Requirement of complex architecture or design patterns which are not supported.</li><li>Lots of customization needed.</li><li>For existing applications DB layer migration is challenging.</li><li>Complex architecture, aggressive performance tuning. Debugging, performance tuning can be difficult at times (sometimes).</li><li>There will be users who will access/use your application or some parts/web pages/modules of your application anonymously (without authenticating themselves)</li></ul><h3>At the End :</h3><p>After you have completed your fitment analysis for functional use cases, technicality, effort and other different factors mentioned above, don’t forget to consider below factors, which can override your decision at the end. These are mostly your current capabilities and organization’s strategic direction as a whole.</p><ul><li>Current platform ecosystem. If you’re most of the applications are in platform X, then better to give preference to platform X.</li><li>Availability of trained resource on different skills.</li><li>Current team’s existing experience.</li><li>Capex vs Opex priorities.</li><li>Organization’s strategic goal/direction.</li></ul><p>At the end you also need to remember that it is not always you have to choose only one platform to run your application, you may take best of all options to host your application module in multiple platforms. For example, for a single application, the simple workflow is defined in the ServiceNow, while the complex admin module in the containerized custom app. Another example could be, for a application, some complex heavy computing modules running on containers while the light weight event driven modules/api running on Serverless.</p><blockquote><strong><em>Note:</em></strong><em> Opinions and approaches expressed in this article are solely my own and do not express the views or opinions of my employer, any software vendors, or any other organizations.</em></blockquote><blockquote><em>Some of the product names, logos, brands, diagrams are property of their respective owners.</em></blockquote><blockquote><strong><em>Please:</em></strong><em> Post your comments to express your view where you agree or disagree, and to provide suggestions.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98798fe3768f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[STATEFUL Application Remediation — to be Cloud Native]]></title>
            <link>https://conchchow.medium.com/stateful-application-remediation-to-be-cloud-native-fcca9da9c9c?source=rss-e180c0f35569------2</link>
            <guid isPermaLink="false">https://medium.com/p/fcca9da9c9c</guid>
            <category><![CDATA[cloud-native-application]]></category>
            <category><![CDATA[sessionexternalization]]></category>
            <category><![CDATA[application-modernization]]></category>
            <category><![CDATA[app-modernization]]></category>
            <category><![CDATA[stateful-applications]]></category>
            <dc:creator><![CDATA[Shankhabrata Chowdhury]]></dc:creator>
            <pubDate>Sun, 22 May 2022 05:44:42 GMT</pubDate>
            <atom:updated>2022-05-22T06:57:23.504Z</atom:updated>
            <content:encoded><![CDATA[<h3>STATEFUL Application Remediation — to be Cloud Native</h3><p><strong>Making stateful application Cloud-Native as part of Application modernization</strong></p><h3>Context:</h3><p>While doing Application Modernization, if you are planning to make your application true cloud native, then just lift and shift is not the way. You should consider doing proper re-factoring/re-architecting your application to follow <a href="https://12factor.net/">Twelve-Factor App</a> principles to make your app true Cloud-Native.</p><p>Now while making an application true cloud native, one of many challenges is if the application is stateful. As the “<a href="https://12factor.net/processes">Process</a>” principle, one of the twelve principles for being compatible with Twelve-Factor App says “Execute the app as one or more stateless processes”. <strong>Twelve-factor processes are stateless and </strong><a href="http://en.wikipedia.org/wiki/Shared_nothing_architecture"><strong>share-nothing</strong></a><strong>.</strong> If at all, any data that needs to persist must be stored in a stateful <a href="https://12factor.net/backing-services">backing service</a>, typically a database.</p><p>While building an application as stateless is the objective, but in this article we will focus in understanding how we can make a stateful application cloud native by externalize the session(state) with an external common distributed stateful backing service/system.</p><h4>Stateful vs Stateless application — quick refresher:</h4><p>Just as a quick refresher ..</p><p>A stateful app is a program that saves client data from the activities of one session for use in the next session. The data that is saved is called the application’s state.<br>Stateful applications save client session data somewhere (mostly on the server where the application runs) for use by the server, by clients, and by other applications.</p><p>But stateless applications, in which client data or data related to past transactions is not saved to the server between sessions. It accepts each transaction or user interaction like a blank state without knowledge of previous interactions.</p><p>In some cases, statelessness doesn’t mean that there isn’t a state. It just means that the state is held somewhere else.</p><p>If you are new to the concept or need to explore in detail then below two articles will be helpful.</p><ul><li><a href="https://blog.dreamfactory.com/stateful-vs-stateless-web-app-design/">Stateful vs. Stateless Web App Design | DreamFactory Software- Blog</a></li><li><a href="https://www.redhat.com/en/topics/cloud-native-apps/stateful-vs-stateless">Stateful vs stateless</a></li></ul><h3>Challenge / Problem Statement:</h3><p>Elastic cloud environments differ from traditional server configurations in that they have a variable number of servers based on traffic loads whereas traditional configurations had a fixed number of servers. When traffic volumes decline it is necessary to vaporize servers. In doing so, we would lose user sessions (essentially forcing a logout) unless we come up with a new strategy for session management.</p><p>The main challenge with the stateful application is its non compatibility with scaling. To use an in-process session, you must configure sticky sessions at your load balancer level, to bind clients and users to the same server so it can process subsequent requests in the context of previous ones. If traffic grows, you can’t simply replicate a stateful app and redirect new client requests because users will need to start from scratch. Similarly when traffic reduces you can’t scale down a server unless all existing users sticking to those servers are not logged out completely. This makes stateful apps difficult to scale and prone to system unavailability when client traffic increases.</p><p>Typically, monolith stateful web applications depend on session to maintain their state between requests and data of session state is persisted in-process (in memory of server). In a volatile container environment if an application is deployed on multiple containers, this could lead to session data loss if any container restarted.</p><p>As part of this scaling problem, the users of stateful apps need to continue sending requests to the same system that maintains their state data — or they lose historical context. That means you cannot scale by redirecting new client requests to other systems running the same application. Clients will need to reauthenticate, and they will lose the historical context of previous transactions. When you need to provide the same app experience to a rapidly growing user-base — or to an unpredictable amount of client traffic — stateful apps can experience delays and shutdowns as traffic rises to levels that the server can’t handle.</p><p>To solve this scaling issue, the ideal target architecture/pattern could be stateless application if it supports the business needs, otherwise we should externalize the session state of a stateful application, which we will discuss in next sections.</p><h3>Ideal target state:</h3><p>In the modern day architecture, if the business use case supports, the ideal target state for any application should be stateless to become true cloud native running on any container platform or even in auto scaled EC2/VM platforms.</p><p>There could be many architectures and pattern for stateless application but most commonly used pattern is decoupled front-end and back-end application, where the front-end app could be a Single Page Application (SPA) built on Angular/REACT running on CDN (for aws, CloudFront+ S3) and the Backend running as exposed api ( written in any language, .net-core, Java, Node.js, Python, PHP, etc.) to be called from front-end. And using Azure- AD Auth and user access tokens for authentication and identification.</p><p>An ideal stateless application is one which does not store the session at server side at all. At the same time you need to store the user authentication and user info somewhere, you can’t ask your user to reauthenticate every time for every new interaction. The minimum user’s session and state will be maintained at user/client side and passed to the server on every call/interaction in a form of encrypted token, e.g JWT,auth0.</p><p>Authentication is handled by the Angular SPA application, which passes a bearer token to the API application to be validated against Azure AD.</p><p>For details please refer below link, a very good article on how to make stateless session for a stateful app.</p><ul><li><a href="https://aws.amazon.com/blogs/apn/how-to-integrate-rest-apis-with-single-page-apps-and-secure-them-using-auth0-part-1/">How to Integrate REST APIs with Single-Page Apps and Secure Them Using Auth0 - Part 1 | Amazon Web Services</a></li><li><a href="https://auth0.com/blog/stateless-auth-for-stateful-minds/">Stateless Sessions for Stateful Minds: JWTs Explained and How You Can Make The Switch</a></li></ul><p>This pattern of keeping state client-side in the form of signed tokens, sometime call <strong>“stateless session of stateful app”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/0*sUd7ZrV0zW1Zqn4A" /><figcaption>Sample reference diagram of using Token and cookie, making session stateless. Note: picture taken from “<a href="https://auth0.com/">https://auth0.com</a>”</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*1gbn5VfducAUafYQhcmuTQ.png" /><figcaption>Reference deployment diagram of a typical stateless application.</figcaption></figure><p>Advantages of Token-Based Authentication:</p><p><strong>Stateless, easier to scale</strong>: The token contains all the information to identify the user, eliminating the need for the session state. If we use a load balancer, we can pass the user to any server, instead of being bound to the same server we logged in on.</p><p>Whatever mentioned above is possible if you are building an application freshly from scratch or re-writing an application while modernizing. But not always possible if you are planning for re-platform/re-architecting/Re-factoring the app while modernizing. For that, externalization of state could be an acceptable solution where whole rewrite of the application is not required.</p><h3>Acceptable Target State: “Session/State Externalization”</h3><p>During application cloud modernization, Many times it is not possible to rewrite the whole application, still the desired target state is pure cloud native app. In those cases we can follow a pattern called ”Session/State Externalization”, a.k.a “Distributed Session Management”.</p><p>If your app needs to store session data to process transactions in-context and if the server can handle the expected processing load, a stateful system is probably needed and you can’t go for stateless application.</p><p>So to make a stateful application scalable in a cloud native platform, you need to externalize the session/state management via a distributed caching system, rather than making it a stateless application.</p><p>The idea in the Session/State externalization pattern is to store the session or state data in a central external system rather than along with the container/pod/node where the application is running, and that common central external system will be distributed among all containers/pod/nodes where the app is running. Need a small rewrite of the application to communicate with that external Session store system. And preferably that external session storing system should be close to the app for being fast to retrieve the session data, ideally a caching system.</p><p>Distributed session is a way for you to store your session state outside of your ASP.NET Core/Java/or any other application. Depending upon your performance, costing and caching requirement, using Couchbase/memcached/Redis/dynamodb/SQL DB to store session state can help you when you need to scale your web site.</p><p>A distributed cache is a cache shared by multiple app servers, typically maintained as an external service to the app servers that access it. A distributed cache can improve the performance and scalability of an ASP.NET Core or any app written in any language, especially when the app is hosted by a cloud service or a server farm.</p><p>A distributed cache has several advantages over other caching scenarios where cached data is stored on individual app servers.</p><p>When cached data is distributed, the data:</p><ul><li>Is coherent (consistent) across requests to multiple servers.</li><li>Survives server restarts and app deployments.</li><li>Doesn’t use local memory.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*xVmn-Hm782W4MEMQ-LK5Cw.png" /><figcaption>Sample deployment diagram of monolith stateful application with session externalization</figcaption></figure><blockquote>Though S3 and EFS can be used as file storage to store session data, it is not recommended due to performance, locking and other issues.</blockquote><p>While doing assessment check of stateful nature of both web and API layers, by exploring code. We should analyze how deep the session is being used to store the state data. Next Analyze the effort and timeline impact of refactoring it to make stateless from stateful. Sometimes an application is just using the session to store the authorization data. If the use of session is minimal, we can refactor it to remove the dependency on session.</p><h4>Sample Code Snippet :</h4><p>Code guide for AWS ElasticCache (Redis):</p><p>Below is sample code snippet for .net core while using AWS ElasticCache (Redis) to store session data. Similar code you can get by googling, for other languages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/1*bMD1176qjbd30tBGkGmA1A.png" /></figure><p>Code guide for Azure Redis Cache:</p><p>We can do the same with Azure Redis Cache using interacts with the cache using the <a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.caching.distributed.idistributedcache">IDistributedCache</a> interface. Below is sample steps for .net core while using Azure Redis Cache to store session data. Similar code you can get by googling, for other languages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*enC9D8B9-YjZNjNTco5-gw.png" /></figure><p>For details implementation of Azure Redis Cache using .net-core, please follow below links.</p><p><a href="https://docs.microsoft.com/en-us/aspnet/core/performance/caching/distributed?view=aspnetcore-3.1">https://docs.microsoft.com/en-us/aspnet/core/performance/caching/distributed?view=aspnetcore-3.1</a><br><a href="https://docs.microsoft.com/en-us/aspnet/core/fundamentals/app-state?view=aspnetcore-3.1">https://docs.microsoft.com/en-us/aspnet/core/fundamentals/app-state?view=aspnetcore-3.1</a></p><h3>Short term workaround (but not recommended):</h3><p>There could be scenarios due to complexity, timeline constraint, application knowledge gap, you are not able to make the Session/state management externalize, then below could be some short term work around, though not recommended as first option.</p><p>So in this approach, you are neither making a stateful application as stateless nor externalizing the session in a distributed cache, rather you are trying to run a stateful application in a container platform, <strong>somehow</strong>.</p><p>Originally, containers were built to be stateless, as this suited their portable, flexible nature. But as containers have come into more widespread use, people began containerizing (redesigning and repackaging for the purposes of running from containers) existing stateful apps. This gave them the flexibility and speed of using containers, but with the storage and context of statefulness.</p><p>With the growth in popularity of containers, companies began to provide ways to manage both stateless and stateful containers using data storage, Kubernetes, and StatefulSets. Statefulness is now a major part of container storage and the question has become not if to use stateful containers, but when.</p><p>These approaches allow you to run the stateful application in Kubernetes with high availability, but still you will sacrifice the user experience(session) on platform auto-scaling.</p><p>As these are not recommended solutions hence we will touch briefly without explaining detailed implementation techniques.</p><p><strong>Way 1 :</strong></p><p>Using GlusterFS which is a container native storage offering from RedHat. <strong>But this option is only possible if you are using RedHat OpenShift</strong> Kubernetes container platform hosted on-premise or in AWS. GlusterFS CNS volumes are basically <strong>Distributed file storage on top of EBS </strong>volumes, managed by heketi. The volumes are built out of local block devices of the OpenShift nodes backed by EBS. These volumes provide shared storage and are mounted on the OpenShift nodes with the GlusterFS FUSE client. For details please refer “<a href="https://www.redhat.com/en/blog/struggling-containerize-stateful-applications-cloud-heres-how">https://www.redhat.com/en/blog/struggling-containerize-stateful-applications-cloud-heres-how</a>”</p><p><strong>Way 2:</strong></p><p>Using Amazon Elastic File System (Amazon EFS) as a storage device for containers that are running on Amazon Elastic Kubernetes Service (Amazon EKS), using AWS Fargate to provision your compute resources. The Amazon EFS CSI driver allows multiple pods to write to a volume at the same time with the “<em>accessmode:ReadWriteMany</em>” mode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*-i_-bmcF9K3vnUKo.png" /><figcaption>AWS EFS provisioner Architecture for k8s. note: pic taken from “<a href="https://www.padok.fr/">https://www.padok.fr/</a>”</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/0*DYk0dcOXoRtusfSZ.png" /><figcaption>Sample architecture to use share EFS for state management across multiple pods</figcaption></figure><p>And your application code serialize the session and store in file using persistentmanager with the file path pointed to the mounted EFS path.</p><p>For details please refer below links</p><p>“<a href="https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/run-stateful-workloads-with-persistent-data-storage-by-using-amazon-efs-on-amazon-eks-with-aws-fargate.html">https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/run-stateful-workloads-with-persistent-data-storage-by-using-amazon-efs-on-amazon-eks-with-aws-fargate.html</a>”</p><p>“<a href="https://aws.amazon.com/blogs/containers/running-stateful-workloads-with-amazon-eks-on-aws-fargate-using-amazon-efs/">aws.amazon.com/blogs/containers/running-stateful-workloads-with-amazon-eks-on-aws-fargate-using-amazon-efs/</a>”</p><p>“<a href="https://docs.giantswarm.io/advanced/storage/efs/">https://docs.giantswarm.io/advanced/storage/efs/</a>”</p><p><strong>Way 3 :</strong></p><p>Using a combination of StatefulSet and Session Affinity at Kubernetes cluster level so that all requests always direct traffic from a client to the same pod. Using the Kubernetes internal load balancing and configuring Ingress into the cluster we can set up session affinity. But this <strong>doesn’t</strong> work well during auto scaling of pods ( HPA). Below article will give a brief idea how we can run a stateful application in Kubernetes without refactoring the code or architecture of the application.</p><p><a href="https://sookocheff.com/post/kubernetes/building-stateful-services/">Building Stateful Services with Kubernetes</a></p><blockquote>Have you noticed that all those short termed workaround options mentioned above to run a stateful application in container platform ( without making it stateless or externalizing the session) are on Kubernetes ?</blockquote><h3><strong>Conclusion :</strong></h3><p>To run a stateful application on a container platform, in the above sections we have discussed 3 options,</p><p>1 — “Ideal -Making the app stateless- rewrite the app”, <br>2 — “Acceptable -Session Externalization-rearchitect the app”, <br>3 — “Short Term(not recommended)- no change in app — tweak the platform”.</p><p>If you have the time to rework your apps, do it! On a long-term basis, Option 1 will be to your advantage. However, if you don’t have time, choose the 2nd option.</p><blockquote><strong>Note:</strong> Before going stateless, make sure this is appropriate for your architecture. This article is not promoting stateless app pattern over stateful pattern. there could be some valid usecases where stateful applications hold merit. This article is guiding on techniques for converting a stateful app to stateless app through some comparison of advantages/disadvantages of the both patterns.</blockquote><blockquote><strong>Note:</strong> Opinions and approaches expressed in this article are solely my own and do not express the views or opinions of my employer, AWS, Microsoft, Oracle, or any other organization.</blockquote><blockquote>Some of the product names, logos, brands, diagram are property of their respective owners.</blockquote><blockquote><strong>Please:</strong> Post your comments to express your view where you agree or disagree, and to provide suggestions.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fcca9da9c9c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Batch Job in Cloud Native World]]></title>
            <link>https://conchchow.medium.com/batch-job-in-cloud-native-world-86a188992ba4?source=rss-e180c0f35569------2</link>
            <guid isPermaLink="false">https://medium.com/p/86a188992ba4</guid>
            <category><![CDATA[batch-on-aws]]></category>
            <category><![CDATA[batch-job]]></category>
            <category><![CDATA[batch-on-container]]></category>
            <category><![CDATA[batch-modernization]]></category>
            <category><![CDATA[cloud-native]]></category>
            <dc:creator><![CDATA[Shankhabrata Chowdhury]]></dc:creator>
            <pubDate>Mon, 04 Apr 2022 09:15:59 GMT</pubDate>
            <atom:updated>2022-04-04T09:15:59.625Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Re-platforming Batch Job during Application Modernization/Migration</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nFdrrtrY6GrFSpmY0zn4uQ.jpeg" /></figure><h3>Context:</h3><p>In this article I will try to explain what are the different design/implementation patterns we can have when we need to design and run scheduled batch jobs on a cloud native platform.</p><blockquote>In the below article, examples, scenarios, and solutions are mostly in AWS platform and application written in .net-core, but the concept and pattern are perfectly applicable to other cloud platforms and other languages for their respective offering/services.</blockquote><p>Before we start discussing the actual topic, I feel it is very important to describe my understanding/definition of a few terms used in this article, as those may have different understanding to different persons, e.g. Cloud Native Platform, Batch Job, etc.</p><p><strong><em>What is Cloud Native Platform ?</em></strong> The platform which helps to run cloud native apps ( Twelve-Factor app principles). Computing platform running at PaaS layer or in Serverless. For example container platforms (EKS/ECS/Fargate) or Lambda are cloud native platforms to me. Application servers running on EC2/VM at IaaS layer and maintained by you are not a cloud native platform to me. Though it is debatable.</p><p><strong><em>What is Batch Job ?</em></strong> Many people may have a different understanding of Batch Job. To me Batch job is a software process/module performing same tasks in bulk and at scheduled time in recurring occurrence/manner. e.g. Send emails at everyday mid-night, to all eligible customers to send birthday greetings. or Check in every hour whether a new file is in the staging area to process.</p><p>Any Batch job has two parts, one is Scheduling — when to execute, and the other part is processing which contains the business logic to execute.</p><p>While the core concepts of batch job remain same in the current cloud native world, except one major difference. In the classic VM or IaaS world batch job is a <strong>“background processing will never die”</strong>, but in cloud native PaaS/Serverless platforms the batch job is a <strong>“background processing will die &amp; reborn”</strong>.</p><h4>Some assumptions and out-of-scope :</h4><p>Below are some points which we will not discuss in this article as it is out of scope for the context of this article.</p><ul><li>To solve a use case whether we use a batch pattern or not is debatable. There could be alternative approaches such as worker pattern, pub-sub model, near-real-time streaming/messaging pattern, etc. We can debate on the necessity of Batch Job, but can’t disagree that there will be some use cases where definitely batch job is required.</li><li>This article will not cover the batch job at database tier, e.g. replicating/transferring data from one database table to another database table, etc.</li><li>This article will cover batch job implementation at the App tier, mostly for handling business events/functionalities.</li></ul><p><strong><em>Some sample usecases of Batch Job at App tier:</em></strong></p><p>Below are some sample usecase for app-tier batch job, which will help you to ideate which usecases we are going to cover with the possible implementations.</p><ol><li>Generating and sending reports, once in a day.</li><li>Processing files, images etc. to extract data, or perform actions on them. may be in each alternate 2 hours.</li><li>Orchestrating data across multiple systems within one logical user data flow.</li><li>Applications are sending email in bulk.</li><li>The Application is generating some files and putting in a FileServer via SFTP in batch mode.</li><li>Some applications 2–3 batch jobs are running in regular manner and also they are orchestrating among themselves as they are interdependent. etc.</li></ol><h3>Problem statement:</h3><p>When you are running a scheduled batch job in a physical machine or VM, you have full control on the operating system to schedule a batch job written in any programming language. You can use Windows Task scheduler/Service or Linux cron job etc., to schedule and invoke a program module to perform a certain task, and your machine/system/OSs/computing always available to perform that task. Sometimes we schedule the job in Control-M and execute code in the VMs or physical machines.</p><p>But when you are migrating to the PaaS layer or creating a new application to be hosted in Cloud Native PaaS platform, then you don’t have any access to physical machine/OS to schedule or run the batch job running in the App tier.</p><p>Also you have to keep in mind the ephemeral and disposable nature of cloud native PaaS offerings.</p><h3>Possible solution patterns:</h3><p>Below are some possible options to implement batch jobs in cloud native platforms, based on your needs and acceptable constraints.</p><blockquote>We will not consider “AWS Batch” service as an option here, as the AWS Batch is for HPC (High Performance Computing) usecases.</blockquote><blockquote>Detail on how to implement these options below is out-of-scope of this article.</blockquote><h3><strong>Option 1 : .net-core worker service (</strong>IHostedService)</h3><p><strong><em>Description</em>: </strong>Both the batch job and scheduling can be implemented using the .net-core coding (as .net-core worker service application). Here you don’t need any external scheduler or additional AWS service. The scheduler and the execution code written in .net core (using IHostedService interface) and running within a container.</p><p>Maybe we can create a separate .net-core worker service application/project to host all batch jobs of a specific application and run on a separate container tagged as background container.</p><blockquote>Here we are taking .net language as reference, but similar approach can be implemented in Java using ScheduledExecutorService / ServletContextListener or similar.</blockquote><p><strong><em>UseCase Fitment:</em></strong></p><ul><li>Small (less resource intensive) batch job, running frequently in a recurring manner in a day. The batch job which runs quickly and finishes quickly.</li><li>The batch job functionality scope within the application.</li><li>No orchestration among multiple batch jobs required.</li><li>No major monitoring and status reporting required.</li><li>No auto/manual retry required for failure scenarios, and the Batch job itself has a mechanism to pick not-completed tasks/items from the last run.</li><li>The Batch job itself has capability/code to put log entries for success and failure for external monitoring on demand.</li></ul><p><strong><em>Pros:</em></strong></p><ul><li>Build &amp; host the batch job alongside the application, no external tooling required to schedule the batch.</li><li>Developers in full control in scheduling, processing and exception handling.</li><li>Simple implementation.</li><li>Same implementation across any cloud vendor platform. Same code will work in any container platform.</li></ul><p><strong><em>Cons:</em></strong></p><ul><li>The container which will host those batch jobs has to be in running state even sometimes the jobs are not running. will increase your cloud bill.</li><li>Need to do proper resource sizing for the container. As Auto scaling is not possible.</li><li>No proper Dashboard for status /history /audit checking for the batch jobs.</li><li>Separate design and effort for error tracking and retry mechanism.</li><li>Need code change for any scheduling change.</li><li>No auto healing, if the container goes down your batch job also will die.</li></ul><h3>Option 2: Hangfire</h3><p><strong><em>Description</em>: </strong>Hangfire is an open-source framework that helps you to create, process and manage your background jobs.<br>Hangfire .net core library helps to create your own batch job of different types.<br><a href="https://www.hangfire.io/overview.html">https://www.hangfire.io/overview.html</a></p><blockquote>Here we are taking .net language as reference, but similar approach can be implemented in Java using JobRunr.<br><a href="https://www.jobrunr.io/en/">https://www.jobrunr.io/en/</a></blockquote><p><strong><em>Usecase Fitment:</em></strong></p><ul><li>Mass notifications/newsletter; firing off web hooks; purge temporary files; batch export to xml, csv, json;</li><li>If Many batch jobs run in a single container for maximum utilization of resources allocated to that container, then it is a good fit.</li></ul><p><strong><em>Pros:</em></strong></p><ul><li>No Windows Service or separate process required or no external tooling required to schedule the batch.</li><li>Open and free for commercial use.</li><li>Supports all kinds of background tasks — short-running and long-running, CPU intensive and I/O intensive, one shot and recurring.</li><li>Backed by Persistent Storage (filesystem, MSSQL, PostgreSQL).</li><li>Automatic Retries.</li><li>Integrated Monitoring UI</li><li>Hangfire uses distributed locks to handle synchronization issues.</li><li>Same implementation across any cloud vendor platform.</li></ul><p><strong><em>Cons:</em></strong></p><ul><li>No dedicated support from HangFire in the Free tier.</li><li>A Small yet learning curve for developers is involved.</li><li>Need to check your company’s Open Source software usage policy, in case any special approval is required.</li><li>The container which will host those batch jobs has to be in running state even sometimes the jobs are not running. will increase your cloud bill.</li><li>Need to do proper resource sizing for the container. As Auto scaling is not possible.</li><li>No auto healing, if the container goes down your batch job also will die.</li></ul><h3>Option 3: CloudWatch + Lambda</h3><p><strong><em>Description</em>: </strong>On specified times, CloudWatch Event schedule can invoke Lambda which will have the code for execution.</p><p><strong><em>Usecase Fitment:</em></strong></p><ul><li>Short running and less resource intensive batch job.</li><li>Small and simple code.</li><li>The batch job runs one or multiple times in a day.</li><li>Orchestration among multiple batch jobs NOT required.</li><li>NO major requirement of retry and fancy dashboard.</li><li>No requirement of Parallel processing</li></ul><p><strong><em>Pros:</em></strong></p><ul><li>Pure serverless, pay as you use, without managing/maintaining any container image.</li><li>Easy to apply devops to provision new batches.</li><li>It has some way to implement alerting/notification on failure on invocation. (using cloudwatch).</li><li>The end-to-end solution is cloud native.</li></ul><p><strong><em>Cons:</em></strong></p><ul><li>Lambda functions’ limitations include code size limit and execution time limit.</li><li>No history of execution, need custom setup using logging from code.</li><li>No parallel execution.</li><li>No Orchestration among multiple batch jobs.</li></ul><h3>Option 4: CloudWatch + Container in Fargate</h3><p><strong><em>Description</em>: </strong>Place the processing logic/code with in container as Fargate Task, Invoke the Fargate Task from Cloudwatch event scheduler.</p><p><strong><em>Usecase Fitment:</em></strong></p><ul><li>Long running and high resource intensive batch job.</li><li>Batch jobs run one or multiple times in a day.</li><li>Orchestration among multiple batch jobs NOT required.</li><li>NO major requirement of retry and fancy dashboard.</li></ul><p><strong><em>Pros:</em></strong></p><ul><li>Container need not be running all the time, Cloudwatch will start and stop the task. So less billing.</li><li>Provide some kind of execution history from AWS ECS console for Fargate Task execution.</li><li>Provides some kind of execution metrics in the CloudWatch console. (under Metrics).</li><li>Easy to apply devops to provision new batches.</li><li>Specify the desired number of tasks to run in parallel. It allows multiple tasks in parallel from Cloudwatch as task count.</li><li>It has some way to implement alerting/notification on failure on invocation. (using cloudwatch)</li></ul><p><strong><em>Cons:</em></strong></p><ul><li>No inbuilt dashboard for status/error reporting.</li><li>No inbuilt feature of retry.</li><li>It is a fire and forget model, so Cloudwatch will trigger the batch job by invoking a task.</li></ul><h3>Option 5: CloudWatch + StepFunction + Container in Fargate/EKS</h3><p><strong><em>Description</em>: </strong>CloudWatch Event schedule can invoke AWS Step function which will again invoke either ECS Fargate Task or the EKS Job (based on your container platform selection). Step Function can have multiple batch jobs invoked from within it.</p><p><strong><em>Usecase Fitment:</em></strong></p><ul><li>Need Orchestration among multiple batch jobs (small/lightweight).</li><li>It could be a light or heavy(long running) batch job.</li><li>Orchestration among multiple small/lightweight batch jobs from within Step Function is possible.</li><li>You need notification on completion of batch job</li><li>You need advance exception handling, retry and alerting mechanism around the batch job.</li></ul><p><strong><em>Pros:</em></strong></p><ul><li>It has some way to implement alerting/notification on failure on invocation. (using cloudwatch).</li><li>The end-to-end solution is cloudnative.</li><li>Advance exception handling, retry and alerting mechanism</li></ul><p><strong><em>Cons:</em></strong></p><ul><li>Basic dashboard for status/error reporting.</li><li>Little additional cost/billing due to usage of StepFunction on top of ECS/EKS billing, but very minimal.</li></ul><h3>Option 6: EKS CronJob</h3><p><strong><em>Description</em>: </strong>Inbuilt CornJob feature of Kubernetes cluster. Defining CronJob object which will call/execute a container image through K8s Job object.</p><p><strong><em>Usecase Fitment:</em></strong></p><ul><li>Long running batch job, small running batch jobs are also fine.</li><li>No orchestration among multiple batch jobs required.</li><li>No major monitoring and status reporting required.</li><li>No auto/manual retry required for failure scenarios, and the Batch job itself has a mechanism to pick not-completed tasks/items from the last run.</li></ul><p><strong><em>Pros:</em></strong></p><ul><li>Same implementation across any cloud vendor platform. cloud vendor neutral.</li><li>Inbuild basic retry mechanism. Basic self-healing.</li><li>Easy to maintain &amp; configure</li></ul><p><strong><em>Cons:</em></strong></p><ul><li>No dashboard for execution history/status reporting.</li><li>No orchestration among multiple batch jobs possible.</li><li>The Scheduling and processing module is closely coupled under the same platform.</li></ul><p>Below is a summary matrix for the different options described above and their respective score in different architectural concerns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2UAi3pA-Wu1VYnBbvVcCZg.png" /><figcaption>Scoring Matrix for different options against different capabilities.</figcaption></figure><h4>So many options! any single one as a recommendation ?</h4><p>With so many solutions available, you may get confused which one to choose out of so many. I will recommend you start with CloudWatch +StepFunction + Fargate/EKS/Lambda. So the simple guideline to follow is to start with as below</p><ul><li>If the batch job is simple, execution time within 10 minutes, then CloudWatch Event(EventBridge) + StepFunction + Lambda.</li><li>If the batch job is long running, and heavy in execution then either “CloudWatch Event(EventBridge) + StepFunction + Fargate” OR “CloudWatch Event(EventBridge) + StepFunction + EKS” based upon your container platform (ECS Fargate / EKS)</li></ul><p>Please remember, AWS Step Function provides good support for retry, exception handling, alerting(notification), concurrency and orchestration with very minimal additional cost. StepFunction also allows waiting for the end of execution of the batch job via Fargate/EKS/Lambda for response/outcome.</p><blockquote><strong>Note:</strong> Opinions and approaches expressed in this article are solely my own and do not express the views or opinions of my employer, AWS, Microsoft, Oracle, or any other organization.</blockquote><blockquote>Some of the product names, logos, brands, diagram are property of their respective owners.</blockquote><blockquote><strong>Please:</strong> Post your comments to express your view where you agree or disagree, and to provide suggestions.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86a188992ba4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS ECS Fargate- Compute Capacity Planning]]></title>
            <link>https://conchchow.medium.com/aws-ecs-fargate-compute-capacity-planning-a5025cb40bd0?source=rss-e180c0f35569------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5025cb40bd0</guid>
            <category><![CDATA[serverless-computing]]></category>
            <category><![CDATA[ecs-fargate]]></category>
            <category><![CDATA[compute-sizing]]></category>
            <category><![CDATA[aws-ecs]]></category>
            <category><![CDATA[capacity-planning]]></category>
            <dc:creator><![CDATA[Shankhabrata Chowdhury]]></dc:creator>
            <pubDate>Tue, 02 Nov 2021 18:52:32 GMT</pubDate>
            <atom:updated>2022-06-25T03:35:34.535Z</atom:updated>
            <content:encoded><![CDATA[<p>Compute Sizing for AWS ECS Fargate, balancing act between cost and performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*mUXyb8mpzbPnmj1xqV1dPw.png" /></figure><h3>Context:</h3><p>Capacity planning for an application running on cloud ? Does it not sound absurd? Because Cloud is all about elasticity, auto-scaling. And especially when the ECS Fargate is a Managed &amp; Serverless offering from AWS, does it really make sense to discuss capacity planning for ECS Fargate?</p><p>Well, answer is No and Yes.</p><p>If your application is light weight, less used and you are not too sensitive about billing and performance, then the answer is NO, you don’t have to bother about the capacity planning for application running on ECS Fargate, at least until you are facing any issue in the Production environment.</p><p>But, if your application is heavily used with unpredictable/random load, And you are sensitive about the performance ( how quickly your container will spawn off) and with tight billing budget, then you should have some capacity planning exercise during Design phase of your project and during the rest of the phases of your project, to bring some balance between cost and performance.</p><p>In this article we will discuss what are the factors/features of AWS Fargate to consider/utilize while doing capacity planning. We also will see what could be the different steps and consideration for capacity planning while either creating a new application or re-platforming an existing application to ECS Fargate.</p><p>In the first few sections we will try to recap/touch what are different terms around the compute unit in AWS/Docker world, how Auto scaling in Fargate can be implemented and few other basic stuff associated with the topic. And then we will understand what are the steps we can follow to do proper capacity sizing of containers running in ECS Fargate for a freshly built application or for a re-host/re-platform application into ECS Fargate.</p><blockquote>* This article only cover ECS on Fargate, and does not cover ECS on EC2 or EKS. But most of the concept are common and applicable to other container platform as well.</blockquote><blockquote>* This article does not cover capacity planning of Network bandwidth and storage, this article only considering CPU and Memory capacity planning</blockquote><h3>Why we Should do Compute Capacity planning for Fargate ?</h3><p>Though the AWS ECS Fargate is a managed and serverless offering, still you have to keep below points in mind, to convince yourself to do some level of capacity planning for your container level compute consumption &amp; allocation.</p><p><strong>AWS Manage the HW sizing of the Container Platform not for the container</strong>, and you are responsible to specify the compute size of your task/container.</p><p><strong>Auto-scale scales the number not the size !! </strong>The auto-scaling increases the or decreases number of container/task/pod, but size of individual pod/container is very important to get the right balance between performance and cost.</p><p><strong>Same size does not fit all !! </strong>Container run time computing size depends on the what web server, what runtime platform, which loading library getting used and your application’s memory/CPU footprint, etc.</p><p><strong>Balancing act between performance and cost !!</strong> So too small size of a single container may result in performance bottleneck, too frequent auto scaling up, and even may cause crashing of application, at the same time too big sized container may cause higher billing due to underutilized computing resource.</p><h3>Some computing unit/term in AWS and Docker world:</h3><p>The number of CPU units used by the task can be expressed as an integer using CPU units, for example 1024, or as a string using vCPUs, for example ‘1 vCPU’ or ‘1 vcpu’.</p><p>Please note, in AWS<br>1 CPU Core (physical core) = 2 vCPU<br>1 vCPU = 1024 CPU units</p><blockquote>For some AWS instance types 1 Core =1vCPU. Means single core has one processing Thread. So please check your ECS/EKS underneath cluster instance type, accordingly you plan the rest.</blockquote><blockquote>In DataDog, cpu utilization shows in mcore units, which is Mili-Core. 1 Core = 1000 mcore. For EKS/ECS instance type if 1 core is 1 vCPU then, 1 vCPU= 1000 mcore, but for that instance type if 1 core = 2 vCPU then, 1 vCPU= 500 mcore,</blockquote><p>Amazon ECS task definitions for Fargate require that you specify CPU and memory at the task level. Although you can also specify CPU and memory at the container level for Fargate tasks, this is optional. Most use cases are satisfied by only specifying these resources at the task level.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wYxdFJOpCWQ84c4gvJwOWw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*QvSLLcXFvTpM6rFmnXSTaw.png" /><figcaption>Capacity reservation at Task level from ECS console</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*Jd2rG0CWg7oFEmCvDBRCBQ.png" /><figcaption>Capacity reservation at Container level from ECS console</figcaption></figure><h3>Many Small containers vs Few Large containers:</h3><p>The question always comes in mind is whether I should go for many small containers and do auto scaling, or go with few large size containers. When those question comes in mind, below points may help you to decide.</p><p><strong>Cost is not the differentiator !!</strong></p><p>When the total required compute size is fixed, cost is not a differentiating factor for having small numbers of big container vs big numbers of small containers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*FGDFO2OQ9YHGCYwcSW7OBw.png" /><figcaption>For a fixed computing need, Monthly billing is same for different size of container and number combination.</figcaption></figure><p><strong>Too small sized container? Be ready for Container cold start latency !!</strong></p><p>Too small sized container may result into frequent auto scaling which bring the momentary overall slow performance of the whole service due to container cold start latency for new spawned off container/pod/task.</p><p>Lower sized container may also cause performance issue due to less breathing space, frequent garbage collection, etc.</p><p><strong>Too big sized container? Hope you are not wasting compute resource!!</strong></p><p>Too big sized container may result into waste of compute resource. Application/service running in a container should utilize at least 85% of the compute resource in average over a period. Otherwise, you are going to pay more while not using the provisioned capacity in its fullest.</p><p><strong>So, </strong>finding the <strong>appropriate number of containers and size of each container </strong>is crucial for having a balance between performance, Usage &amp; billing.</p><h3>Suggested CPU vs Memory ratio</h3><p>The table below shows the valid combinations of task-level CPU and memory. It is recommended to follow this CPU vs Memory capacity ratio while planning for capacity for ECS tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l9fhXAbAkgyWMsv5KX9Sqw.png" /></figure><p>Ref: <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html#fargate-tasks-size">https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html#fargate-tasks-size</a></p><h3>Typical Fargate Task compute sizing as starting point</h3><p>Below is the typical compute sizing as a starting point reference, in case you don’t want or don’t have a way to do upfront capacity sizing and ok to go in the path of trial and error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MDxtAqVLafdh_UJz7nuuWA.png" /><figcaption>starting point reference capacity sizing</figcaption></figure><p>Again, the above table is just a reference starting point. For near-real sizing please do proper sizing (mentioned below in this article), performance testing, and monitoring</p><p>Now you may ask what is the definition of Small/Mid/Large application? Below what can be followed, but you may set your own guideline based upon the applications you play/experienced with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*KBJVvq8RhC2uW3ahps0UjQ.png" /></figure><h3>Autoscaling Services</h3><p>While you are planning for compute capacity for tasks/containers, it should have a strong support of auto-scaling, to use the capacity in an optimized manner and to bring a balance between cost and performance.</p><p>Autoscaling is very important to making sure that your services stay online when traffic increases unexpectedly. In AWS Fargate one way to ensure your service autoscales is to increase and decrease the number of copies of your application container that are running in the cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ArxSZzPZTkYzQMYX6WwhA.png" /><figcaption>Default existing mechanism of AWS ECS Fargate auto scaling implementation</figcaption></figure><p>For details know how of ECS Fargate service auto scaling, please refer below link.</p><p><a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-auto-scaling.html">Service auto scaling</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*b8oygGruFHjwusDlHn0CXg.png" /><figcaption>Configuring AutoScaling from AWS ECS console</figcaption></figure><p>To refer sample CloudFormation template to Scale service up and down based on CPU usage or memory usage, please refer below link.</p><p><a href="https://containersonaws.com/architecture/autoscaling-service-containers/">https://containersonaws.com/architecture/autoscaling-service-containers/</a></p><h3>Capacity Provider:</h3><p>Amazon ECS capacity providers are used to manage the infrastructure the tasks in your clusters use.</p><p>It has great significance for ECS on EC2, but for Fargate it is already managed by AWS. FargateProvider is the default capacity provider for ECS running in Fargate mode, in rare scenarios we choose Fargate Spot as capacity provider.</p><p>As this article focuses on the ECS Fargate and not the ECS on EC2, hence we will not go into details of Capacity Provider.</p><h3>How to Calculate Capacity requirement ?</h3><p>Unfortunately there’s no one-size-fits-all answer here and it’s dependent on the characteristics of your application component, acceptable performance, cost and so on. Sorry.</p><p>Here are some basic ways to do rough capacity planning for ECS Fargate. and for 2 different scenarios.</p><p>1: Before going to the Performance testing stage (while in DEV, ST, SIT, etc.) Or you are not planning for any performance testing before going to the production</p><p>2. After the Performance test, but before going to the production.</p><p><strong>Before going to the Performance Testing:</strong></p><p>Below explain a very basic way to do capacity planning and may not be perfect for your use case/scenario. But you will get a sense of capacity.</p><p>The very basic way is to check the memory usage while you’re coding the app and do CPU proportionate ratio calculation against that memory.</p><p>STEP 1 : Check the memory utilization for a single user during development. You have not deployed your application in DEV Fargate cluster, but you are mostly done with the code/build. Check the memory consumption of your application for a single user. Below are some tools to check the memory utilization .NET or Java application, similar are available for other computer programing languages.</p><p>— .NET Memory Profiler<br> — Visual Studio Diagonistic Tool ( <a href="https://docs.microsoft.com/en-us/visualstudio/profiling/memory-usage?view=vs-2019">https://docs.microsoft.com/en-us/visualstudio/profiling/memory-usage?view=vs-2019</a> )<br> — .NET Object Allocation tool (<a href="https://docs.microsoft.com/en-us/visualstudio/profiling/dotnet-alloc-tool?view=vs-2019">https://docs.microsoft.com/en-us/visualstudio/profiling/dotnet-alloc-tool?view=vs-2019</a>)<br> — JConsole<br> — jvisualvm<br> — Cloudwatch Application insight</p><p>STEP 2: Multiply that memory utilization with your predicted number of concurrent users. That is your total memory capacity requirement. You can add 10% and 30% buffers to calculate safe base and peak memory requirement.</p><p>STEP 3: Now find the CPU from the below sample CPU vs Memory ratio against the nearest value for Memory capacity found from STEP 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*OhBvg_Xi5Co8aSms8XwDbQ.png" /><figcaption>Recommended CPU vs Memory ratio</figcaption></figure><p>STEP 4: Determine number of containers (tasks) to fulfill above CPU and Memory requirement. The minimum number of tasks should be 2.</p><p><strong>Example :</strong> While a developer is building any application using IDE in their desktop and the application’s major functionalities completed, test those major happy paths for a 10 minutes, and monitor delta memory consumption increase, using the different desktop based diagnostic tool.</p><p>Let’s assume that the delta value is 40MB. And your NFR is for 50 concurrent users. So the memory requirement is 50 users * 40MB = 2000 MB = ~2 GB. If you add a 50% buffer then it is ~3 GB. Now keep additional 0.5 GB aside for the .net platform or JRE to consume or some side-car monitoring container (datadog, NewRelic, etc) or any other container associated processes to consume. So in total 3 + 0.5 = ~4 GB is the memory requirement.</p><p>So if we go by the above CPU vs Memory ratio table then 1 vCPU CPU capacity is safe one.</p><p>So we will go with 2 tasks each of 2 GB Memory and 0.5 vCPU. ( Which comes to our total requirement of ~4GB RAM, 1 vCPU compute)</p><p><strong>After Performance testing, but before going to the production:</strong></p><p>This one is very straight forward, totally based upon the actual behavior.</p><p>Before starting the performance testing in Perf/Stage/SIT/UAT environment, make sure ECS platform monitoring tool is in place. e.g. Prometheus/Grafana, New Relic, DataDog, CloudWatch Container Insight, etc.</p><p>During/Post performance testing, check the CPU and Memory utilization at Task level and how the existing auto scaling is being utilized. accordingly right-sized the capacity and auto scaling parameter.</p><p>This is also true for post production monitoring and right-sizing exercise.</p><h3>High level capacity sizing steps for application migration:</h3><p>When you are migrating your application to a container platform (as a re-platform), As you have something in place to analyze and compare, it becomes relatively easy to do capacity planning for the ECS Fargate task. Below are some high level steps you can follow for capacity sizing.</p><ul><li>Measure current utilization : Measure the current utilization of compute resources. Don’t take what is the full capacity available of the box/server/instance/host, rather concentrate on monthly average compute usage. Talk to your sysadmin to get those data.</li><li>If you want to feel safe, you can add a 10% buffer on the current compute usage value. But not necessary. But actually you can reduce 10%, as the compute consumption in your old platform also involves OS and other OS related processes. But let’s go with the same current consumption value.</li><li>Sizing of task/container: Now based on the past compute consumption data, plan required number of tasks and their size. At a minimum 2 tasks, and CPU and Memory combination as mentioned in the above section of this article.</li><li>Auto scaling : Utilizing the past compute consumption trend set the auto scaling pattern. You can follow the below pattern</li></ul><p><em>— Desired Number of Task : max ( 2, Lowest Monthly average consumption in last one whole year / size of each task)<br> — Minimum Number of Task : max ( 2, Lowest Daily consumption in last 7 days / size of each task)<br> — Maximum Number of Task : max ( 2, Highest Monthly average consumption in last one whole year / size of each task) + 2</em></p><ul><li>Performance Test, Usage Monitoring and Re-Size: set up platform monitoring tools (CloudWatch Container Insight, AppDynamic, DataDog, etc.) in PERF and PROD environments. Perform a performance test and resize the task based on the compute consumption analysis during the performance test.</li></ul><h3>High level capacity sizing steps for greenfield application:</h3><p>For a newly built application to be hosted in EWS Fargate, it is challenging to do upfront sizing calculation. Same challenge exists even for an existing application which is sharing infrastructure with many other applications, also getting compute consumption for that single application is tough. But still with some basic calculation you can start with near accurate sizing. Below are the high level steps.</p><ul><li>NFR : Define your NFR, how many concurrent users? how long a single User will stay in the application in one session, what are the happy path/functionality an User will perform in one session.</li><li>Calculate compute usage while Developing : Using different Development tools add-ons calculate the compute usage for a single user of the application and accordingly calculate the whole compute requirement for your application based on NFR. Please refer to the section “How to Calculate Capacity Requirement ?” in this article for details.</li><li>Typical sizing: In case if you don’t want to go in the path of development tool based capacity planning, or you don’t have much time to do so, then you can go with typical sizing based on your application usage requirement. For details please refer to the section “Typical Fargate Task compute sizing as starting point”, in this article.</li><li>Auto scaling : Utilizing the calculated compute consumption requirement to set the auto scaling pattern. You can follow the below pattern</li></ul><p>— Desired Number of Task : max ( 2, Average consumption based on NFR/ size of each task)<br> — Minimum Number of Task : max ( 2, Lowest consumption based on NFR / size of each task)<br> — Maximum Number of Task : max ( 2, Highest consumption based on NFR / size of each task) + 2</p><ul><li>Performance Test, Usage Monitoring and Re-Size: set up platform monitoring tools (CloudWatch Container Insight, AppDynamic, DataDog, etc.) in PERF and PROD environments. Perform a performance test and resize the task based on the compute consumption analysis during the performance test.</li></ul><h3>Best Practices:</h3><ul><li>Always keep Auto scaling of Service in place, only doing capacity sizing of tasks is not enough unless you have auto-scaling in place.</li><li>Keep CPU and memory at the task level 10% more than the combined CPU and memory at all containers within that task</li><li>Even if you do initial capacity planning before going to production, You have to monitor your container to see how it behaves, and resize the capacity of task/container. and it is a continuous process.</li><li>Ensure performance testing planned and executed before going to production</li><li>Container platform monitoring tools are in place in lower environments, not only in PROD environments.</li><li>Don’t try to incline towards too much for a lower sizing task/container with implementation of auto scale-out too much. It may look best from a cost perspective as you want to start with low sizing tasks and on-demand increase many small-small tasks as needed. But remember auto scale out comes with a performance delay time to provision each task/container, so when you need capacity to fulfill additional user requests, you will get some invocation delay. Keep a balance between number of tasks vs compute size in each task.</li><li>Too many small size tasks/containers (with auto scaling support) may be lucrative from a cost perspective, but may have impact in application performance, as low memory allocation may result in too many garbage collection and hence impact in app performance. So, suppose you have an estimated requirement of total 10 GB memory capacity, in that case 5 containers/tasks each of 2 GB memory is better than 10 tasks/containers each of 1 GB. Keep a balance between number of tasks vs compute size in each task.</li><li>Based on your need, determine the scaling policy option between Step Scaling vs Target Tracking.</li><li>Please remember in ECS, auto scaling is set at Service level, not at Task level. So if you are planning for back end scheduled job via non service based task, there auto scaling is not applicable</li><li>For some Service Auto Scaling Considerations please refer below link<br><a href="https://docs.aws.amazon.com/AmazonECS/latest/userguide/service-autoscaling-stepscaling.html">https://docs.aws.amazon.com/AmazonECS/latest/userguide/service-autoscaling-stepscaling.html</a></li><li>Auto Scaling consideration — Set appropriate Scale-in and scale-out cooldown period/time of auto scaling based the initialization time of your image/container.</li><li>Auto Scaling consideration — Set the appropriate Service Health check grace period based on the time your task requires to be up and responding to ALB. This grace period can prevent the ECS service scheduler from marking tasks as unhealthy and stopping them before they have time to come up</li><li>For Java and .NET application, don’t go below 2GB memory and 0.5 vCPU per task. unless it is very very light weight and simple application.</li><li>Better to have one container per task.</li><li>Based on your application nature, set the auto scaling based on CPU and Memory utilization target . If your application is computation intensive then choose CPU utilization based auto scaling, if you think your application is memory intensive then set our auto scaling based on memory utilization target.</li></ul><blockquote><strong>Note:</strong> Opinions and approaches expressed in this article are solely my own and do not express the views or opinions of my employer, AWS or any other organization.</blockquote><blockquote>Some of the product names, logos, brands, diagram are property of their respective owners</blockquote><blockquote><strong>Please:</strong> Post your comments to express your view where you agree or disagree, and to provide suggestions.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5025cb40bd0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migrating Pega PRPC applications to containers and Kubernetes]]></title>
            <link>https://conchchow.medium.com/migrating-pega-prpc-applications-to-containers-and-kubernetes-a64a909f6aa7?source=rss-e180c0f35569------2</link>
            <guid isPermaLink="false">https://medium.com/p/a64a909f6aa7</guid>
            <category><![CDATA[containerization]]></category>
            <category><![CDATA[pega]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Shankhabrata Chowdhury]]></dc:creator>
            <pubDate>Thu, 04 Feb 2021 19:20:02 GMT</pubDate>
            <atom:updated>2021-02-05T05:28:16.160Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/944/0*N-65FRB5an8qOVSU.jpg" /></figure><p>This article is intended to guide on what you should consider and how you should plan to migrate or deploy your Pega application in a container platform (Kubernetes or any other container orchestration platform).</p><blockquote>This article assumes that you are in any one of the below stages with your Pega application journey</blockquote><blockquote>* You are already operating your Pega application in a cloud environment, and now you want to containerize and run in a container platform,<br>* or you have already made your mind to deploy your existing Pega application (running in on-premises bare metal server) in a container environment. (after detailed analysis/ground work).<br>* You are starting a new Pega project/application and from day one you want to run in container as part of the Pega cloud journey.</blockquote><blockquote>This article tries to cover strategies, consideration and planning of containerization of the application and App server component of a Pega platform , and it does not cover below</blockquote><blockquote>* Benefits of moving to container.<br>* Strategy for DB migration to cloud.<br>* Strategy for choosing cloud platform (private cloud/ public cloud, vendor, platform, etc).<br>* Why and whether you choose Pega in bare-metal cloud computing engine vs container platform.</blockquote><p>First, make sure your decision to containerize an existing monolithic Pega application and operate it with Container platform/Kubernetes is a sound choice. <strong>Don’t do it just because you can or you want</strong>, Migrate existing Pega applications into containers with a long-term vision in mind. Moving to containers and Kubernetes just for the sake of doing it can actually introduce a lot more scope and technical challenges, depending on the applications and the teams running them.</p><h3>Migration Phases</h3><p>Every migration is different; however, they all typically follow the same high-level process. Below are typical phases to consider when you are in the journey for containerization of your Pega application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*59eQwv2EL5v7LD4POKuQrw.jpeg" /><figcaption>Overview of phases for containerization of Pega application</figcaption></figure><h3>Platform Options</h3><p>When you are thinking of deploying your Pega application on a container platform, then choosing Kubernetes based container platform will be a wise choice as Pega supports industry wide acceptance of kubernetes (k8s) as the standard container orchestration platform.</p><p>You can manage Pega applications on top below supported cloud Kubernetes services:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8i7_jUJbTOLEyXR2" /></figure><p><strong>Infrastructure-as-a-Service :</strong><br> ^ AWS Elastic Kubernetes Service (EKS)<br> ^ Microsoft Azure Kubernetes Service (AKS)<br>^ Google Kubernetes Engine (GKE)<br><strong>Platform-as-a-Service :</strong><br> ^ VMware Tanzu (Enterprise PKS)<br>^ RedHat OpenShiftt</p><p>Now within Kubernetes based container platforms, which one you want to choose that depends on different factors like below</p><ul><li><strong>Availability of internal resources with Kubernetes expertise— </strong>You may not have the internal resources to ensure that Kubernetes installations, troubleshooting, deployment management, upgrades, monitoring, and ongoing operations won’t end up causing significant business disruption and cost increases — especially the need for more skilled personnel. <br>If that’s the case, consider opting for a SaaS-based managed Kubernetes service (AWA EKS, GCP GKE, Azure AKS). This is particularly helpful if you are struggling to keep up with the rate of change in the community and best practices for managing Kubernetes in production.</li><li><strong>Security — </strong>If you have security considerations against going to the public cloud then using container platform like OpenShift or PKS in on-premises are the options. If you have expertise and effort to manage Kubernetes cluster yourself then installing Kubernetes in your own Server/VM also another option.</li><li><strong>Your current cloud vendor — </strong>Due to various reasons, like cost, usage, features, network, etc. , if you are already in a specific public cloud platform then choosing a Kubernetes service from that specific cloud vendor makes sense.</li><li><strong>Taking advantage of both worlds — </strong>Sometimes you have expertise and comfort with OpenShift, but still you want to take benefits of public cloud then you can install OpenShift Kubernetes cluster on top of AWS EC2 computing engine or on top of any other cloud vendors’ compute engine.</li><li><strong>DB migration strategy— </strong>Your DB migration strategy could be another factor while choosing which Kubernetes based container platform best suits your needs to host a Pega application. if you don’t want to move your DB into the cloud then choosing on-premises based container platform like OpenShift, PKS should be considered.</li></ul><p>Once you have determined the use case and the team capabilities, no matter which cloud you choose to deploy for production-grade containerized workloads, you stick with a stable open-source release. Best of all, go with the industry standard for container orchestration: Kubernetes.</p><p>Leverage Docker, Kubernetes and Helm to manage Pega Infinity (TM) with modern cloud architecture principles. Manage Pega Infinity with automated deployment, scaling, and management of containerized applications. Customize processes with Elasticsearch, Cassandra / DSS, Traefik, or an EFK (Elasticsearch-Fluentd-Kibana) stack.</p><h3>Associated Considerations/task/activities</h3><p>While you are planning to host your Pega application as a container in a container platform, you have to consider many associated activities at different layers of the deployment at different stages of the lifecycle of the project.</p><p>Below are some of the typical activities which you should consider in your planning/journey. Below list is not an exhaustive list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*Z07sJdKVgCaTfgHvXQikKg.jpeg" /><figcaption><strong>Typical activities at different layers, for an application deployed in container platform.</strong></figcaption></figure><h3>Reference Deployment Architecture (Baseline)</h3><p>When we talk about deployment architecture for Pega application on container platform, we should consider 2 architectures for 2 different layers,</p><p>1. How to deploy a container platform itself.<br>2. How to deploy Pega platform on top of container platform.</p><h4>Deployment architecture for Container platform :</h4><p>What will be deployment architecture for container platform generally depends on below factors</p><p>— Which container platform your are choosing ( OpenShift/ PKS / EKS/ GKE/ etc.)<br> — Which base cloud hosting you are choosing ( private/public, Bare-Metal/AWS/GCP/Azure) <br> — Application Performance requirement (NFR)<br> — HA and fault tolerance requirement<br> — Usage pattern (Dev, QA, Prod environment)</p><p>Every vendors and platform providers have their own suggested deployment architecture, please refer their respective documentation for details.</p><p>For Pega PRPC, The following Kubernetes environments are supported</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bQYCTYTlFL5LymOdVmwbMg.png" /></figure><p>— Kubernetes<br> — OpenShift<br> — Amazon EKS Kubernetes<br> — Google Kubernetes Engine (GKE)<br> — VMware Enterprise Pivotal Container Service (PKS)<br> — Azure Kubernetes Service (AKS)</p><p>To know more details about choosing Kubernetes based Pega deployment, please visit below 2 links.</p><ul><li><a href="https://community.pega.com/knowledgebase/articles/client-managed-cloud/choosing-kubernetes-based-services-your-deployment">Choosing the Kubernetes-based services for your deployment</a></li><li><a href="https://community.pega.com/knowledgebase/articles/client-managed-cloud/85/meeting-requirements-and-prerequisites">Meeting requirements and prerequisites</a></li></ul><p>Below are some sample reference deployment architecture, 1st one for OpenShift in on-premises private cloud, 2nd diagram depict running OpenShift on top of AWS EC2, and 3rd one for AWS EKS</p><p><strong>Reference 1: </strong>OpenShift Container platform</p><p>OpenShift Container Platform is a platform for developing and running containerized applications. It is designed to allow applications and the data centers that support them to expand from just a few machines and applications to thousands of machines that serve millions of clients.</p><p>With its foundation in Kubernetes, Its implementation in open RedHat technologies lets you extend your containerized applications beyond a single cloud to on-premise and multi-cloud environments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*23VXxoY7mu_i09NXkuFM4w.png" /><figcaption>Ref# 1: OpenShift Container Platform Architecture Overview</figcaption></figure><p>For more details please refer below</p><p><a href="https://docs.openshift.com/container-platform/3.4/architecture/index.html">https://docs.openshift.com/container-platform/3.4/architecture/index.html</a></p><p><strong>Reference 2:</strong> OpenShift container platform on AWS</p><p>you can build the OpenShift Container Platform environment in the AWS Cloud, to get benefit of both the worlds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lH-c0fmHq3J7cCdZGnfIYw.png" /><figcaption>Ref# 2: Quick Start architecture for OpenShift Container Platform on AWS</figcaption></figure><p>For details on instance sizing and setup please refer below document</p><p><a href="https://aws-quickstart.s3.amazonaws.com/quickstart-redhat-openshift/doc/red-hat-openshift-on-the-aws-cloud.pdf">https://aws-quickstart.s3.amazonaws.com/quickstart-redhat-openshift/doc/red-hat-openshift-on-the-aws-cloud.pdf</a></p><p><strong>Reference 3:</strong> AWS EKS</p><p>Amazon EKS is a fully managed service that makes it easy to deploy, manage, and scale containerized applications using Kubernetes on AWS. Amazon EKS runs the Kubernetes control plane for you across multiple AWS availability zones to eliminate a single point of failure. Amazon EKS is certified Kubernetes conformant so you can use existing tooling and plugins from partners and the Kubernetes community. Visit aws.amazon.com/eks to learn more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rEE1qtA3VlySHHkf.png" /><figcaption>Ref# 3: deployment architecture for AWS EKS</figcaption></figure><h4>Deployment architecture for Pega platform:</h4><p>When you are migrating your Pega application as container in a container platform, planning and sizing the deployment architecture is very important for the success of your application.</p><p>So work with Pegasystems or with your internal Pega architect for HW sizing based upon your application NFR, and then size your PODS and worker nodes of the container platform you are going to use to host your Pega application.</p><p>Don’t try to map or correlate pod/instance sizing of container platform with on-premises Pega installation or cloud based installation in bare-metal cloud computing resources.</p><p>Below is a typical and reference deployment architecture and sizing diagram for dev, QA, prod environment to host your Pega application. This needs to be fine tuned as per your HW sizing to support your application NFR.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ttTXpsqho68cE8ut-wXW4w.png" /><figcaption>Typical Pega deployment architecture and computing sizing in container platform, indicative only !</figcaption></figure><p>Note:</p><p>— You can assign the the Webtier, Batch/background tier, Stream tier, external service tier to different dedicated and specific worker node using nodeName, NodeSelector, PodAffinity. and that is the best practice for PROD. but keep under same NameSpace.<br> — in Prod, you can Create a background tier for BIX processing, with 1 pod with specification as background/batch pod. <br> — in prod, Create a dedicated tier for real-time data grid processing. with 1 pod with specification as background/batch pod. <br> — POD and resources for addon services (elasticsearch, fluentd-elasticsearch, kibana, ingress loadbalancer) have not been shown, please plan and calculate appropriately.<br> — POD and resources for The backingservices like ‘Search and Reporting Service’ (SRS) have not been shown, that you can configure with one or more Pega deployments.<br> — sperate planning and sizing needed for storage (file/blob/ssd) , which is not shown in that diagram.</p><p>For more details please refer below links</p><ul><li><a href="https://community.pega.com/knowledgebase/articles/client-managed-cloud/85/understanding-pega-deployment-architecture">https://community.pega.com/knowledgebase/articles/client-managed-cloud/85/understanding-pega-deployment-architecture</a></li><li><a href="https://github.com/pegasystems/pega-helm-charts/tree/master/charts/pega">https://github.com/pegasystems/pega-helm-charts/tree/master/charts/pega</a></li></ul><h3>Best Practices</h3><h4>Application Level best practices:</h4><p><strong>1. Don’t do it just because you can</strong></p><p>Make sure your decision to containerize an existing monolithic Pega application and operate it with Container platform/Kubernetes is a sound choice. Don’t do it just because you can, Migrate existing Pega applications into containers with a long-term vision in mind. Moving to containers and Kubernetes just for the sake of doing it can actually introduce a lot more scope and technical challenges, depending on the applications and the teams running them.</p><p><strong>2. Seriously consider refactoring your application</strong></p><p>If you’re going to migrate a monolith to containers and run it with Kubernetes, do your due diligence on refactoring the application to maximize the benefits of such a move. Containers can be used for ‘lifting and shifting’ existing applications, but in order to enjoy their benefits, you should consider refactoring them.</p><p>Don’t think of it as moving to containers and Kubernetes; think of it as decomposing the application.</p><p>Run the Pega cloud readiness tool to access refactoring needs of your Pega application.</p><p><a href="https://community.pega.com/marketplace/components/pega-cloud-readiness-tool">https://community.pega.com/marketplace/components/pega-cloud-readiness-tool</a></p><p><strong>3. Make your Pega application cloud native</strong></p><p>Consider whether to start with an older application and refactor, OR better to create a new application to get most of the cloud and container benefit. You may have newer applications which are easier to maintain and update than some of your older applications</p><p>Assess your current Pega application based on 12-factor-app benchmark and perform the refactoring to make your Pega application true cloud native, otherwise you may migrate your Pega application in the container but will not get the true benefit of container/cloud features.</p><p><strong>4. Plan for observability, telemetry, and monitoring from the start</strong></p><p>Make sure troubleshooting data is available if the container itself isn’t. It is very important to have your planning and set up for observability, telemetry, and monitoring in new application development for containers and Kubernetes.</p><p>If it wasn’t originally designed for containers, you’ll need to think about how you will troubleshoot issues when they arise. Don’t figure this out after you’ve containerized the application.</p><p>Many applications not designed for containers use local logs to store troubleshooting and other information. If the application goes down, operations folks will often log into the machine and look through the logs. In the container world, if the container is down there’s nothing to log into.</p><p><strong>5. Create a migration framework</strong></p><p>The more structure you can create for this process, the better. you should have a plan and strategy in place to iteratively modularize, containerize, and run at scale. If required, doing a Pilot will be a wise step.</p><p><strong>6. Don’t blindly trust and reuse Pega images</strong></p><p>Don’t make the mistake of having blind faith in Pega container images, especially not from a security perspective. If required, build your own image on top of Pega provided image keeping your compliance, security, logging in mind.</p><p>At the same time try to keep your container image as light as possible, Only include what you absolutely need.</p><p>And plan for hosting those images in your private image repository, with proper version control and tagging.</p><p><strong>7. CI/CD and automation are critical for success and sustain</strong></p><p>Automation is a critical characteristic of container orchestration; it should be a critical characteristic of virtually all aspects of building an application to be run in containers on Kubernetes. Otherwise, the operational burden can be overwhelming.</p><p>A well-conceived CI/CD pipeline is necessary for deploying, running and maintaining Pega application in Container platform.</p><h4>Platform level best practices:</h4><ul><li>Use liveliness and readiness checks.</li><li>Do proper HW and POD sizing based on application NFR.</li><li>Fine tune compute sizing and optimize via performance test</li><li>Security and vulnerability checking</li><li>Work out the enterprise integrations — These include single sign-on (SSO), authentication and authorization, monitoring, security, ACL governance risk compliance, and more.</li><li>Don’t ignore your Database migration and associated strategies.</li></ul><h4>Operational best practices:</h4><ul><li>Perform detail analysis before starting migration to container.</li><li>Plan for a balanced team for migrating your Pega solution to Cloud/Container services. Sample roles are below:<br>- System administrator<br>- Application developer<br>- Network engineer<br>- Database administrator<br>- Project manager/program director<br>- Product owner/business owner<br>- Application architect<br>- Performance engineer</li><li>Plan and execute skilling of your resources on a container platform.</li><li>Better to upgrade first for the version 5 &amp; 6 application to 7 or 8 before migrating to container.</li><li>Better not to associate other major activities (Pega upgrade, major functional change, new integration, etc.) along with container migration.</li><li>Plan and practice DevoOps culture, only migrating to container will not bring full benefits.</li></ul><h3>Next steps</h3><p>Containerizing your applications is only your first step toward taking advantages of the opportunities afforded by cloud computing. In my next article, we’ll discuss <em>microservices, </em>which provide a means by which you can decompose a monolithic application into smaller, more manageable, independently developed pieces.</p><blockquote><strong>Note:</strong> Opinions and approaches expressed in this article are solely my own and do not express the views or opinions of my employer, Pegasystems or any other organization.</blockquote><blockquote>Some of the product names, logos, brands, diagram are property of their respective owners</blockquote><blockquote><strong>Please:</strong> Post your comments to express your view where you agree or disagree, and to provide suggestions.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a64a909f6aa7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud Native Design Pattern — Implementing in Pega PRPC]]></title>
            <link>https://conchchow.medium.com/cloud-native-design-pattern-implementing-in-pega-prpc-4c1265b120ca?source=rss-e180c0f35569------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c1265b120ca</guid>
            <category><![CDATA[external-config-store]]></category>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[pega-prpc]]></category>
            <category><![CDATA[pega]]></category>
            <category><![CDATA[design-patterns]]></category>
            <dc:creator><![CDATA[Shankhabrata Chowdhury]]></dc:creator>
            <pubDate>Sat, 17 Oct 2020 07:37:42 GMT</pubDate>
            <atom:updated>2020-10-17T07:37:42.757Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cloud Native Design Pattern —Implementing In Pega PRPC …</h3><h4>“External Configuration Store” — Pattern</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XfGW56r5vR-fEuoaiF0hmw.png" /></figure><p>Configuration is anything that varies/changes between deployments to different environments. It is suggested that store config in an environment not within your code base. These configurations which change with time and target environments, requires strict separation of config from code and<strong> </strong>should not be placed/maintained in the application code or any config file in the package bundle, rather it should be in external central config server/repo.</p><h3>Problem Statement :</h3><p>Majority of the Pega applications maintain configuration in local Pega Data Table (Data Store), DSS, RSS, DataTransform, which are deployed to different target environments along with the application ( as part of product rule package extract). And in most of the cases, it is edited after deployment to change that environment specific configuration. But this approach against the cloud native design principle (please refers <a href="https://12factor.net/config">this </a>link for details) and not sustainable in true cloud native platform, because of below</p><ul><li>This approach results in unnecessary downtime, because application users should not access the application unless those configuration changes are complete in the target environment, even if the deployment is complete.</li><li>Sometimes you may need to restart the server/node after the config changes.</li><li>Need human touch after the deployment for those config changes, which restrict you from implementing zero-touch automated platform provisioning and application deployment. Also will be a road block for auto-scaling of your Pega application instances.</li><li>Has administrative and operational overhead. Hard to manage and control of configuration.</li><li>Generally don’t support different versions of the configuration ( except Pega RSS, or any custom rule you created for config storing), so rolling back again a manual task to perform. Against the automated rollback.</li><li>Local configuration (within application code/package) limits the configuration of a single that specific application, hard to share among applications for common configuration.</li></ul><h3>Solution :</h3><p>Store the configuration in the external store/storage system which should provide an easy and efficient interface to read the configuration from Pega application code.</p><p>The type of external store/storage depends on the hosting and runtime environment of your Pega installation/instance. You can use a public or enterprise Git or cloud based storage servicer or it could be a database. Choose an external store/storage system which has at least below characteristics.</p><ul><li>It should expose the config information in readable, correctly and in structured format (json, xml, yaml, etc.) and in a secure manner.</li><li>Has an easy and efficient interface (REST, SOAP) to fetch information.</li><li>Provides mechanism to authenticate and authorize access to protect configuration data. It should support strict separation between the read and write permission of configuration data.</li><li>Should support storage of multiple versions of the config data.</li><li>It might be helpful if it supports review management process, to administrate config data change.</li><li>It might be helpful if it has any caching mechanism, it is nice to have features.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*wB5QVk-6UJvFfz0C6Qle0g.png" /><figcaption>strict separation of config from code</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*U4CJog5zsdd96dHxKPhehQ.png" /><figcaption>Store config in external store/storage system, and fetch from Pega application.</figcaption></figure><h3>When to use this pattern :</h3><p>This pattern is useful for</p><ul><li>Your Pega application will be deployed automatically and in an auto-scaling platform where you will not get a chance to change configuration after deployment which will happen in any environment and in any number of instances. Zero touch and auto scaling deployment is your goal.</li><li>You want a version management of the configuration setting to track changes and also utilize during rollback via DevOps pipeline in case of failure due to new configuration values.</li><li>You want to keep a strict review process of the configuration change as your Pega application is sensitive to those configurations. Keeping configuration in Git will allow you to utilize the reach feature of Git such as branching, Pull Request and merge, etc. to enforce a strong review process for any change in config.</li><li>When your configuration is shared among many Pega applications and that configuration is frequently changing. ( e.g. trading rate, currency rate, daily rotating manager for set of groups, etc.)</li><li>When you want your configuration management to be abstracted from application developers. Your Pega application developer should concentrate on the Pega application code rather than setting, storing, changing configuration. A way of simplifying administration/operation of multiple applications.</li><li>Need of a complementary store for some of the settings/config for application, allowing application to override some or all of the centrally stored settings.</li></ul><h3>Possible implementation techniques :</h3><p>There could be different ways of implementation of this external config store pattern, but the below few points are common in any approaches you take.</p><ul><li>Configuration needs to be stored in an external central versionable repository.</li><li>Single common repository to store configuration related to a specific application deployable in any environment. There should not be a different repository environment for different Pega applications or different for different target environments ( DEV/SIT/QA/PROD).</li><li>At the end, it needs to be loaded in the Pega Data Page ( preferably Node level), which will be referred from different sections of your Pega application code.</li></ul><p>Below are the different possible implementation techniques, out of which we will discuss a few in detail.</p><ul><li>Storing config in GitHub, fetching from Pega via REST connector.</li><li>Storing in GitHub, Git clone in local storage volume, read via PRFile or FileInputStream.</li><li>Storing in GitHub, map to ConfigMap, read via PRFile from Pega function.</li><li>Store in Openshift ConfigMap, read via PRFile from Pega function.</li><li>Store in JFrog/ AWS S3, fetch via Pega Repo or connector.</li></ul><h4><strong>Implementation Sample 1 :</strong></h4><p><strong>Storing config in GitHub, fetching from Pega via REST connector</strong></p><p>Whether your Pega instance is deployed as a container in Kubernetes platform or deployed in bare metal physical box /VM, this approach can be taken in your Pega application for any possible Pega installations.</p><p><em>Step1:</em></p><p>Choose your choice of public or enterprise git repository ( gitHub, bitbucket, etc). and keep the configuration file in the master branch. Use private mode of the repository.</p><p>Keep an indicator (dev, prod, QA ..) in the filename to identify the target environment where those specific config files will be used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gdEqxqDwj91R3RChnipMOw.png" /><figcaption>Config file in a private repository in Git.</figcaption></figure><p>Make sure the environment indicator in the file name match with the production level name of your Pega system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*SGAR-MUchALh2n7iGFywrA.png" /><figcaption>Production Level Name of your Pega Instance.</figcaption></figure><p><em>Step 2:</em></p><p>Keep the content of the config file in json format (preferably), Define the structure and keys as per your application requirement. Below is a sample of the content of the config file for DEV and PROD environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JLvRcsyhNwMDhKksKf_19Q.png" /></figure><p><em>Step 3:</em></p><p>Setup Developer setting in GitHub to generate Personal Access token or OAuth token, which will be used to authenticate while fetching the content in Git from your Pega application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1dkgdnwoZ4vfUri5AW_b1g.png" /><figcaption>Configure you access token in Git.</figcaption></figure><p>While connecting GitHub to fetch the file content, you can use <a href="https://docs.github.com/en/free-pro-team@latest/rest">GitHubAPI</a> (https://api.github.co) or directly access using the file raw url (<a href="https://raw.githubusercontent.com/">https://raw.githubusercontent.com/</a>…)</p><p>We will use raw file url here as example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wuxHVT0Xceugtztpf4Ql5g.png" /><figcaption>Git raw url for file access.</figcaption></figure><p>And check via Postman or SOAPUI, whether you are able to fetch the config file from gitGub, via REST.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TlFOMbuDuggOxFn2RGvQEQ.png" /><figcaption>Sanity check from Postman</figcaption></figure><p><em>Step 4:</em></p><p>Now build the required class, a rest connector, data transform ( may be using Pega REST Connector wizard) in Pega. And create a DataPage sourced from that REST connector.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HzDPXzALmIbz_fGimpnPGw.png" /><figcaption>DataPage to hold the configuration, calling the Git to get the config</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VGVd1jAKMQEyF3Lh9K8LOg.png" /><figcaption>REST connector, filename as dynamic. And authorization token as header</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gf3UxEYef0dVFy5hb5gHog.png" /><figcaption>Build the config filename dynamically based upon the ProductionLevelName</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*29zXoweoUzlA3nSMiG3c2g.png" /><figcaption>Final DataPage in clipboard view, which will be used from your application code.</figcaption></figure><blockquote>Note: don’t keep secrets or password related configuration in the Git, use Vault from Hashicrop or similar tools.</blockquote><p>The url of the Git repository and the security token you can pass as JVM argument. Read that argument from the Pega function using System.getProperty() and pass it to REST connector either as parameter or as Global Resource Syntax (GRS).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zgZj8O8AiZqR_ifdeJwrJw.png" /><figcaption>Pass the central external git url and access token via JVM parameter</figcaption></figure><blockquote>……………………………………………………………………………………..</blockquote><h4>Implementation Sample 2:</h4><p><strong>Storing config in GitHub, Git clone in local storage volume, read via PRFile or FileInputStream (from Pega Function).</strong></p><p>When your Pega instance is deployed as a container in Kubernetes platform then this approach can be taken in your Pega application.</p><p><em>Step 1: Step 2: Step 3:</em></p><p>Follow the same steps 1,2,3 mentioned in the Sample-1 (above) to configure private git repo and the configuration file specific to each target environment and the config file in json format.</p><p><em>Step 4:</em></p><p>To provision a container with a git repo, mount an <a href="https://kubernetes.io/docs/concepts/storage/volumes/#emptydir">EmptyDir</a> into an InitContainer that clones the repo using git, then mount the <a href="https://kubernetes.io/docs/concepts/storage/volumes/#emptydir">EmptyDir</a> into the Pega Pod’s container.</p><p>Customize the the Pega StateFulSet object, to perform below 3 steps</p><ul><li>Create a volume of type EmptyDir ( temp volume).</li><li>Using InitContainer, git clone your repo in that newly added volume.</li><li>Mount the volume in the Pega container.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*gRc85rcFGwpUMPprKJ1Lbg.png" /><figcaption>Create a volume of type EmptyDir {}</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SdK282kOFa0IVlXtoLvTxQ.png" /><figcaption>Using InitContainer, git clone your repo in that newly added volume. Use the git access token to authenticate.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*i0S39gMmqrjz_gWgBTOU1g.png" /><figcaption>Mount the volume in the Pega container</figcaption></figure><p>Validate and ensure that the cloning has been done successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nBA3FsVvysxeUHM7yJPssw.png" /><figcaption>all config files downloaded into container volume</figcaption></figure><p><em>Step 5:</em></p><p>Now this volume mounted at container level will be available to Pega application as file path, for use from the Pega application.</p><p>Perform below steps in your Pega application to fetch the file content.</p><ul><li>Using a custom Pega function read the file content.</li><li>Write a DataTransform to call that function to fetch file content and use the out of the box pega function pxConvertStringToPage to parse the json.</li><li>Create a DataPage to call this DataTransform to populate the config, which will be used from your application code.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6JJ-SvfRjByNCkEUzrRB7Q.png" /><figcaption>Pega custom function to read the config file from the volume path</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Qh2Tze136TTt7s5ap6Rng.png" /><figcaption>Data Transform 1st step — to determine config filename based on ProductionLevelName</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZXTx6_zPNOZKdd3nM7k2Aw.png" /><figcaption>Data Transform 2st step — to call the custom function to fetch config file content from volume, and 3rd step to parse the json content in step page which will be copied in caller DataPage.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j9YVsmXkIH-ucvZK3O99mA.png" /><figcaption>Data Page which calling the DataTransform and will hold the config values.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CxnoZTXk6APQo0aL2ec-ZA.png" /><figcaption>Final DataPage in clipboard view, which will be used from your application code.</figcaption></figure><blockquote><strong>Thought Tablets:</strong></blockquote><blockquote>Below are some points for your design thinking and finding a solution, Please share your thoughts as comments.</blockquote><blockquote><strong>-&gt;</strong> Why not to use Pega Application Settings ( Rule-system-settings) where you can provide different config values based on the production level (dev, qa, prod, etc), why need to make things complex as described in this article?</blockquote><blockquote><strong>-&gt; </strong>How changing in Git will automatically reflect in Pega App ? Do you need to restart Pega node/jvm/pod to get the new config reflected ? Do you need to flush the data page every time there is a change in Git? Automation possible?</blockquote><blockquote><strong>-&gt;</strong> if the External Configuration store is down or the config content contains error, then how will you handle the exception? hope you will not allow your application to stay down or auto scaling falling because the external configuration store/site is down.</blockquote><blockquote><strong>-&gt;</strong> In the above “Sample-2&quot; implementation, git url and token is hard coded in the satefulset manifest file, how to make it dynamic and encrypted?</blockquote><blockquote><strong><em>Note:</em></strong><em> Opinions and approaches expressed in this article are solely my own and do not express the views or opinions of my employer, Pegasystems or any other organization.</em></blockquote><blockquote><strong><em>Please:</em></strong><em> post your comment to express your view where you agree or disagree, and suggestions.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c1265b120ca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pega PRPC — is it Cloud Native or Cloud Aware ?]]></title>
            <link>https://conchchow.medium.com/pega-prpc-is-it-cloud-native-or-cloud-aware-f0a240d47ed?source=rss-e180c0f35569------2</link>
            <guid isPermaLink="false">https://medium.com/p/f0a240d47ed</guid>
            <category><![CDATA[pega]]></category>
            <category><![CDATA[the-twelve-factor]]></category>
            <category><![CDATA[distributed-minilith]]></category>
            <category><![CDATA[12-factor-app]]></category>
            <category><![CDATA[cloud-native]]></category>
            <dc:creator><![CDATA[Shankhabrata Chowdhury]]></dc:creator>
            <pubDate>Thu, 01 Oct 2020 14:36:38 GMT</pubDate>
            <atom:updated>2020-10-13T13:48:42.406Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Pega PRPC — is it Cloud Native or Cloud Aware ?</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*mmXda_OE131iemIp2wrDUA.jpeg" /></figure><p>Through this article I tried to explain my perspective on whether and how Pega PRPC platform or any application built on Pega PRPC can be considered as cloud native.</p><p>Let’s start with what my understanding about a platform/application as cloud native, In my opinion, Cloud-native architectures and application should support Speed of a Startup at the Scale of an Enterprise, with zero disruption to application user’s experience.</p><p>Some people strongly believe that cloud native application means ONLY those applications built with services packaged in containers, deployed as microservices and managed on elastic infrastructure, but I think a standalone and monolithic application can also be very near to cloud native, though can’t take full advantage of distributed and elastic cloud infrastructure.</p><p>Some people consider having below features of a application/platform to be considered as cloud native.</p><p>1. Containerized<br>2. Microservices<br>3. Horizontal Scaling <br>4. Service Mesh <br>5. API Driven<br>6. Service Discovery<br>7. Delivery Pipeline <br>8. Policy-Driven Resource Provisioning <br>9. Zero Downtime Deployment<br>and many more …</p><p>As you see many people may have different standards to evaluate cloud native application, I find <a href="https://12factor.net/"><strong>The Twelve-Factor App</strong></a> principle is the best measuring scale to measure whether a platform/application is cloud native or not (again some people believe 12-factor-app principle is only for microservice).</p><p>So let’s jump into the our main objective to find how Pega platform/application stands on the each factor of 12-factor-app principles to be consider as cloud-native.</p><p>During evaluation of Pega PRPC platform itself, I will also try to point out how/what you as developer/architect will consider while building your own Pega application to make it cloud native.</p><blockquote>Note: I will not go into detail of 12-Factor-App, please refer <a href="https://12factor.net/">this link</a> for details.</blockquote><h3><strong><em>I. Codebase</em></strong></h3><blockquote>One codebase tracked in revision control, many deploys</blockquote><p>Pega has its own mechanism to maintains codebase (rules) within itself along with versioning, and does not support external code base. Here your hand is tied, which is bad as well as good.</p><p>But still you can follow the 1st factor/principle by maintaining Pega repository on an SOR, where a separate Pega instance will act as System Of Record repository to host ruleset version centrally.</p><p>Or via keeping the product jar in external artifactory (JFrog, AWS S3, etc), which is not exactly the version control system for codebase but a repository of deployable code to any other environment at anypoint.</p><p>below are some samples for bad and good practice in Pega for maintaining codebase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*ToOVMzcP2F-qSZOPqzF1DQ.png" /><figcaption><strong>BAD </strong>Practice (different repository for different environment for same application)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*jW0eIH5a3n2Xdby-pFn3xA.png" /><figcaption><strong>BAD </strong>Practice ( Same repository for Different applications)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*msRXq0tgogEJY2g8lZWnVA.png" /><figcaption><strong>GOOD </strong>Practice (one repository per application to deploy to all environments)</figcaption></figure><p>When you are keeping the product extract JAR/ZIP in a central repository (jfrog, S3) keep it in separate folder ( may be named with Pega application name and version, which will work as versioning) for each different application.</p><p>Even for any reusable or component application , create separate application product in Pega and keep the product extract separately in repository/artifactory.</p><p>So for Pega, not the code/rule base but the code extract package maintain in central repository ( may be after fully unit tested or system tested), and use that same repository as source of code to deploy in any higher environments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/232/1*UvhP3-egemxgABrCRmOMpA.png" /><figcaption>Score: 9/10</figcaption></figure><h3>II. Dependencies</h3><blockquote>Explicitly declare and isolate dependencies</blockquote><p>A twelve-factor app never relies on implicit existence of system-wide packages or system tools. Never depend on the host to have your dependency. Application deployments should carry all their dependencies with it.</p><p>While these tools/Packages/binaries may exist on many or even most systems, there is no guarantee that they will exist on all systems where the app may run in the future, or whether the version found on a future system will be compatible with the app.</p><p>So it is suggested that if your application has any dependency to run your application, those dependency should be isolated from your code and should be explicitly install/deploy while your are deploying your application code.</p><p>Pega core platform already follow this approach in their container image to explicitly fetch/download the required package/tools/binaries (e.g. log4j, tomcat binary, Elasticsearch, etc).</p><p>If you are planning to create your own image on top of Pega OOTB , then you should explicitly fetch/include (using FROM, curl, pip, etc.) the system package/tool you need ( e.g. EFK, ELK plugin, JDBC driver, etc.) in the docker file.</p><p>Now for the Pega application which your are building to run on Pega PRPC, there also you have to consider few points on dependency management to make it cloud native. Below are some examples which you should consider as dependency during every deployment.</p><p>&gt; Base application product which includes base application code, including all required data instances — (golden copy).<br> &gt; Any external jar/library.<br> &gt; Any configuration setting (maintain in DSS, Data Table or RSS) to hold environment specific configuration, external system’s service endpoint etc.<br> &gt; Any component ruleset or application.<br> &gt; etc. if any.</p><p>All these dependency should be in external repository ( git, jfrog, S3), and your deployment ( most preferably via CD pipeline) should</p><p>&gt; First deploy the golden version/copy product and then all delta product.<br>&gt; Fetch and deploy the product extract any component ruleset or application.<br>&gt; Fetch and deploy your release specific delta code as product extract.<br>&gt; Fetch and deploy external dependency from external repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/230/1*ES3BW3mTf3dibp1o1u8Zag.png" /><figcaption>Score: 10/10</figcaption></figure><h3>III. Config</h3><blockquote>Store config in the environment</blockquote><p>Configuration is anything that changes between deployment environments. Also configuration of your dependencies which we discussed in Factor 2.</p><p>It is suggested that store config in environment not within your code base.</p><p>prconfig.xml, DB connection details, Credential, SSL Certificate, External server endpoint url, Pega application specific configuration mentioned in Data table or DSS, Service account information, credential to external services, etc. , these all are example of configuration and should be strictly separated from your code.</p><p>These configurations which change with time and target environments, should not be placed/maintained in the application code or any config file in the package bundle, rather it should be in external central config server/repo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*wB5QVk-6UJvFfz0C6Qle0g.png" /></figure><p>Pega PRPC as base platform as container image has all necessary configuration exposed as environment variable, which should be mapped from kubernetes configmap or secrets object. and those configmap/secret should be fetched/synched from github/vault using available mechanism in kubernetes ( gitRepo, git-synch, git cloning in local volume etc). Same concept applicable if you create your own image on top of Pega PRPC OOTB image.</p><p>For Pega application, keep the configuration in git or any central repository in xml/json format and mapped for different environment, ( don’t keep password or secret in git, keep in secret key manager tool) and call that from Pega Data Page. Use that data page in your code where you need to refer those configuration value. or using many other different implementation approaches.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/230/1*ES3BW3mTf3dibp1o1u8Zag.png" /><figcaption>Score: 10/10</figcaption></figure><h3>IV. Backing services</h3><blockquote>Treat backing services as attached resources</blockquote><p>A backing service is any service the app consumes over the network as part of its normal operation. Examples include datastores (such as Oracle, PostgreSQL or Cassandra), messaging/queueing systems (such as IBM MQ or Kafka), SMTP services for outbound email (such as Email Exchange), and caching systems (such as Memcached). And even endpoint of external service (API-accessible consumer services) could be treated as backing service for your Pega application.</p><p>For a twelve-factor-app these backing service should be treated as separate distinct attached resources and information ( connection related information) and should be stored in config, so that deploy of the twelve-factor app should be able to swap out those resources to different environments without any changes to the app’s code.</p><p>Pega PRPC as platform mostly support these concept and you can provide url/config of below service as environment variable or JVM parameter and change the value for different deployment to different environment.</p><p>&gt; External Elasticsearch (Search)<br>&gt; Cassandra / DDS (Datastore) <br>&gt; Stream (Kafka) — customer’s data intake</p><p>But in case of Database, I think Pega does not comply with this factor fully. Due to it’s core architectural design, Pega keeps both code/rules and transactional data in database.</p><p>So any day if I want to swap out a local PostgreSQL database with one managed by a third party (such as <a href="http://aws.amazon.com/rds/">Amazon RDS</a>) without any changes to the Pega platform level code, will not be very smooth, as the rules/code need to be also migrated to new database.</p><p>If you are building a Pega application which interface with any system, it is recommended that you should consider those external system/service ( e.g. MQ, external REST service, SMTP etc.) as attached resource and maintain as external configuration as explained in Factor “3-Config”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/232/1*a74fQ22CxzxFlgfQOyD9JQ.png" /><figcaption>Score: 7/10</figcaption></figure><h3>V. Build, release, run</h3><blockquote>Strictly separate build and run stages</blockquote><p>This principle about separating the three stages of building, releasing, and running. Start the build process by storing the app in source control, then build out its dependences. By separating the config information you can combine it with the build for the release stage — and then it’s ready for the run stage.</p><p>Let’s discuss this factor in 2 parts. One for Pega Platform deployed as container and second the application build on Pega Platform.</p><p>For Pega core Platform …</p><p>&gt; The <em>build stage — t</em>ake the Pega platform OOTB docker image to use as it is, and you don’t need any build stage. But if you are planning to crate your own container image on top of Pega provided, then maintain a code repo ( for docker file, dependencies, etc.), and then converts the code repo into an executable bundle known as a <em>build, by </em>fetching vendors dependencies and compiles binaries and assets. And push/keep in docker hub or in your enterprise image repository.</p><p>&gt; The <em>release stage — </em>takes the build produced by the build stage (container image from docker hub) and combines it with the environment specific config (e.g. stored in kubernetes object like configmap, secrets, etc.)<em>, </em>and is ready for immediate execution in the execution environment ( kubernetes platform<em>).</em></p><p>&gt; The <em>run stage</em> (also known as “runtime”) — and run the release Pega container image in the execution environment (Kubernetes based platform like OpenShift, EKS, etc.)</p><p>For Pega Application, you have to consider below to be compliant with this factor …</p><p>&gt; The <em>build stage — </em>You should be able to build a jar, zip of extract of any format, as releasable component which is independent of the environment. Those build extract/package component should not change from one environment to another environment. Here you as Pega application developer have great relief, because Pega platform do this for you in form of Product rule to create jar/zip extract of your Pega application code.</p><p>But you have to consider below points.</p><p>If you are creating DevOps pipeline for CI and CD, then CI pipeline should be independent of CD pipeline.<br>Think Build and Release (deploy/run) as 2 independent activities. Branching, merging, extracting product jar and storing in repository/artifactory should be part of CI and should not include the deployment part. And the CD part should only include the Deployment part.</p><p>Follow the “Factor 2: Dependency” and “Factor 3: Config” to externalize any environment specific/dependent dependencies and configuration</p><p>&gt; The <em>release stage —</em> take the build (Pega application product extract) from a single common repository/artifactory and release to different environments, and preferably via a CD pipeline in automated manner.</p><p>You can choose a external deployment tools which offer release management, and ability to roll back to a previous release (use PRPCUtil instead of Pega OOTB REST api for deployments).</p><p>Try that every release should always have a unique release ID. ( Use Jenkins or other tool)</p><p>&gt; The <em>run stage — </em>here you as application developer, do not need to consider any specific, because run time environment will be managed by Pega Platform itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*o84xFyfm4U1-XZUizbDF5g.png" /><figcaption>Score: 9/10</figcaption></figure><h3>VI. Processes</h3><blockquote>Execute the app as one or more stateless processes</blockquote><p>The idea is that the process should be stateless and shares absolutely nothing. Processes should be stateless, means if it crashes it should not take anything important with it. ( e.g. session data, transactional data in local memory or filesystem, trans etc.).</p><p>Two applications should not share anything between them, if need to be shared and persist that should be via endpoint of external stateful backing service or attached resources, such as databases or caching system.</p><p>Pega platform uses “sticky sessions”, storing information in the session expecting the next request will be from the same user/service contradicts this methodology.</p><p>Pega as platform rely on session affinity, so does not support this principle.</p><p>When you are building your Pega application, you can’t do much on this principle, as session/state management is done by Pega Platform and Pega application has no control over it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/228/1*aYfEc5Nb3VTTjgBHtzu0Cw.png" /><figcaption>Score: 0/10</figcaption></figure><h3>VII. Port binding</h3><blockquote>Export services via port binding</blockquote><p>Each Service must expose itself on a port number, specified by the environment variable. This factor is more applicable for micro services, where each service should bind to different port and by themselves.</p><p>Pega platform while running on Kubernetes, the image has its onw app server embedded within the docker/pod and exposed via port binding which you can control as environment variable in config. Similar way other supporting services in Pega platform ( cassandra, kafka, elastic search) are also tagged with ports configurable via config variable.</p><p>As Pega application developer, you can’t do much, because while you are creating any application or REST/SOAP service, you can not define or bind to specific ports of your choose. It get exposed to the default port where the underline Pega platform service is tagged to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*a74fQ22CxzxFlgfQOyD9JQ.png" /><figcaption>Score: 7/10</figcaption></figure><h3>VIII. Concurrency</h3><blockquote>Scale out via the process model</blockquote><p>A true 12-factor app is designed for scaling. Build your applications so that scaling them in the cloud is seamless. When you develop the app to be concurrent, you can spin up new instances to the cloud effortlessly. In order to add more capacity, your app should be able to add more instances (Horizontal scaling) instead of more memory or CPU on the local machine (Vertical scaling).</p><p>The process model truly shines when it comes time to scale out. The share-nothing, horizontally partitionable nature of twelve-factor app processes means that adding more concurrency is a simple and reliable operation. So the application must also be able to span multiple processes running on multiple physical machines.</p><p>Each container pod/EC2/jvm instance should dedicated for each separate application and if possible each specific dedicated job/process ( frontend, backend, batch job/agent, streaming, search index, etc.), so that proper concurrency and scaling can be achieved independently. The new Pega Platform (v8.x) support this model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*-RKpIxvH158pXkh0-AQjow.png" /><figcaption>Pega nodes deployed into various tiers and services in a network topology (Reference: Pega.com)</figcaption></figure><p>Pega platform provides option for deployment of separate container for search, background processing, web/frontend load, etc. shown in the image. And each of these component supports scaling, concurrency and disposability mechanism.</p><p>Few samples consideration while you are building your Pega application,</p><p>&gt; Keep separate service package and URI path for separate group of services (REST/AOP) you are building. Don’t put all functionally unrelated services under same URI path /ServicePackage.</p><p>&gt; If you planning to host 2 different Pega application on same Pega platform/instance, plan for separate access URL for accessing those application, via DNS record at load balancer level, or using Kubernetes service or Pega servlet overriding, so that at pod/JVM/node level you can scale independently for 2 different Pega applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/230/1*o84xFyfm4U1-XZUizbDF5g.png" /><figcaption>Score: 9/10</figcaption></figure><h3>IX. Disposability</h3><blockquote>Maximize robustness with fast startup and graceful shutdown</blockquote><p>Servers/hosts/nodes/JVMs should not be treated as pets, it should be treated as cattle.</p><p>The concept of disposable processes means that an application can die at any time, but it won’t affect the user — the app can be replaced by other instances of same app, or it can start right up again. Building disposability into your app ensures that the app shuts down gracefully: it should clean up all utilized resources and shut down smoothly.</p><p>App/platform built on this principle, supports quick start, resilience to failure, graceful to shutdown and compensation action (resilience) in case of any failure.</p><p>As the Pega Platform is stateful in nature ( it demands sticky session / session affinity), Pega for it’s architectural nature does not support disposability ( auto de-scaling) without impacting user’s experience.</p><p>After disposition of a node, Pega does not transfer session/in-memory data from disposed node/pod to newly activated node/pod. Through load balancer you can control not to send new user load to the disposed node, but Pega platform does not support native mechanism to quickly transfer those session or externalization session via external caching system ( Redis/ Memcached). Pega has some on demand quiescing mechanism for passivation and activation ( via external DB) but that is not quick/spontaneous.</p><p>So in principle Pega as platform does does not follow cloud native disposability function.</p><p>It would be great if Pega maintains session in a external caching system (Redis/Memcached) shared among all nodes/pods.</p><p>So while Pega platform can scale out as per factor “8-Concurrency”, but when the times come for scaling down, due to the stateful nature it does not support factor “6-stateless process” and this factor “9-disposibility” ( without impacting user’s experience)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/230/1*E-a7-tpctWOkj2WVo1E4xA.png" /><figcaption>Score: 2/10</figcaption></figure><h3>X. Dev/prod parity</h3><blockquote>Keep development, staging, and production as similar as possible</blockquote><p>It ensure that you don’t face new problem in production, and if any problem in your application or platform you should face that earlier while you are in dev</p><p>For Pega, it supports and you should use container and external centralize code base to keep the all environments in synch and ready on demand. So that your Peg application along with the Pega platform should be ready to achieve the state Dev= Stage = Prod, anytime and instantaneously.</p><p>If anything is different across the environment, then that should be declared as dependency, attached resource or as configuration.</p><p>If we follow the previously discussed factors “1-Codebase”, “2-Dependencies”, “3-config”, “4- backing services”, then automatically we can achieve this factor of “Dev/Prod Parity” easily in Pega.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/230/1*ES3BW3mTf3dibp1o1u8Zag.png" /><figcaption>Score: 10/10</figcaption></figure><h3>XI. Logs</h3><blockquote>Treat logs as event streams</blockquote><p>A twelve-factor app never concerns itself with routing or storage of its output stream. Archival destinations should not visible to or configurable by the app, and instead are completely managed by the execution environment.</p><p>Redirecting the output of your application to a file allow the environment control what to do with the logs because the application doesn’t necessarily know the environment that it will eventually run within. Furthermore, by treating all logs as an event stream, you leave the choice of what to do with this stream up to the environment.</p><p>It gives visibility and traceability in logs even an environment/pods or the ephemeral storage in cloud is disposed or many instances running the same service. It also help in real-time monitoring and event automation in aggregate manner via external tools (e.g. splunk).</p><p>Pega Platform streams, stores, rotates logs in log files in respective nodes, when you are running Pega as container, using the sidecar or adaptor pattern pass the Pega logs to external log aggregator/indexing/searching/analytics tools (e.g. Fluentd, Logstash, Splunk, etc).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/230/1*ES3BW3mTf3dibp1o1u8Zag.png" /><figcaption>Score: 10/10</figcaption></figure><h3>XII. Admin processes</h3><blockquote>Run admin/management tasks as one-off processes</blockquote><p>Separating administrative tasks from the rest of your application, so that you can run admin process just like other process. These tasks might include migrating a database or inspecting records. Though the admin processes are separate, you must continue to run them in the same environment and against the base code and config of the app itself. Shipping the admin tasks code alongside the application prevents drift.</p><p>Some example of such one-off (but repetitive/regular in nature) administrative or maintenance tasks are as below,</p><p>&gt; Running database migrations.<br> &gt; repair some broken item.<br> &gt; once a week move database records older than N days to cold storage.<br> &gt; Every day email a report to manager.</p><p>Pega as platform support this factor/principle for some of its admin kind of tasks.</p><p>&gt; Code build &amp; deployment ( application import/export) Pega Platform provides tool/wizard from the developer portal which is platform code within the application/platform itself.<br>But along with that Pega also provide PRPCUtil which is external batch/shell script/tool outside of the Pega code/platform. This one is good example of admin/malmanagement task/code which is outside of the core platform app code instead of trying to incorporate into platform code.</p><p>&gt; BIX, SMA can be also treated as another admin/management tasks as one-off processes, available as outside of the core platform code.</p><p>Still there are some area where you have to be within Pega platform to perform below admin task, means the admin task/process written in the platform code itself <br> &gt; repair/requeue Broken item/queue<br> &gt; modification of business delegated rules<br> &gt; OOTB case purge/archive module<br> &gt; report scheduler</p><p>Similarly in your Pega application if you have any requirement of any admin/management tasks, then build that in such a way it is repeatable, and out side of your application. Few examples are as below</p><p>&gt; If you have to truncate/purge/mode some records from a Pega table weekly/monthly, rather than creating a Pega agent, try to utilize Oracle store proc and scheduler.<br> &gt; Even you are forced to run a Pega agent within your application, plan to run those in separate dedicated background node as a separate independent task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/232/1*a74fQ22CxzxFlgfQOyD9JQ.png" /><figcaption>Score: 7/10</figcaption></figure><h3>Wrapping Up</h3><h4>So in my opinion, Pega Platform and the application build on Pega is not Cloud Native but it is very much Cloud Aware (compatible).</h4><p>While microservice based application is best as cloud native, and monolithic is worst (as per latest perception trend), it is not necessary that you have to take the extreme side of the either while building Pega application. You can build Pega application as Distributed Minilithic and sticking to most of the 12-factor-app principles for being cloud native (at least cloud aware). [I will publish another article soon on “<strong><em>Distributed Minilith</em></strong>”]</p><p>Also, for being a true cloud native platform, not only the 12-factor-app principles at application/platform level is must, but also you need cloud native run time layer, cloud native storage, cloud native networking which are out of scope of this article/discussion.</p><blockquote><strong>Note:</strong> Opinions expressed in this article are solely my own and do not express the views or opinions of my employer, Pegasystems or any other organization.</blockquote><blockquote><strong>Please:</strong> post your comment to express your view where you agree or disagree, and suggestions.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f0a240d47ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>