Sitecore Zero-downtime deployments – Part 4

Sitecore PaaS/AKS blue-green deployments

With modern and mature DevOps, we all want smooth, sleek and painless automated deployments with zero-downtime. Sitecore deployments are no exception. Have you embraced zero-downtime deployments? This is not a new topic. If you look around Sitecore community, you see an odd question popping here and there regarding this topic.

The journey towards achieving zero-downtime deployments for any application in fact starts with your code base. So, in this series of blog posts, we will refresh ourselves on concepts like “Code Freeze” and the CI/CD process before deep diving into implementing Sitecore zero-downtime deployments.

Sitecore XP PaaS Blue-Green architecture

Sitecore XP PaaS reference architecture

The infographic above shows a typical Azure PaaS architecture for Sitecore XP scaled topology. In summary we have:

  • our Sitecore XP application roles such as CM, CD, ID among others
  • these role have access to Sitecore databases (master, web, core among others)
  • access to rest of the services such as Azure Key Vault, Azure Redis cache, App Insights, Azure Search among others

You will notice in this architecture, we have Blue-Web and Green-Web databases, which are corresponding to the BLUE-GREEN deployment slots for the CD App Service. We need separate web databases to enable us achieve content-safe deployments

The CM App Service also has BLUE-GREEN deployment slots specifically for code deployment, but with a shared master database. There is no compelling reason to have BLUE-GREEN master databases purely on basis of complexity introduced by such architecture (although it is not impossible to implement if you prefer this approach).

The rest of our XP scaled topology resources are shared

The Azure DevOps organisation typically will have access to run the CI/CD pipelines, is also included in the architecture.

How to manage settings

App Service Settings section can be leveraged to manage your Sitecore configuration settings including Sitecore connections Strings

Sitecore XP PaaS CI/CD process summary

Sitecore XP PaaS CI/CD process

Required steps:

  1. Tigger CD process
  2. Make copy of your web-db – this is for content safe deployment. Both CM and BLUE CD pointing to original web-db at this point. BLUE CD still in production with our live users accessing it
  3. Now deploy your new version to both CM instance and GREEN CD Staging slot instance – pointing them to use copy of web-db. Perform content deployment as usual, publish, rebuild the Sitecore indexes and perform any tests. This will not affect your BLUE CD at this stage.
  4. Once happy with deployment, then Swap CD production and staging slots. The GREEN CD with our new version is now production and our live users accessing it now. Zero down time achieved! Our previous version is still running in BLUE CD. If we have issues, we swap again to roll back.

Some notes:

 This example doesn’t have BLUE-GREEN for the CM instance, as I want to keep it simple – This though means your content editors will have to wait for deployment to finish to use the CM. If you really need CM zero down time, then you need to deploy CM BLUE-GREEN deployment slots as well. Alternatively, you can keep the deployment time to CM to a minimum and avoid BLUE-GREEN

You can be more also be creative with your Sitecore templates changes such that your changes are always backward compatible between successive releases  (e.g. don’t delete fields immediately, mark them as obsolete) This means you can safely rollback your changes without breaking the application

Sitecore XP AKS Blue-Green architecture

Sitecore using Containers makes use of Azure Kubernetes Service. This infographics shows a very simplified AKS blue-green strategy allows us to achieve zero downtime deployments.

Kubernetes Blue-Green strategy

How does it work?

  1. You will define a blue deployment for v1 and apply it to your desired state of your cluster.
  2. When version 2 comes along, you define a green deployment, apply it to your cluster, test and validate it without affecting blue deployment
  3. You then gradually replace V1 with V2
  4. Version 1 can be deleted if no longer needed.

Below we have a typical Sitcore XP Azure Kubernetes Service architecture for Sitecore XP scaled topology – the AKS cluster containing various pods running our containers.

Sitecore XP AKS Blue-Green reference architecture

You can see the scaled out Sitecore XP application roles running as individual Pods within this AKS cluster backed by a Windows Node Pool.

We also have access to Sitecore databases as well as other services such as Azure Key Vault, Azure Redis cache, App Insights among others.

I am showing our Azure DevOps organisations which will typically have access to run the CI/CD pipelines

Similar to the Azure PaaS architecture, AKS zero downtime deployments will make use of BLUE-GREEN deployment strategy for CD or CM instance

AKS Zero downtime deployments process

How do we do that? we don’t need to provision a separate cluster for GREEN environment. Instead, we define an additional GREEN deployment with its corresponding service and then label it accordingly, alongside our BLUE deployment.

For content-safe deployments, we will also be pointing to a copy of web database (Green) as shown.

Once we have tested and are happy with our new GREEN deployment, we switch traffic or routing to point to GREEN. We do this by updating our Ingress controller specification

Sitecore AKS Blue-Green (Green deployment)

In the above infographic, you can see now our end-users can access V2 in the GREEN deployment

BLUE deployment is on stand-by in case of roll back. And can be deleted if no longer required.

Note as previously discussed in PaaS deployments, you can implement BLUE-GREEN for the CM if required

Sitecore XP AKS CI/CD process

Sitecore XP AKS CI/CD process

Steps summary

  1. Trigger release pipeline process
  2. Make copy of your web-db – this is for content safe deployment. Both CM and BLUE CD pointing to web-db at this point. BLUE CD still in production with live users accessing it
  3. Apply your green deployment desired state onto the cluster. This creates the green pods with new version of docker images, and our Sitecore deployment including content deployment. This will use the copy of web-db we created earlier.  Publish and Rebuild indexes as usual and test and verify the deployment
  4. Once happy with deployment, Update traffic routing in Ingress Controller and live users can now access our new Sitecore version. In event of roll-back, update traffic routing in Ingress controller. If BLUE deployment no longer needed, clean it up to save on resources

Next steps

An this is a wrap. This post concludes this series of blog posts where we looked into implementing Sitecore Zero Downtime deployments. I hope you found this useful and can start your own journey towards achieving Zero Downtime deployments with your Sitecore workloads. If you have any comments or queries, please leave me a comment at the end of this post.

Sitecore Zero-downtime deployments – Part 3

Blue-Green Deployments

With modern and mature DevOps, we all want smooth, sleek and painless automated deployments with zero-downtime. Sitecore deployments are no exception. Have you embraced zero-downtime deployments? This is not a new topic. If you look around Sitecore community, you see an odd question popping here and there regarding this topic.

The journey towards achieving zero-downtime deployments for any application in fact starts with your code base. So, in this series of blog posts, we will refresh ourselves on concepts like “Code Freeze” and the CI/CD process before deep diving into implementing Sitecore zero-downtime deployments.

Blue-Green deployments architecture

Blue-green deployments strategy

In software engineering, blue-green deployment is a method of installing changes to a web, app, or database server by swapping alternating production and staging servers

Wikipedia

Key Concepts

In its purest form,  true BLUE/GREEN deployments means that we need two separate but identical environments, one is live (BLUE) and the other is on stand-by (GREEN). When you have  new version of your application, you deploy to the staging environment (GREEN) , test it without affecting BLUE. When you are happy with this new version, you can then swap it to be LIVE instance.

However, in practice, it doesn’t always make sense to run a copy of every resource. Furthermore, this may introduce some complexity to the process.

This is why we now have some shared resources as you can see in the infographic above, while others belong to BLUE or GREEN environment.

As part of this architecture, we need some way of switching or routing incoming traffic between the two environments.

Blue-Green deployment strategy effectively enables us to achieve zero down time deployments. This is because your users will not notice any downtime during deployments.

CI/CD process for Blue-Green deployments

CI/CD process for Blue-Green deployments

On the top part of the infographic above, – BLUE is currently production environment and our users accessing this environment. When we have, a new version of our application, it is deployed to GREEN environment, without affecting our users.

On the bottom part of the infographic above, – now GREEN is the production environment and our users are accessing this environment.  This leaves the BLUE environment available for us to deploy the next version of our application

We deploy to BLUE and GREEN in turns, this achieving zero downtime deployments. The process repeats in each deployment cycle.

Some benefits of Blue-Green strategy

If you haven’t already adopted the cloud for your Sitecore workloads – be it PaaS or Containers, then perhaps you need to start thinking about this seriously as there are benefits you will get.

“Blue-green deployments made easier with the cloud.”

fact

The cloud provides tooling you need to:

  • Automate your provisioning and tearing down of environments
  • Automate starting or stopping of services
  • Kubernetes simplifies container orchestration for us,  the Azure Kubernetes Service (AKS) provide a Control Plane for free
  • The flexibility and cost reductions the cloud offers makes blue-green deployments within everyone’s reach at this time and age, please embrace them.

Next steps

Hopefully, these blog post help you understand key concepts about BLUE-GREEN deployments.

In the next blog post in this series, we will look at implementing Sitecore Zero Downtime deployments.

Sitecore Zero-downtime deployments – Part 2

Sitecore Container based CI/CD Flow

With modern and mature DevOps, we all want smooth, sleek and painless automated deployments with zero-downtime. Sitecore deployments are no exception. Have you embraced zero-downtime deployments? This is not a new topic. If you look around Sitecore community, you see an odd question popping here and there regarding this topic.

The journey towards achieving zero-downtime deployments for any application in fact starts with your code base. So, in this series of blog posts, we will refresh ourselves on concepts like “Code Freeze” and the CI/CD process before deep diving into implementing Sitecore zero-downtime deployments.

Sitecore container based CI/CD flow

Sitecore Deployment options

Sitecore can be deployed to the cloud using IaaS, PaaS or Containers.  Microsoft Azure cloud  is preferred, although you can deploy to other providers like AWS

  • IaaS makes use of Virtual Machines
  • PaaS makes use of Azure App Service to run Sitecore web apps
  • Containers makes use of Azure Kubernetes Service (AKS)

How working with containers is different

When working outside of containers, you would typically build your application and then push it directly to the IaaS or PaaS instances hosting them. Using Containers changes this process slightly. The infographic below captures this process in detail

Sitecore containers CI/CD process summary

Explanation of the CI/CD process

  1. So developers make changes to the codebase.
  2. They then commit their changes into the repository, in this case stored in GitHub
  3. An Azure DevOps Pipeline monitors this repository and triggers a new image build each time there is a commit into the repo
  4. These images are built by Azure DevOps and the new image version is pushed into an Azure Container Registry (ACR) instance
  5. We have Other triggers for a base images that might have changed. For example, an update to the base Windows image or Sitecore image that can also trigger a new image build to occur. This is where the CI part of the process ends. We now have our new images built and available for deployment.
  6. So this is where the CD element starts. A release element is going to execute to start the deployment process.
  7. The first thing the CD element does is to push the new version of the k8s Specs into AKS, including pinning the deployments to the unique tag of the new images.
  8. AKS will now connect to the ACR instance to pull down these new images and build new deployments based on them.
  9. Of course any Sitecore deployment isn’t complete without a push of the content changes. Once the specs have been deployed the content is then also pushed to the CM instance running in AKS and a publish is executed.
  10. Once this has happened your end users can now browse the site and interact with the new containers running in AKS.

Hopefully, these blog post help you understand how to manage Sitecore Container based CI/CD process going forward. If you still struggling, engage your digital partners to look for long term solutions.

Next steps

In the next blog post in this series, we will look at BLUE-GREEN deployments and how to leverage this strategy to implement Sitecore Zero Downtime deployments.

My top 10 .NET web development productivity tools, which are yours?

Productivity

So I write software for a living. I have been doing this for more than 10 years. I have written all sorts of web applications while working for different organisations. I also write Windows native apps on my own spare time.

I believe there are many ways to deliver a software project, hence the phrase there’s more than one way to skin a cat! However from time to time we choose to do things in a certain way based on several factors. For me, productivity has to be on top of the list.

Below I share my top 10 .NET web development tools that make me more productive in the software projects I do.

Text editors and IDE

  • Textpad – This is a free simple and yet a very powerful text editor for quickly editing your code files including web pages. It features a powerful expression engine compatible with Perl and Javascript with syntax highlighting. It can handle very large file sizes and can be handy for quick find and replace tasks in large text based files
  • Notepad++ – This a free source code editor which is optimised to ensure higher execution speed and smaller program size. It is very hand if you want to develop in other languages other than English
  • Visual Studio – Probably the best IDE available and very popular with MSDN community. Powerful, Versatile and Extensible tool enabling building apps for any platform
  • Brackets – This is a very modern open source text editor that understands web design. A lightweight, yet powerful tool if you need an easy way to get a quick, clean, minimal CSS HTML document flow going.

Typography for the web

  • Adobe Typekit – Visually design and package beautiful fonts you want, anywhere, anytime
  • Google Fonts – Probably doesn’t require much introduction. Just Google it J
  • Font squirrel – If you need 100% free fonts for commercial use then you’ve got it. Visually design and package your fonts
  • Modular Scale – So have you ever wondered why they use Pixels, Ems and not Inches? And do you know what is Ems@16 ?This utility will help you convert between these units, and scale up or down your font sizes while keeping meaningful ratio between them
  • Adobe Color CC – Talk of colour schemes or themes, this tool from Adobe allows you to visually play with various to achieve the best contrast for your brands
  • CSS with vertical rhythm – If you have designed for the web then probably this is one of your favourite tools. If you have not used it, try it you won’t regret it.

CSS and styling

  • Bootstrap – Probably the most popular HTML, CSS and Javascript framework for developing responsive, mobile first brands. Its open source and available on GitHub.
  • CSS Reset – Get yourself scripts to quickly reset your styling of all HTML elements to a consistent baseline. You never need to scratch your head again asking Which CSS Reset should I use?
  • Browser reset – Another free browser reset script to get you started if you want to reduce browser inconsistencies in things like default line heights, margins and font sizes of headings, and so on

Entity Framework

  • MvcScaffolding NuGet package – This is a fast and customizable way to add controllers, views, and other items to your ASP.NET MVC application. You will love this at first sight.
  • EF Power Tools Visual Studio extension – There we go again. I love code first and not database first. Well, if you got an existing database or go for database first, this extension will reverse engineer an existing database and get you all those POCOs
  • EF Profilerby hibernating rhinos – Unfortunately you will need to pay for this tool but you won’t regret it. Using Entity Framework means much of the database work happen under the covers. Now you got a tool to profile all that.

Regex

Learn, build, & test Regular Expressions – This is a very handy tool to quickly build and text RegEx before you include them in your source code. You can also choose for an existing list of commonly used RegEx such as the one for validating an email address. It comes with excellent text editor with highlight syntax for all the RegEx matches.

Source code re-factoring and experience

  • ReSharper – This probably does not require much introduction. A popular productivity tool for Visual Studio, improving navigation within your project code files, code inspection and refactorings.

Source code repository

  • GitHub – Everyone is using it. If you can’t beat them you can as well join them.
  • Visual Studio Online – Not to be confused with Visual Studio IDE, this cloud based solution allows you to host your source code on the cloud for free for 5 basic user licences

Rich media

  • Windows snipping tool – Allows you to quickly capture screen shots on your desktop
  • Pixlr – Free and yet powerful online tool to quickly edit your rich media without installing anything
  • Paint net – A free image and photo editing software for your desktop

Console and Scripting Tools

  • Cmder. A nice looking and portable console emulator for Windows. It looks very sexy from the start
  • Windows PowerShell – We all love the power of scripting in Windows. Quickly create and test PowerShell scripts for automating your tasks

Online resources and Collaboration

  • Programming books repository on GitHub has a comprehensive list of books for almost anything you will ever need to know about programming.
  • Stackoverflow – It does what it says on the tin. We have all gotten or seen a “Stack overflow “error at some point. If you got any questions on anything programming related, Stackoverflow has got the answer for it already. You don’t believe me? Just try them.

So this is me. Which are yours?

Try SQL Server 2014

Have you tried the latest SQL Server 2014? I have. I have put together the installation wizard screen shots that I captured while installing my copy.

Get started

Download your copy from this link provided by the SQL Server Team via Twitter

Screen shots of the installation process

ImageImageImageImageImageImageImageImageImageImageImage

 

Hope this helps!

I will blog about the new features and share my thought in the next article. Until then, good luck with your installations.

Need a Windows 8 genius? We got an app for that too


Win8 Genius – it does what it says on the tin, it is your genius on your Windows 8 device.
We are building a set of dashboards for you where you can access information about your Windows 8 and device centrally in the modern fluid user interface. A place where you can view your network/internet info, your device info, your printers info among others. And what about a live tile to loop through some of these message on your home screen?

We are starting small but open for ideas on which pieces of information that can be added to this genius app.

The initial version of the app has been submitted to the store for certification. We are currently working on next dashboards which will be available soon.

We are happy for any feedback you may have:


Main Page

Now searching appointments on your phone as easy as ABC

Search Appointments is a handy app to allow you to search your calendar for appointments by specifying search text and date range. You can also narrow down your search to particular accounts on your phone such as Live, Outlook and others

Privacy Statement
This app access your user data, i.e. your calendar appointments for purposes of searching them. This app does not share your calendar appointments data with any third party. By using this app you accept this app to access your data.

How To Use This App

  1. Select the Account your wish to search your appointments in.
  2. Enter the search criteria usinsg the text box provided.
  3. Enter the date range for the appointments you wish to search for using the date picker.

We got Olympics 2012 apps for you




This summer sees the Olympics come to London, England. We got some amazing and exciting Windows Phone 7 apps lined for you.

  1. Lon 2012 Olympic Venues
  2. Olympics Social Jogger

Lon 2012 Olympic Venues is a handy app to help you familiarise yourself with London 2012 olympic venues. The app presents the venue details available on the offical website http://www.london2012.com/venues ‘as is’ for dissemination purposes only and not commercially.

With this app:

  1. you can save favorite venues
  2. view their locations on a map
  3. view sports available there
  4. view location details
  5. view background info about venue
  6. get latest news via live RSS feed
  7. get latest blog gossip via live RSS feed
  8. get latest news flash on live tile

Additionally you can view distances in miles from your current location. You can also plan your journey using Bing street-by-street integration

Olympics Social Jogger is a social hub for all your social buzz for the London 2012 Olympics events. The app lets you specify twitter handles or hash tags to follow and you won’t miss even a single update.