<?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 Monirath Ngor on Medium]]></title>
        <description><![CDATA[Stories by Monirath Ngor on Medium]]></description>
        <link>https://medium.com/@belougatech?source=rss-bc223afbcb13------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*TbxIBUTJFKH9gD_JwbCHsA.jpeg</url>
            <title>Stories by Monirath Ngor on Medium</title>
            <link>https://medium.com/@belougatech?source=rss-bc223afbcb13------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 05:54:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@belougatech/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[Create a MongoDB cluster in 2 command lines (with GCP + Terraform + Ansible)]]></title>
            <link>https://medium.com/@belougatech/create-a-mongodb-cluster-in-2-command-lines-with-gcp-terraform-ansible-6b706c2d57d?source=rss-bc223afbcb13------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b706c2d57d</guid>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[ansible]]></category>
            <category><![CDATA[gcp]]></category>
            <dc:creator><![CDATA[Monirath Ngor]]></dc:creator>
            <pubDate>Tue, 22 Sep 2020 07:43:10 GMT</pubDate>
            <atom:updated>2020-09-22T07:43:10.461Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a tutorial to create a MongoDB cluster on GCP using Terraform and Ansible in 2 command lines.</p><p>Of course, some preparation are required. But when you’re done, you’ll be faster than the Flash to create a MongoDB cluster when needed.</p><p>There are multiple ways to design and implement the cluster on a Public Cloud provider. I’ll focus on GCP but the philosophy would be the same on AWS, Azure, or any providers.</p><p>The code is hosted <a href="https://github.com/belougatech/cluster-mongodb-terraform-ansible">here</a>.</p><p>And at the end, I’ll propose some improvements.</p><h3><strong>Architecture</strong></h3><p>The architecture will be the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*PwebECjIdPihcmuQ-pID0w.png" /><figcaption>The architecture of the MongoDB cluster on GCP</figcaption></figure><p>MongoDB cluster will be installed on 3 different hosts/instances. One will be used as the leader node where the cluster will be initiated. The other will be secondary nodes and data are synced with the leader.</p><p>The 3 instances are installed on 3 different zones in the same region. It’ll be the compromise between availability/resiliency (which will be pretty excellent in fact) and latency. <br>The instances will be set up in a private subnet and this subnet is connected to a NAT Gateway in order for the instances to download the MongoDB packages). If you use default VPC and subnets, you don’t need to carry about this.</p><p>In front of the instances, we’ll use an Internal Load Balancer in order to have only one IP and to load balance the traffic towards one of the 3 MongoDB nodes. And if one of the nodes fails, the ILB will stop to send traffic to the failed one, but only to the working nodes.</p><p>In order for this to work, we need to implement the instance within Unmanaged Instance Groups. So the ILB will be able to send health checks but also for scaling purposes.</p><h3>Requirements</h3><p>The pre-requisites are the following:</p><ul><li>VPC with a private subnet</li><li>NAT Gateway allowing internet access (for packages installation) and attached to the private subnet</li></ul><p>This is used for realistic purposes. You can, of course, use the default VPC (if you just want a POC), in this case, the NAT Gateway is already configured. You can also use instances with public IP but it’s less fun and realistic for production.</p><p>Then, the ingredients are the following:</p><ul><li>GCP</li><li>Terraform 0.13</li><li>Ansible 2.9</li><li>MongoDB 4.4</li></ul><p>The host where you will execute Terraform and Ansible need to have access to the VPC and the subnet where the infrastructure will be created. And the user need to have Compute Instance admin and Compute Network admin permissions.</p><h3>The plan</h3><p><strong>Terraform</strong> is an open-source Infrastructure as Code (IaC) tool, created by HashiCorp. It is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions.</p><p>It is very useful to automate the resources provisioning when we need quick creation/destroy, or reproduce an environment (to quickly create dev, test, integration, preproduction, production environments for example).</p><p>Here, we’ll provision the infrastructure (the VM, the load balancer, etc.) with Terraform by writing configuration files and the tool will execute the creation of the resources on GCP based on what we have described.</p><p><strong>Ansible</strong> is an open-source configuration management tool, belonging to Red Hat. It is a tool for configuring Unix-like and Windows systems by describing them in yaml files.</p><p>Ansible is very helpful to automate repetitive system administration tasks. In our project, we’ll use it to automate the installation and configure MongoDB on every node. Then, we’ll orchestrate the cluster initialization.</p><p>Basically, the plan will be split into two parts:</p><ul><li>Use Terraform to Provision all GCP resources: 3 GCE instances, 3 unmanaged instances groups, 1 Internal Load Balancer (which will create a backend service, the forwarding rules, the health check, the firewall rules behind the scene)</li><li>Use Ansible to install MongoDB on the 3 instances and initiate the cluster from the leader node</li></ul><h3>Infrastructure provisioning with Terraform</h3><p>The first step is to provision the VM on GCP. You’ll find the commented code below and the source in <a href="https://github.com/belougatech/cluster-mongodb-terraform-ansible">github</a>.</p><h4>Instances</h4><p>Here is the code for the 1st instance, the other will have the same properties except for the zone. You can find more details in the <a href="https://www.terraform.io/docs/providers/google/r/compute_instance.html">documentation</a>.</p><pre>resource &quot;google_compute_instance&quot; &quot;mongo_node1&quot; {<br>name         = &quot;mongodb-node1&quot;<br>description  = &quot;VM hosting tools for node 1 of mongodb&quot;<br>machine_type = &quot;f1-micro&quot;<br>zone         = var.zones[0]</pre><pre>labels = {<br>  env          = &quot;dev&quot;<br>  app          = &quot;mongodb&quot;<br>  }</pre><pre>boot_disk {<br>  initialize_params {<br>  image    = &quot;ubuntu-os-cloud/ubuntu-1804-lts&quot;<br>  size     = 10 }<br>  }</pre><pre>// In this project, the instances are created in a private subnet which is not reachable from internet<br>network_interface {<br>  network     = var.network<br>  subnetwork  = var.subnet<br>  }</pre><pre>// SSH-keys used for authentication<br>metadata = {<br>  ssh-keys   = &quot;${var.ssh_user}:${file(&quot;${var.public_key_path}&quot;)}&quot;<br>  }</pre><pre>// Tags used by the ILB<br>tags = [&quot;allow-mongodb&quot;]<br>}</pre><p>For our case, we’ll use Ubuntu 18 to host MongoDB. We’ll add the ssh-keys in order for Ansible to install the software. And we’ll add a network tag in order to allow traffic coming from the ILB to the instances.</p><p>In this project, the instances are created in a private subnet, which is not reachable from internet. For testing or prototype purpose, you can use the default VPC and public IP by replacing the network interface block by:</p><pre>network_interface {<br>   network <strong>=</strong> &quot;default&quot;<br><br>   access_config {<br>     // Ephemeral IP<br>   }<br>}</pre><h4>Unmanaged Instance Group</h4><p>The unmanaged instance group will be used as a backend of the Internal Load Balancer. For more details, here is the link to the <a href="https://www.terraform.io/docs/providers/google/r/compute_instance_group.html">documentation</a>.</p><pre>resource &quot;google_compute_instance_group&quot; &quot;mongo_group1&quot; {<br>name        = &quot;mongodb-group1&quot;<br>description = &quot;Zonal instance group for mongodb cluster&quot;<br>instances   = [google_compute_instance.mongo_node1.id,]<br>named_port {<br>  name      = &quot;mongodb&quot;<br>  port      = var.mongodb_port<br>  }<br>zone        = var.zones[0]<br>}</pre><p>It is quite simple to create, just adding the instance that was previously described, filling the zone, and the port, and here we go.</p><p>2 other unmanaged instance groups have to be created for the 2 other instances.</p><h4>Internal Load Balancer</h4><p>A GCP load balancer is a combination of multiple resources: a frontend service, a backend service, a forwarding rule, a health check, and a firewall rules (for the health check).</p><p>Google has created some modules and available on github (<a href="https://github.com/terraform-google-modules/terraform-google-lb-internal">https://github.com/terraform-google-modules/terraform-google-lb-internal</a>). So we won’t reinvent the wheel and this module which is quite straight forward to use.</p><pre>module &quot;gce-ilb&quot; {<br>source       = &quot;GoogleCloudPlatform/lb-internal/google&quot;<br>version      = &quot;~&gt; 2.0&quot;<br>region       = var.region<br>name         = &quot;ilb-mongocluster&quot;<br>network      = var.network<br>subnetwork   = var.subnet<br>ports        = [&quot;${var.mongodb_port}&quot;]</pre><pre>health_check = {<br>  type                = &quot;tcp&quot;<br>  check_interval_sec  = 1<br>  healthy_threshold   = 4<br>  timeout_sec         = 1<br>  unhealthy_threshold = 5<br>  request             = &quot;&quot;<br>  response            = &quot;&quot;<br>  proxy_header        = &quot;NONE&quot;<br>  port                = 22<br>  port_name           = &quot;health-check-port&quot;<br>  request_path        = &quot;/&quot;<br>  host                = &quot;&quot;<br>  }</pre><pre>source_tags  = [&quot;allow-mongodb&quot;]<br>target_tags  = [&quot;allow-mongodb&quot;]</pre><pre>backends     = [<br>  { group = google_compute_instance_group.mongo_group1.id, description = &quot;&quot; },<br>  { group = google_compute_instance_group.mongo_group2.id,   description = &quot;&quot; },<br>  { group = google_compute_instance_group.mongo_group3.id, description = &quot;&quot; },]<br>}</pre><p>Here we are creating an Internal Load Balancer named “ilb-mongocluster” in the defined VPC and subnet. The ILB will spread the traffic towards the port 27017 and to the 3 backends defined by the 3 unmanaged instance groups that have been created previously.</p><p>The firewall rule will control the traffic based on the tag “allow-mongodb”.</p><p>And the availability will be managed thanks to the health check.</p><h4>Outputs</h4><p>Besides the infrastructure, we’ll create the inventory file where Ansible can find the hostname and the internal IP.</p><pre>resource &quot;local_file&quot; &quot;ansible_inventory&quot; {<br>content = templatefile (&quot;inventory.tmpl&quot;,<br>  {<br>  ip_mongo_node1 =   google_compute_instance.mongo_node1.network_interface.0.network_ip<br>  ip_mongo_node2 = google_compute_instance.mongo_node2.network_interface.0.network_ip<br>  ip_mongo_node3 = google_compute_instance.mongo_node3.network_interface.0.network_ip</pre><pre>  hostname_mongo_node1 = &quot;${google_compute_instance.mongo_node1.name}.${google_compute_instance.mongo_node1.zone}.c.${var.project}.internal&quot;<br>  hostname_mongo_node2 = &quot;${google_compute_instance.mongo_node2.name}.${google_compute_instance.mongo_node2.zone}.c.${var.project}.internal&quot;<br>  hostname_mongo_node3 = &quot;${google_compute_instance.mongo_node3.name}.${google_compute_instance.mongo_node3.zone}.c.${var.project}.internal&quot;<br>  })<br>filename = &quot;../ansible/inventory&quot;<br>}</pre><p>In order to do this, we’ll provide the template some variables.</p><p>For the IP, it’s straightforward, it’s an attribute of the instance. For the hostname, we have to build it in GCP format: “hostname.zone.c.projectid.internal”. We need to do this because the internal DNS is zonal and not regional.</p><p>And here is the template:</p><pre>[mongodb_lead]<br>${hostname_mongo_node1} ansible_host=${ip_mongo_node1</pre><pre>[mongodb_secondary]<br>${hostname_mongo_node2} ansible_host=${ip_mongo_node2}<br>${hostname_mongo_node3} ansible_host=${ip_mongo_node3}</pre><pre>[mongodb:children]<br>mongodb_lead<br>mongodb_secondary</pre><pre>[all:vars]<br>ansible_python_interpreter=/usr/bin/python3</pre><p>The produced file is in Ansible inventory format and will be stored directly in the Ansible folder.</p><h4>Variables</h4><p>And finally, the variables that you can customize depending on your need or your situation. Especially, replace the project id, the VPC name, the subnet and the account for ssh.</p><pre>variable &quot;public_key_path&quot; {<br>description = &quot;Path to the public SSH key you want to bake into the instance.&quot;<br>default     = &quot;~/.ssh/id_rsa.pub&quot;<br>}</pre><pre>variable &quot;private_key_path&quot; {<br>description = &quot;Path to the private SSH key, used to access the instance.&quot;<br>default     = &quot;~/.ssh/id_rsa&quot;<br>}</pre><pre>variable &quot;credentials_path&quot; {<br>description = &quot;Path to the GCP account credentials.&quot;<br>default     = &quot;../../credentials/credentials.json&quot;<br>}</pre><pre>variable &quot;project&quot; {<br>description = &quot;Name of your GCP project.&quot;<br>default     = [YOUR_PROJECT]<br>}</pre><pre>variable &quot;region&quot; {<br>description = &quot;Region.&quot;<br>default     = &quot;us-east1&quot;<br>}</pre><pre>variable &quot;zones&quot; {<br>description = &quot;Zones.&quot;<br>default     = [&quot;us-east1-b&quot;, &quot;us-east1-c&quot;, &quot;us-east1-d&quot;]<br>}</pre><pre>variable &quot;ssh_user&quot; {<br>description = &quot;SSH user name to connect to your instance.&quot;<br>default     = [YOUR_ACCOUNT]<br>}</pre><pre>variable &quot;network&quot; {<br>description = &quot;VPC name.&quot;<br>type        = string<br>default     = [YOUR_VPC]<br>}</pre><pre>variable &quot;subnet&quot; {<br>description = &quot;Subnet where to host the cluster.&quot;<br>type        = string<br>default     = [YOUR_SUBNET]<br>}</pre><pre>variable &quot;mongodb_port&quot; {<br>description = &quot;Port used by the mongodb cluster.&quot;<br>type        = number<br>default     = &quot;27017&quot;<br>}</pre><p>Basically, we can find the path to everything related to ssh-keys and credentials. And the VPC and the port used MongoDB.</p><h4>Preparation</h4><p>We have now te code for the infrastructure. Before moving the to the next section, you can check that everything is ready.</p><p>First you need to initialize Terraform in order to download provider’s files and and the modules by executing ‘<em>terraform init</em>’.</p><p>You can then use ‘<em>terraform validate</em>’ to check the syntax.</p><p>And then, ‘<em>terraform plan</em>’ to check the resources that will be created.</p><p>Let’s now move on the Ansible.</p><h3>Cluster creation with Ansible</h3><p>We’ll use Ansible in order to install the cluster on the 3 instances built with Terraform.</p><p>In order to achieve this, we’ll use roles.</p><p>The first one is called ‘installation’, it is used to install MongoDB on the 3 nodes.</p><p>The second one is called ‘<em>initreplica</em>’, it is used to initiate the cluster on the leader node, so the secondary nodes will be replicated.</p><h4>Main file</h4><p>In the main file, we simply call the 2 roles. The first one for the al hosts. And the second for only the leader node.</p><pre>- hosts: mongodb<br>  become: yes<br>  become_user: root<br>  roles:<br>    - installation</pre><pre>- hosts: mongodb_lead<br>  become: yes<br>  become_user: root<br>  roles:<br>    - initreplica</pre><h4>Installation role</h4><p>The role consists in 3 files for:</p><ul><li>task in the file <em>tasks/main.yml</em></li><li>handler in the file <em>handlers/main.yml</em></li><li>template in the file <em>templates/mongod.conf.j2</em></li></ul><p>The main task basically follows the MongoDB installation <a href="https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/">documentation</a> for Ubuntu.</p><pre>- name: MongoDB - Import public key<br>  apt_key:<br>    url: <a href="https://www.mongodb.org/static/pgp/server-4.4.asc">https://www.mongodb.org/static/pgp/server-4.4.asc</a><br>    state: present</pre><pre>- name: MongoDB - Add repository<br>  apt_repository:<br>    repo: deb [ arch=amd64,arm64 ] <a href="http://repo.mongodb.org/apt/ubuntu">http://repo.mongodb.org/apt/ubuntu</a> bionic/mongodb-org/4.4 multiverse<br>    state: present<br>    filename: mongodb-org-4.4.list<br>    mode: &#39;0666&#39;</pre><pre>- name: MongoDB - Install<br>  apt:<br>    name: mongodb-org<br>    state: latest<br>    update_cache: yes</pre><pre>- name: MongoDB - Copy configuration file<br>  template:<br>    force: yes<br>    src: mongod.conf.j2<br>    dest: /etc/mongod.conf<br>  notify: Start mongodb</pre><pre>- name: MongoDB - Ensure mongodb is running and enabled to start automatically after reboots<br>  systemd:<br>    name: mongod<br>    enabled: yes<br>    state: started</pre><p>Then, a small handler for restarting the database after the installation (called by the notify attribute).</p><pre>- name: Start mongodb<br>  service: name=mongod state=started</pre><p>After the installation, Ansible will copy a configuration file that is simply allowing other hosts to connect to the database. Of course, you can customize for more security. It concerns the following section of the file <em>mongod.conf.j2:</em></p><pre># network interfaces<br>net:<br> port: 27017<br> bindIp: 0.0.0.0</pre><p>Another important section of the configuration file is the replication one where we specify the name of the replica name, he this is ‘<em>rs0</em>’:</p><pre>replication:<br> replSetName: rs0</pre><h4>Initreplica role</h4><p>This role consists in 2 files for:</p><ul><li>task in the file <em>tasks/main.yml</em></li><li>templates in the file <em>templates/inireplica.js.j2</em></li></ul><p>The main tasks will simply copy a .js script and launch it.</p><pre>- name: MongoDB Lead — copy file for initialization script<br> template:<br> src: initreplica.js.j2<br> dest: /tmp/initreplica.js<br> mode: ‘0666’</pre><pre>- name: MongoDB Lead — Execute the initialization script and add all replicants<br> shell: mongo /tmp/initreplica.js</pre><p>The content of the <em>.js</em> file content is the following:</p><pre>rs.initiate({<br> _id: “rs0”,<br> version: 1,<br> members: [<br> {% for host in groups[‘mongodb’] %}<br> { _id: {{ loop.index }}, host : “{{ host }}:27017” },<br> {% endfor %}<br> ]<br> }<br>)</pre><p>We can find here the command <em>rs.initiate()</em> which will initiate the cluster with different specified members. In order to achieve this, we use a “<em>for”</em> loop to parse the hostnames within the inventory.</p><p>And you’re done!</p><h3>Execution</h3><p>Only 2 command lines are required now to create and set up the cluster.</p><p>The first one is to provision the infrastructure with Terraform. From the terraform folder, execute the command:</p><pre>terraform apply</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*qCRAYjFVGEAu6yyqgTJLCA.png" /></figure><p>Your infrastructure should be ready in less than 1 minute.</p><p>Then, the second one is the command line for Ansible. From the Ansible folder, execute the playbook:</p><pre>ansible-playbook main.yml</pre><p>After a few minutes, you’re done!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*DLkCn_HZmgGL7oxDFDWKqA.png" /></figure><h3>Testing</h3><h4>Check the resources</h4><p>Check that all resources have been correctly created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*sExplDLX2RPg0MhNEtyo2g.png" /><figcaption>The 3 GCE instances in 3 different zones and unmanaged instance group</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nnypy2j_OddfhMQF8REqRg.png" /><figcaption>The 3 unmanaged instance groups</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*2y8wBn3G7zaU7JW__LUoHQ.png" /><figcaption>Details of the internal load balancer</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*nyxr5mEX2XpXwHh0WlMhgw.png" /><figcaption>The forwarding rule of the load balancer</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*te4z6BqkmFmIcVpmTR_kJw.png" /><figcaption>The healthcheck on port TCP 27017</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BKGn8QUgS7-oUPdHKd7XhQ.png" /><figcaption>Firewall rules for health check and for the load balancer</figcaption></figure><h4>Check the MongoDB listening port</h4><p>Connect to the nodes through SSH and check the listening port with the command:</p><pre>ss -tulpn</pre><p>You should find you that the instance is listening any connection from (0.0.0.0) on the TCPport 27017.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*ypVPcxH9wnA7HapMuWPs5A.png" /></figure><h4>Connection to MongoDB</h4><p>Go to the <a href="https://console.cloud.google.com/">GCP console</a> and select the menu Network Services/Load Balancing, you’ll find the Internal Load Balancer. Click on it and you enter to the details page where you can find the internal IP.</p><p>From any instance of your subnet outside of your cluster (just check that it is allowed to traffic on the port 27017), execute the command:</p><pre>mongo [ILB_IP]</pre><p>And you should be connected to one of the nodes. As you are in the MongoDB shell, type the following to check the status of the replication:</p><pre>rs0:SECONDARY&gt; rs.status()</pre><p>You should find the 3 nodes and know which one is up, which one is primary, which are secondary.</p><p>You can redo the test multiple times, and you’ll be connected to one of the 3 nodes.</p><h4>Testing the failover</h4><p>Go to the GCP console and stop one of the 3 nodes.</p><p>And reproduce the previous connection testing.</p><p>You should be connected on of 2 running nodes. And by checking with rs.status() again, you’ll see that one of the node is down. If that the failed instance was primary, another node will be designated as primary.</p><p>Costs</p><ul><li>Compute Engine: you’ll be charged for the instance (<a href="https://cloud.google.com/compute/vm-instance-pricing">pricing</a>). For testing purpose, you have a free tier for the micro machine type (750 free hours per month)</li><li>Load balancer: you’ll be charge for the internal load balancer and the forwarding rules (<a href="https://cloud.google.com/vpc/network-pricing#lb">pricing</a>).</li></ul><h3><strong>Improvements</strong></h3><p><strong>Service accounts</strong>: in order to reinforce the security, you can create a service account for the nodes and allowing traffic only to those nodes by creating a permission to whom need to access it</p><p><strong>Managed instance group</strong>: you can create an instance template to deploy the instances quicker and to take benefit that it’s all regionnaly managed. Just to have in mind, that you’ll need an extra step in order to collect the hostname to build the Ansible inventory.</p><p><strong>Chain Terraform and Ansible</strong>: you can either call Ansible from Terraform (check local/remote-exec) or use a shell script in order to call the command successively.</p><h3>Takeaways</h3><p>With this tutorial, we have taken the benefit of Terraform to automatize the construction of the infrastructure. And we can reuse this in order to scale up by changement the characteristics of the ndoes and to scale out by adding new nodes easily.</p><p>We can also create and destroy the infrastructure in one command line if we just need a temporary cluster. Or we can reproduce quickly a new environment if we need another cluster for testing, validating or production preparation.</p><p>With Ansible, we have automatized the installation and the cluster initialization. Thanks to the pre-built inventory, there is nothing to change to set up more nodes in the cluster.</p><p>And now, it’s up to you to customize all the things around: Security, configuration, deployment method, etc.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b706c2d57d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migrating a telco to a Public Cloud? Yes, it’s possible.]]></title>
            <link>https://medium.com/@belougatech/migrating-a-telco-to-a-public-cloud-yes-its-possible-93e26e09d341?source=rss-bc223afbcb13------2</link>
            <guid isPermaLink="false">https://medium.com/p/93e26e09d341</guid>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[telecommunication]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Monirath Ngor]]></dc:creator>
            <pubDate>Fri, 28 Aug 2020 09:23:43 GMT</pubDate>
            <atom:updated>2020-08-28T09:47:59.738Z</atom:updated>
            <content:encoded><![CDATA[<h4>How Public Clouds can be used by a telco and how they can leverage it.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TklL7QYA-HiCjoK7_suS3w.jpeg" /></figure><p>Based on my experience in the telecommunication industry, I have identified several opportunities that Public Cloud Providers can leverage.</p><p>From the outside, it may be hard to understand the complexity of telcos challenges. From inside, it may be hard to understand how a public cloud provider can help them whereas they were working privately the whole time.</p><p>Technologies improved a lot during the last decade. Some telephony services in SaaS model start to play at the same level as the telcos. And they were hosted in… a Public Cloud. So, it’s not taboo anymore to talk about this topic.</p><p>And with the arrival of 5G, it’s more or never the time for the actors to have a card to play.</p><p>I will give an overview of the telecom core business, especially mobile operators, with some examples of services provided by GCP or AWS (sorry Azure, I don’t know you enough yet) that they can use, based on a location in France.</p><p>Disclaimer: some of the proposals may break the rules. So, colleagues, I hope you won’t get too stressed :)</p><p>Let’s start with a bit of history.</p><h3>History</h3><p>Previously, network functions and applications used to be deployed in monolithic servers sold by Telecommunications Manufacturers such as Nokia or Ericsson. Like in IT, it took several months to go live. The services were kind of black boxes for the engineers. And, now NFV has opened the hood.</p><p>Since 5 years, a major transformation happens at the infrastructure level. Operators have started to adopt NFV (Network Functions Virtualization) which is the technology to virtualize Network Functions such as Packet Core (function to manage mobile data), MMSC (function to manage MMS), but also Caching or Load Balancing. They are deployed as VNF (Virtual Network Functions) in VMs. And in parallel, they deploy SDN (Software Defined Network) in order to automate network administration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MoBPcnvgct9SIR9Lr9HoXA.png" /><figcaption>Red Hat OSP proposals for NFV</figcaption></figure><p>Virtualization is quite old in the IT world, but not in the telecom industry. Nevertheless, reasons are at the end the same: financial (cost optimization with COTS hardware), no vendor-lock, flexibility (capacity management for example), availability, etc.</p><p>Almost connectivity is through IP now (protocol are encapsulated or transformation over IP in progress). And if we open the box, services are composed of proprietary softwares/applications. But most of the time, they are installed on Linux (classical distros), use classical middlewares, and are compatible with remote storage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*GNyd_OkFOP0HwUJSripWXQ.png" /><figcaption>Example of service decomposition.</figcaption></figure><p>Before, a service was sold as one black box and managed as such by the vendor. Now, it is sold as a VM but we know what’s inside because the virtualization platform requires to know the VM specifications (throughput, vCPU, storage, OS, etc.). Now, the trend is to continue to decompose and heads towards micro-services architecture. And, the war is about orchestration, automation, everything about cloudification.</p><p>It took a while to be at where we are now because the transformation required that actors play the game. For an operator, why should it go to a new technology whereas the current one works? For a manufacturer, moving to virtualization is a loss of income because they will sell less hardware. With less concern, 3rd-party editors required to adapt their software to work with a virtualized infrastructure.</p><p>Now the telcos fully understand the benefits of a private Cloud. Historical manufacturers do so and focus on adding more values to their proposal and work closely with the telcos by moving to microservices and containerization.</p><h3>Leverages of Public Cloud solutions</h3><h4>On-demand solutions</h4><p>For a telecom, capacity management is a skill apart due to user behavioral or commercial periods.</p><p>Champions Leagues, Olympic Games, Football World Cup are closely monitored by the telcos as they generate so much streaming traffic.</p><p>Back-to-school, Christmas, punctual marketing operations are critical commercial periods, it’s the reason for network and IT can be freeze (no operations are allowed).</p><p>During vacation, the population moves over the territories and can saturate servers that are idle most of the time.</p><p>At the New-Year eve, the pics of messages are so high that a dedicated taskforce is organized every year.</p><p>Here are some examples where the on-demand model, scale-up and scale-out features can be very helpful for a telco.</p><p>Terraform, Ansible, Chef, Puppet, CloudFormation, Cloud Deployment Manager, etc. all those tools can become new friends in order to accelerate and automate on-demand deployment.</p><h4>Elasticity</h4><p>Some services, such as SMS, are decreasing. Others, such as RCS, are increasing at the same time. And telcos have to deal with the customer base that can increase also at the same time.</p><p>So capacity management, again, can become a puzzle. It’s one of the reasons that telcos move to cloud. Playing around with VMs decommissioning and deploying is much more pleasant than hardware decommissioning and deploying hardware.</p><p>So with the same physical infrastructure, it’ll be possible to deal with the decrease of SMS VMs and the increase with RCS VMs at the same time.</p><h4>Big data and Analytics</h4><p>Playing with the data is not a natural skill for the telco. They have to do it to deal with massive volumes of objects such as billing data. So it requires to implement by themselves a data warehouse by using 3rd party solutions such as Teradata.</p><p>Data and Analytics are strong skills developed by Cloud Providers. Tools such as AWS Redshift/Athena/Kinesis/EMR or GCP BigTable/BigQuery/Dataproc are so much powerful that it’s impossible to no consider them. And can avoid storing puzzles and hours of processing before getting an answer to a query.</p><p>Of course, besides, we can have in mind machine learning/AI solutions in order to provide more values to the data.</p><h4>Maintenance overhead</h4><p>Depending on the size of the telco or the decision-maker, the cursor to have a good balance between in-house engineers or delegating operations and maintenance is a big question.</p><p>With virtualization, telcos are more focused on the application level. But as they opened the pandora box, someone has to take care of the infrastructure.</p><p>The lower levels can be fully managed by a Cloud Provider Solutions. Automated backups, security or minor patching, autoscaling, programmatic deployment and deployments, etc. There are so many reasons.</p><p>Why should they work on instead of operations on services? Let the specialists and solutions do the work.</p><h4>Containerization</h4><p>Telcos have an eye on containers solution because it may be the solution to distribute quickly the applications through the different data centers. Services and applications are spread over data centers for availability or capacity purposes. And deploying a new feature or upgrading them can be tricky.</p><p>Kubernetes is a fantastic tool to abstract the lower level, but it can generate paradoxically a shift of the skills and other operational overhead considerations.</p><p>So using orchestration solutions can be the mitigation. And Public Cloud solutions such as AWS ECS or GCP GKE can answer to the question. Easy to deploy, easy to use, no maintenance, robust, flexible.</p><p>In the next sections, I’ll have a 360 overview of telco applications, bringing up some Cloud solutions. And give the last word about new opportunities.</p><p>I won’t talk about other support services such as HR system, collaboration services, and so on because they are not specific to the telecom industry.</p><h3>Telecommunication services</h3><p>If we look at the map of network functions, we can find tons of blocks related to different services handling internet, voice, messaging, storage, sim, user profile, authentication, radio networks, mobility, load balancers, traffic redirection, interconnection, and so on (I’ll stop here, the list is infinite).</p><p>Some of them require high performance in terms of latency or throughput.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*00xnzGoLd-4BSLpc5d_tNA.jpeg" /><figcaption>Very very very simplified telecommunication network architecture.</figcaption></figure><h4><strong>Real-Time and Latency services</strong></h4><p>Voice telephony (VoIP, VoLTE, VoWifi, etc…) is a real-time service, opposite to some internet services which are asynchronous. It’s the reason that telcos dedicate bandwidth to ensure the quality of service and define multiple Classes of Service over their network (through radio/collect/core/interconnection). The highest one is dedicated to Voice services which prioritize network transit and telco aim to reach under 40ms latency at least. And developing real-time data transfer (video streaming, real-time game, etc.) is a major concern for the user nowadays. The concern is true for the control plane as well as the data/user plane. We talk here about IMS for example, but also all components around them such as SBC (Session Border Controller or MGW in order to transit media) or RAN (Radio area where stands antenna et first services to manages traffic) part.</p><p>The challenge of moving to a Public Cloud will be to reduce components&#39; location and to shorten the traffic path as much as possible.</p><p>The general solution would be first to locate the core network in the same country as the users. And if possible using edge location to take advantage of the provider&#39;s backbone. Then use affinity rules and keep components as closest as possible without forgetting availability requirements.</p><p>For example, AWS has a region located in Paris with 3 availability zones for France. Then use the benefit of affinity rules and cluster placement group. Applications will be hosted in EC2 mainly in order to have overhead as less as possible. Elasticache can help if in-memory caching is required. In terms of connectivity, using Direct Connect will be mandatory to connect other worlds to AWS.</p><p>On GCP, there is no region in France yet (should arrive by 2021) so Belgium region will be the closest one. Use Compute Engine instances with a Compact placement group. Memorystore for the in-memory caching. And Cloud Interconnect for the connectivity.</p><p>There are here great constraints, but also good advantages to benefit from autoscaling and elasticity of the instances. And from fast deployment.</p><h4><strong>High throughput services</strong></h4><p>One of the roles of an operator is to collect and transport the network traffic from customer devices (CPE or smartphones) to the Internet Points of Presence.</p><p>As you can imagine, it can represent up to several Tbps of bandwidth to manage depending on the size of the operator. Core networks for mobile data services (PGW for example) are one of the big consumers.</p><p>There are 2 concerns here:</p><ul><li>connectivity bandwidth because of the growing usage</li><li>processing high throughput (high CPU load and IOPS) related to traffic control</li></ul><p>Telco used to install monolithic servers and dedicated links with their own protocols to ensure quality and service and performance. But since Network (optical fiber, edge routers), Compute (CPU power, RAM), and Storage (SSD) have improved so much during the last years, the challenges shift to upper layers.</p><p>The main challenge will be to handle east-west traffic (inter-VM).</p><p>On AWS, we’ll need here EC2 CPU-optimized instance configured with ENA (Enhanced Networking for the SR-IOV feature) or EFA (Elastic Fabric Adapter), Clustered placement group to contain east-west traffic, EBS SSD provisioned-IOPS for local data, AWS EFS or FSx for Lustre to store remote data, Elasticache for in-memory caching.</p><p>On GCP, we can think about GCE C2 machine types, with SSD persistent disk, It’s not possible to use SR-IOV or hardware acceleration on GCE, Memorystore for in-memory caching. Google relies on Andromeda SDN in order to handle high throughput (<a href="https://cloud.google.com/blog/products/networking/google-cloud-networking-in-depth-how-andromeda-2-2-enables-high-throughput-vms">https://cloud.google.com/blog/products/networking/google-cloud-networking-in-depth-how-andromeda-2-2-enables-high-throughput-vms</a>).</p><p>As previously dedicated connectivity between the on-prem environment and the public cloud plus will mandatory. And they can benefit from autoscaling, elasticity, fast deployment.</p><h4>Messaging services</h4><p>During my career in the telco industry, I was in charge of the capacity management of the services during New Year Eve, especially messaging services. Indeed, every year the telcos organize specific taskforce in order to manage the high traffic of SMS and MMS.</p><p>At midnight, a huge peak of traffic happens, it can be multiplied by several hundred compared to normal hours. As I mentioned at the beginning, the services can be assimilated into different pieces of software and databases.</p><p>Up to know, the capacity is limited to the existing built infrastructure. Just to give a quick overview of what happens. At midnight, only incoming traffic is allowed. Applications are configured to only ingest messages, all messages are stored in a sort of buffer (databases). Then an hour later, applications are reconfigured to release the traffic towards other operators.</p><p>I said that almost connectivity goes through IP. It’s not totally true yet for SMS Center which still uses MAP protocol. But more and more traffic is transformed into IP (SMS over IP and use of IP-SM-GW components).</p><p>On the other hand, there is no issue for MMC or RCS which are natively handled over IP.</p><p>So, taking advantage of the on-demand model and scaling out and up capability on the Cloud will be powerful to manage this period. So container through GCP Kubernetes Engine or AWS Elastic Container Service may be helpful. And working with GCP Cloud SQL or AWS Aurora as well which are consistent database solutions.</p><h4>Caching and CDN</h4><p>There is one point that it can be interesting to stop by.</p><p>For a fixed operator, it can be already common. Internet usage on smartphones strongly increases for the last years (x2 every year, mobile connections exceed now fixed connections). Optimizing data delivery becomes a major concern due to bandwidth high consumption, especially for videos.</p><p>Caching appliance project is now common for Netflix, Facebook, Google contents. Other web contents can benefit also of CDN.</p><p>Answers will be:</p><ul><li>Google Cache, Google CDN, AWS CloudFront</li><li>Edge location</li></ul><h4>Other services</h4><p>There is no constraint about other services like messaging user control (cost control, authentication, PCRF), enrichment, voicemail, etc. as they can work asynchronously and are not bandwidth and latency-critical.</p><p>Classical VMs and later containers will do the work.</p><p>For all the services, benefiting from autoscaling, on-demand resources will help to deploy faster, with less maintenance overhead. The telcos will be able to focus on new features with 3rd parties vendors at the application level.</p><h4>Challenges</h4><p>One major challenge I didn’t mitigate is about resiliency. The applications are usually spread into multiple zones. 3 zones on the same geographical location may not be enough, and applications will have to be distributed to other on-prem locations.</p><p>We can think about the HSS/HLR where resiliency requires at least 2 geographically separated data centers.</p><p>Another major concern will be about privacy and data localization (RGPD in Europe). It won’t regard all network functions but this needs to be taken into consideration if the services require to manipulate user data.</p><p>The last point is about high throughput delivery. Big chunks are required to transit so many dedicated links will be required to be built and having in mind that traffic will come from everywhere in the country.</p><h3>Support applications</h3><h4>Monitoring/Alerting systems</h4><p>A telco infrastructure is complex due to the number of services that may include their own architecture inside. Basically, it’s composed by the radio network (antenna and base station), the backhaul and the backbone (for data and message transit), the Core (tons of servers managing subscribers, authorization, internet sessions, parental control, etc…), the VAS (voicemail, SIM service, messaging) and the IT systems (provisioning, billing, etc…).</p><p>As a critical mission, the supervision team has to monitor everything:</p><ul><li>the services (voice, internet, SMS, MMS, purchase, …)</li><li>the functions (MME, SPGW, MSC, EIR, IMS, HSS, …)</li><li>the components (compute servers, storage servers, ….)</li><li>the networks (firewall, routers, links, bandwidth, …)</li><li>the datacenters (power consumption)</li><li>the interconnection (with 3rd parties, carrier, …)</li><li>the IT systems (billing, analytics, provisioning, logistics applications, self-care, websites…)</li></ul><p>Some telco delegates those systems to 3rd party service companies as monitoring telecommunications are very specific and sometimes pull proprietary systems.</p><p>So the first layer is to use an aggregator that can gather all alerts and system data. Most of the telecommunication vendors propose them and can sell them as software appliances working like an umbrella.</p><p>For more classical systems, GCP Stackdriver or Bigtable can be the response to ingesting logs.</p><p>The second layer is about visualizing them and create some alerts, Prometheus/Grafana (or whatever monitoring solutions) can do the work, so installed anywhere on the Cloud.</p><h4>Tracing</h4><p>In the telecommunications industry, everyone has heard about Arista. They propose a solution to mirror traffic, to store them, and also analytics tools for calls tracing (for debugging purpose of course).</p><p>As the traffic grew so much, only a part is mirrored for some services because of hardware limitations (cost above all).</p><p>Using analytics tools such as GCP Big query or AWS Redshift can be relevant as logs and traces are heavy.</p><h4>Billing, Data visualization, Legal</h4><p>Every call, text message and internet session are logged into tickets called CDRs (Call Detail Records) either in real-time or archived with D+1 processing. Sometimes both for correlation purpose. The main goals are mainly for Billing and Legal. Those tickets are also used for marketing analysis, data visualization, and support.</p><p>You can imagine the tons of objects to manage and to process. For a telco of 20M subscribers with the following call model: 35 calls, 220 SMS or MMS, 60 internet sessions per user per month, it represents 10 billion objects per month to capture, store, process, and archive.</p><p>Ingesting data may be managed through GCP Pub/Sub and Cloud Storage for example.</p><p>Then it’s a question of data warehouse and data visualization. And solutions from GCP or AWS are quite straight forward because they are so powerful. And won’t require specific skills to realize some requests. And there is no need anymore to wait several hours to get the response of a query.</p><p>The answer will be:</p><ul><li>BigQuery, Cloud Storage, Cloud Studio on GCP</li><li>Redshift, S3, QuickSight on AWS</li></ul><p>For legal purposes, telcos are asked to store CDR for several years. So using buckets with lifecycle rules can be helpful. And we don’t forget that buckets&#39; solution is very robust for archives. AWS S3 Glacier Deep Archive is designed with 99,999999999% durability.</p><h4>Operations</h4><p>Operations staff (NOC, support level 2/3, Ops) use scripts provided by the vendors, or sometimes written by themself in order to operate on the services or on the infrastructure. For example, to restart a system or a VM, to purge some data, to realize some backups, etc.</p><p>Those scripts are basically stored in the office LAN and the on-duty engineer needs a VPN to access it. So, why not only use Chrome to access the scripts stored on a GCP Cloud Source Repositories and port them to Cloud Run or Cloud Functions in order to trigger them when needed. It’s serverless, so nothing to maintain the maintenance.</p><h4>Other applications</h4><p>Telcos use other applications for assets management, deployment, testing, quality of service measurements. Most of them are sold as software without any particularity, so they can totally be installed on instances on the Cloud.</p><h3>IT systems</h3><h4>Website</h4><p>Actually, it’s not very particular to the telecommunications system. But I’d just like to mention the powerful managed services that exist on the Public Cloud Providers.</p><p>Back-to-school and Christmas are the most critical period during the year when talking about sales. And traffic on the websites and underlying systems (provisioning especially) are closely monitored. That the reason also there is a specific freeze period when no operations are allowed.</p><p>Use GCP Load Balancers to manage traffic easily. Use Cloud SQL in order to decrease overhead maintenance. Use GCE Instance Groups or GKE to deploy web and application servers with autoscaling features.</p><h4>Provisioning and Logistic</h4><p>As soon as a customer purchases his SIM cards and his plan, a long workflow begins until the delivery. It starts with checking payment authorization, provisioning the CRM, creating a billing account, provisioning all telecommunications systems (authorization, authentication, HSS/HLR, cost control system, policy control), checking the smartphone stock, order the logistic, order the delivery, etc.</p><p>Today, every part of the workflow is managed separately. So it can be relevant to a solution such as AWS Simple Workflow Service to manage all the tasks centrally.</p><h3>Other opportunities</h3><h4>IoT</h4><p>Telcos can play a major role in developing IoT.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/1*yzV6UBWAAA2emGru-kO7kw.png" /><figcaption>IoT stack and telco positioning</figcaption></figure><p>The force of a telco is to own a physical radio infrastructure that covers a vast territory. Multiple projects based on SIM cards are rolled out. For example, GPS devices for real-time traffic, public bicycles or scooter localization, or electric consumption measurement device.</p><p>Behind the scene, the management of the “things” follows the same steps as a human user for authentication, authorization, localization and roaming, traffic and cost control, and data transit.</p><p>With 5G, density possibility and low latency will offer new services and the infrastructure will have to support massive data coming from the objects. And historical vendors are in the position to propose new softwares to handle IoT as a man-in-the-middle.</p><p>As telco got the sources of the data, using streaming services such as AWS Kinesis or GCP Cloud IoT Core may be interesting. Registration and authentication are radically different but we talk about changes, right?</p><p>The next step will be to develop a higher pile of the stack. Starting from data collecting to value transformation. So BigQuery and RedShift will be helpful.</p><h4>5G and edge computing</h4><p>A word about 5G. One of the advantages promoted by the new generation is low latency (we all have in mind remote surgery). Some core components will require to be distributed to edge data centers in order to be processed as closest as possible to the user. And this will develop massive IoT. Biggest telcos have local datacenters spread over the land, and they can take advantage to install software appliance on like Google Cloud Kubernetes Engine on-prem with Anthos to start (<a href="https://cloud.google.com/blog/topics/inside-google-cloud/google-cloud-unveils-strategy-telecommunications-industry">https://cloud.google.com/blog/topics/inside-google-cloud/google-cloud-unveils-strategy-telecommunications-industry</a>).</p><p>As applications will be spread over local datacenters, integration and deployment will be also a big question linked to DevOps. Telecommunications and IT become more and more closed.</p><p>Let’s take an example. VR live streaming is today a great challenge because it concerns high throughput, broadcasting, and realtime. So let’s imagine that 5G radio is ready to upload a 4K video live streaming at 1Gbps. A local data center closed to the source can proceed to the first wave of processing like transcoding. Then the stream can be cached in order to serve viewers.</p><p>Another example can concern autonomous cars. As sensors of the vehicles streams tons of data, the network requires a strong infrastructure to capture all of them. Transiting data won’t be a problem as the throughput will be manageable. And telcos will have a 5G robust infrastructure collecting the data. The issue will come from analytics behind the scene.</p><h3>Recap</h3><p>Basically, as more and more network functions and services are virtualized, they are good candidates for cloudification. There are fewer and fewer obstacles to not consider Public Cloud Providers. Moreover, if required, Fully-managed Kubernetes services are available as software appliances.</p><p>Of course, they will be some challenges such as networking (dedicated connections), resiliency, privacy, and data localization.</p><p>But AWS and GCP propose tons of products that can be used, replace, work in parallel, be compatible with the current services and functions. Otherwise, some mitigations can always be found.</p><p>And taking advantage of on-demand resources, fast scale-out and up capabilities, strong SDN, auto-scaling features, full-managed services, powerful tools, it is relevant to consider them to leverage.</p><p>I couldn’t dive too much into details about all telecommunication architectures, services, infrastructures (otherwise, the post will become a book). So if you have some questions, feel free to comment or to ask.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93e26e09d341" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Managed services or not? IaaS, PaaS, SaaS… — how to choose?]]></title>
            <link>https://medium.com/@belougatech/managed-services-or-not-iaas-paas-saas-how-to-choose-74272a6f4876?source=rss-bc223afbcb13------2</link>
            <guid isPermaLink="false">https://medium.com/p/74272a6f4876</guid>
            <category><![CDATA[iaas]]></category>
            <category><![CDATA[infrastructure]]></category>
            <category><![CDATA[managed-services]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Monirath Ngor]]></dc:creator>
            <pubDate>Mon, 24 Feb 2020 06:34:08 GMT</pubDate>
            <atom:updated>2020-03-26T09:15:07.150Z</atom:updated>
            <content:encoded><![CDATA[<h3>IaaS, PaaS, SaaS…managed-services or not?— how to choose?</h3><p><em>Not only a comparison.</em></p><p>Your company or your client decides to Move to Cloud and you’re in charge of a wonderful project to migrate legacy applications or to create a new environment on a CSP (Cloud Solution Provider).</p><p>Rapidly, one of the questions that will come is to choose between IaaS, PaaS, SaaS (sometimes more) for some services.</p><p>We talk here about moving from a self-managed database installed on a bare metal server to a managed CosmoDB in Azure for example. Or, you have stars in the eyes with GCP pub/sub instead of your old unmaintained Rabbitmq instance. Or else, does it worth to use Dropbox compared to a cheap S3 AWS bucket?</p><p>Starting from a blank page, here are some considerations to take into account when designing the solution.</p><h3>Reminder</h3><p>First of all, here is a short reminder between IaaS, PaaS, and SaaS. This will help to know what are the key points to take into consideration for the choice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*2USZG5-YEePybZ8hG8WqVA.png" /></figure><h4>IaaS: externalization of the Infrastructure</h4><p>IaaS (<em>Infrastructure as a Service</em>) is a distribution model where the provider hosts the infrastructure (servers, CPU, GPU, RAM, Storage, network) and manages it.</p><p>The customer has full control of the OS, the middlewares and the applications.</p><p>Example: <em>Amazon EC2, Google Compute Engine (GCE), Rackspace</em></p><h4>PaaS: externalization of the Infrastructure and middleware applications</h4><p>In PaaS (<em>Platform as a Service</em>), the Cloud hosts the infrastructure and provides features and tools (OS, development tools, database management system, etc.), delivered over the Internet.</p><p>The customer can focus on the application development without worrying about infrastructure, OS or middleware management, and maintenance.</p><p>Example: <em>Amazon Elastic Beanstalk, Google AppEngine (GAE), Heroku</em></p><h4>SaaS: externalization of the Software</h4><p>SaaS (Software as a Service) is a distribution model of an application through the Cloud. The provider fully manages the application and makes them available through the Internet, most of the cases with a classical web browser.</p><p>The software is fully externalized and accessible by paying a monthly or annual fee.</p><p>Example: <em>Dropbox, Gmail, Microsoft O365</em></p><p>Each of the solutions has its pros and cons:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hVJ_l1z5WngJZK1XCFrQtg.png" /></figure><p>This is said, let’s move on now to the interesting part.</p><h3>When designing</h3><p>Here are some topics that can drive the choice. Depending on the situation, some of them may require more attention.</p><h4>Team</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uUUY8TOb0EHekHWMDOHHDw.jpeg" /></figure><p>It’s essential to know how the team is composed. Because they will be the users and the ones to build and operate on.</p><p>Those users can be already in place, or new people may arrive in the organization. HR and managers need to be involved.</p><p>Users can be more or less technical, have more or less developer background. Users can be internal, but also external resources, especially when expertise is required (using a specific framework for example).</p><p>Moving to a managed service may have a different impact. Some codes or the environment may require to be adapted.</p><p>IaaS won’t fit for a small team unless it has strong experience in the new infrastructure. Managed services may be expensive if an infrastructure is already in place because processes can be capitalized.</p><h4>Cost</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OTqaXT-piWB78W2yDWj_-w.jpeg" /></figure><p>Cost strategy is, of course, important to know because it can be a strong driver.</p><p>With SaaS solutions, everything comes with it. The price will be more expensive, but users won’t care about upgrades, hotfixes, incidents, administration, security, etc. So no technical staff or tools is required.</p><p>A lot of tools are provided with PaaS solution to ease users’ life, this is what you pay. They need to care only about the application.</p><p>With IaaS solution, you’ll get VMs. And the rest has to be built, administrated and operated (security, redundancy, network, backup, permissions, configuration, etc.).</p><p>Here, the calculators provided by the CSP will be your friend (you can build your own). Just check you’re in the right region, because the price may differ.</p><p>Example: <a href="https://cloud.google.com/products/calculator"><em>GCP calculator</em></a><em>, </em><a href="https://calculator.s3.amazonaws.com/index.html"><em>AWS calculator</em></a><em>, </em><a href="https://azure.microsoft.com/en-us/pricing/calculator/"><em>Azure calculator</em></a></p><p>It can be used compare for example the cost of a MySQL instance installed on a VM versus Cloud SQL, which is the MySQL managed service on GCP. If the requirement is a simple database with few users and replication is not critical, going to a managed service may not be relevant.</p><p>Another case is to compare a Cloud Storage service like Dropbox with a solution you can implement on a CSP. Rolling out your solution can be more expensive at the end. The storage itself is cheap, but you need to set up the frontend, the security, the replication and you need people to maintain the solution afterward.</p><p>And don’t forget to add other fees like licenses (OS, middlewares, usage licenses, etc.) or egress traffic to your project quotation.</p><h4>Current infrastructure constraints</h4><p>Analyzing the on-prem design may help to understand some constraints or justify a transformation opportunity.</p><p>You may have heard something like “it’s like that because it’s historical, it’s always been there”. 2 possibilities there. Either, there were some strong constraints and no-one was able to change it (a customized development or a dependency to a 3rd party). Or, the years have gone by and no-one cared about it.</p><p>Here, IaaS is very flexible and design can be customized to the constraints. Some adaptation may not be possible with managed services.</p><h4>Business growth, Limits, Quotas, and SLA</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w0Qkap7enhc8WXdNBppehg.jpeg" /></figure><p>Read carefully all the documentation about limits, quotas, and SLAs of the products or solutions you intend to use. This will prevent one round trip for nothing.</p><p>First, get inputs about how the business or usage grows. It’s about capacity and dimensioning. And compare figures with the limits and quotas like bandwidth, storage volume, IOPS, etc.</p><p>It’s even more true if a PaaS or SaaS solution is on the map. Packaged solutions can offer a rapid move to production with less management. But have in mind, the solution is built to answer to most of the needs, and may not be adapted to your situation.</p><p>And limitations are not only about numbers. But also about designing (network hops, tenants, peering, versions, configurations, etc.).</p><p>For example, you can’t customize every parameter field in a managed-database. Some types of managed-storage can be limited in the bandwidth. Or managed-firewall is limited in the number of rules.</p><p>SLA’s story is the way around. Managed services are pretty good. With IaaS, service recovery, incident management, and so on have to be prepared.</p><h4>GA, beta, alpha, prototype, and versions</h4><p>The beauty of Cloud providers is that they are quite dynamic and propose more and more solutions.</p><p>When moving an on-prem solution to a managed service on a CSP, check carefully version compatibility. The managed services may not support the same version.</p><p>Another thing is that brand new services are sexy but often still in alpha or beta. And the GA date may not match with the delivery time of your project.</p><p>Note that it’s not recommended to go to production with a beta version of the service.</p><h3>Recap</h3><p>Consider the following topics when deciding to go IaaS or managed services :</p><ul><li>Involve HR or manager regarding <strong>team availability and skills</strong></li><li><strong>Compare cost</strong> considering all you don’t have to do with managed services</li><li>Analyze current <strong>infrastructure constraints</strong></li><li>Estimate <strong>business growth and check limits, quotas, and SLA</strong> of managed services</li><li>Check Software <strong>versions compatibility</strong> and <strong>GA date</strong></li></ul><p>I hope it will help you to weigh the pros and cons!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74272a6f4876" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google Cloud Summit Paris — review]]></title>
            <link>https://medium.com/@belougatech/google-cloud-summit-paris-review-35011a2fb4b?source=rss-bc223afbcb13------2</link>
            <guid isPermaLink="false">https://medium.com/p/35011a2fb4b</guid>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[google-cloud-summit]]></category>
            <category><![CDATA[review]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Monirath Ngor]]></dc:creator>
            <pubDate>Thu, 22 Aug 2019 17:24:34 GMT</pubDate>
            <atom:updated>2019-08-23T08:48:52.390Z</atom:updated>
            <content:encoded><![CDATA[<h3>Google Cloud Summit Paris — review</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dNHAr5X03-kCjcawEGbiHA.jpeg" /><figcaption>Welcome to Google Cloud Summit Paris</figcaption></figure><p>Google Cloud Summit Paris took place on the 18th of June, at Paris Expo Porte de Versailles.</p><p>I was visiting the event in the morning. As there are no so many literatures on it, here’s my review.</p><p>Before the major event, a show “à l’américaine” warmed the public up with some freestyle footballers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q2ZEF-8eDsdgJJ1GTSvzPg.jpeg" /><figcaption>Show “à l’américaine” before the keynote</figcaption></figure><h3>Keynote</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JllsG1PipOLc0MhRaBux6w.jpeg" /><figcaption>Eric Haddad started the keynote</figcaption></figure><p>The keynote started with an introduction by <em>Eric Haddad</em>, the Managing Director France. He presented how much Google is investing in GCP in France emphasizing <strong>massive investment</strong> and the <strong>AI lab</strong>.</p><p>Then <em>Thomas Kurian</em>, the quite new CEO of Google Cloud, shared his vision. After a short introduction of Google story, he presented the 3 pillars of the strategy:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9jG_TbrZUAU8Wg6ZX98djw.jpeg" /><figcaption>Thoms Kurian talking about his GCP Vision</figcaption></figure><ul><li><strong>Distributed Infrastructure as a Service</strong>, especially with the brand new service <em>Anthos</em>, the open-source stack for hybrid cloud</li><li><strong>Digital Transformation Platform</strong>, classical</li><li><strong>Industry Specific Digital Transformation Solution</strong>s, meaning GCP has a solution for any kind of market from Health, to Retail or Manufacturing</li></ul><p>Both Thomas and Eric insisted on the recruitment, they seek to double their staff by S1 2020.</p><p>After what, we got a lesson of trust by <em>Suzanne Frey</em>, VP engineering. It’s interesting to know that GCP may help to comply with the complicated <strong>GDPR </strong>law.</p><p><em>Ulku Rowe</em>, Cloud CTO Office, is now a regular presenter. She talked about the last services and products:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F1Cx_EfIneBcyIGhNS8tmw.jpeg" /><figcaption>Ulku Rowe presenting new services</figcaption></figure><ul><li><strong>Anthos</strong>, with more details. The solution is based on Istio</li><li><strong>Cloud Run</strong>. GCP continues to enforce full managed services business with this service that runs stateless containers. The solution is based on Knative</li><li><strong>Cloud Data Fusion</strong>, that helps to manipulate data by ease ETL pipelines with no code</li><li><strong>AI platform</strong> and <strong>AI hub</strong></li></ul><p>At the end of the keynote, Eric presented a strong partnership with Sanofi, which will move 60% of their infrastructure to the Cloud.</p><h3>Partners and booths</h3><p>It was my 3rd times in the Paris event, and I can notice that partners and resellers numbers increase from year to year.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eMe8GkdBB7TQapwgGokGYQ.jpeg" /></figure><p>Regarding resellers, they were from small companies of south of France to the biggest one covering all territories. After discussing with several of them, they were all lack of resources. And always invited me to contract with them.</p><p>Other actors of the ecosystem were also present: vendors such as Cisco or Redis or 3rd party solution providers such as Datadog.</p><p>Google has their booths as well. I discovered Velostrava, a service to automate on-premise applications to the Cloud in a few clicks. The demo was quite impressive. The principle is the following: Velostrata analyses the on-prem vCenter and rebuilds the infrastructure on GCP. Then the operator plans migration waves and Velostrata is in charge to migrate the application. It looked very simple but it seemed also to work only on simple infrastructure based on VMWare (at the time being, so let’s see in the future).</p><h3>Sessions</h3><p>During my morning, I’ve participated in 3 of the sessions proposed by the agenda.</p><h4>A microservices implementation journey with GCP and Amadeus</h4><p>It was the story of how Amadeus was moving their applications into microservices and how they faced issues such as latency.</p><h4>Site Reliability Engineering: Alliging Developers &amp; Operators for Better Devops [L100]</h4><p>At Adeo, SRE is taken in charge by a fulltime team. The presenter explained the budget errors, SLO and how they were organized themselves.</p><h4>Computing at global scale</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jsb2RPLida-dlF_kdBclZg.jpeg" /></figure><p>That was very interesting because the Google Engineer presented the backstage of GCP with the services that help to scale globally. For example, she talked about Borg, the internal K8S orchestrator (a multi-tenants layer or virtualization) or Colossus (ex-Google FS) for planet-scale storage.</p><p>She also showed how to automatization can be part of workloads and infrastructure scaling.</p><h3>Feedback</h3><p>In terms of services, GCP continues to offer more and more one-click solutions like Data Fusion or Velostrata. The clean style console can be a nice advantage to work with.</p><p>New full managed services are released, such as Cloud Run. I rather prefer they focus on the existing one and work on a large number of restrictions around them instead of multiplying products.</p><p>The summit was interesting to learn how the ecosystem around GCP is evolving and the response to the competitors.</p><p>We’ll see, on the next couple of months, how Google will put their strength in regards to their ambition, in terms of resources, partnerships and new services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lo2dN-pQkor7WIeiEZj2HQ.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35011a2fb4b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GCP Professional Cloud Architect certification: tips and feedback]]></title>
            <link>https://medium.com/@belougatech/gcp-professional-cloud-architect-certification-tips-and-feedback-9813110613aa?source=rss-bc223afbcb13------2</link>
            <guid isPermaLink="false">https://medium.com/p/9813110613aa</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[certification]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-architecture]]></category>
            <dc:creator><![CDATA[Monirath Ngor]]></dc:creator>
            <pubDate>Mon, 25 Mar 2019 12:37:18 GMT</pubDate>
            <atom:updated>2019-03-27T10:07:34.320Z</atom:updated>
            <content:encoded><![CDATA[<ul><li>Congrats! How was the examination?</li><li>Well, it was harder than I expected…but I suppose that I prepared it correctly!</li></ul><p>I’ve passed it in March 2019 and I’d like to share my own feedbacks and feelings as it is still fresh. There are already a lot of resources about the examination, so I won’t depict in depth the content (you have it <a href="https://cloud.google.com/certification/guides/professional-cloud-architect/">here</a>) and learning process (focus, keep track, etc.) but I will rather give specific tips about this certification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S308o2J0aNFHP3s-HyOGIw.jpeg" /></figure><h3>Courses</h3><p>If you have the opportunity to take courses at a training center or with a professional instructor, do it. However, it’s not necessary if you are comfortable with an online course.</p><h4>On-demand course</h4><p>I recommend enrolling the <em>Coursera</em> specialization class: <a href="https://www.coursera.org/specializations/gcp-architecture">Architecting with Google Cloud Platform Specialization</a> made by <em>Google’s</em> instructors and is composed of 6 courses.</p><p>The first course is an overview of GCP. Then the courses 2, 3, 4 and 5 depict deeper main products covering compute, storage, network, IAM, services, etc. The <strong>last module about designing is important </strong>because <strong>you’ll be tested on your faculty to find a solution to a problem</strong>. It’s not only about the capacity to learn specifications by heart.</p><p>An interesting point with the courses is that you can download the materials (pdf files) if you want to review them offline. They can be used for a later purpose (as a reminder for example) or to complete your knowledge thanks to the additional comments.</p><p>The specialization course is not that hard if you already have a technical background but can take time (around 7–8 hours/week during 1 month).</p><h4>Preparation course</h4><p>Another course is available on <em>Coursera</em>: <a href="https://www.coursera.org/learn/preparing-cloud-professional-cloud-architect-exam/">Preparing for the Google Cloud Professional Cloud Architect Exam</a>. It explains general tips like top-bottom learning methodology and the main points to address when designing a solution. The most interesting topics are the <strong>samples of solutions are explained for the case studies</strong>. The rest is for refreshing your knowledge if you already have done the specialization course or having an architecting background.</p><h4>Case studies</h4><p>You’ll have several questions about the case studies, so prepare them carefully.</p><p>Read them multiple times if needed. So you won’t lose your time during the examination to understand what they are about. <strong>Analyze them in advance</strong>. In its preparation course, <em>Google</em> proposes a methodology based on the following template:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ayof-TceW4UiHUw48i3YGQ.png" /></figure><p>It’s not that simple IRL to fulfill the last column, but it is a good start.</p><h4>About the language</h4><p>Just a short note about the language. I did the courses in English but worked on the case studies in French because my browser redirects me automatically to the pages in the local language.</p><p>It’s not a big issue, but I recommend doing everything in the same language. Whereas I have well prepared the case studies, I have lost some times during the exam to read them again several times just to be sure I didn’t mistranslate the questions.</p><h3>Preparation</h3><h4>DevOps philosophy</h4><p>If you, like me, don’t come from a DevOps environment, learn about the philosophy and the existing tools. Tons of resources are available on <em>Youtube</em> or websites about CI/CD. So you’ll be able to know how GCP is implying in with its services such as Source Repositories, Deployment manager, Container Builder, etc.</p><h4>Labs</h4><p>If you never manipulate GCP, I recommend doing all the labs during the Coursera courses or on <a href="http://www.qwiklabs.com/">Quicklabs website</a>.</p><p>You won’t have any practical questions, but they will put a picture on all you’ve learned in the theoretical lessons and will strengthen your knowledge. And you’ll be able also to compare with other tools you usually work with.</p><p>Block time before starting a lab, particularly when it becomes longer (1–1h30) because you have to validate all the steps in a row.</p><h4>About the content</h4><p>In a nutshell, the examination covers case studies, data transfer, DevOps and CI/CD pipelines, storage, compute resources.</p><p>You’ll be tested on the main products but also others. Prior to the exam, take the time to read at least the short descriptions of <strong>all services and products</strong> that <em>Google</em> provides (this <a href="https://cloud.google.com/terms/services">list</a> but also this <a href="https://cloud.google.com/products">one</a>). So you won’t need to do mental reverse engineering to understand what Dataprep or Data Loss Prevention is during the examination (true story…).</p><h4>Blank examination</h4><p>Now you think you’re ready, test yourself with the <a href="https://cloud.google.com/certification/practice-exam/cloud-architect">practice examination</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xRT-zrLm5me7o-ST5wW9zg.png" /></figure><p>So, you’ll get familiar with the format and the type of questions. Attention, to me the practice exam is easier than the real one. I felt pretty confident until I was in front of the real questions.</p><h3>The examination</h3><h4>Examination center</h4><p>If you don’t live in a big city, prepare the logistic. There are not so many exam centers. In France, there are only 6 locations (with 4 in Paris). And they are not all available every day/hour. So, <strong>book it enough early</strong>. It will give you also the pressure of a deadline and force you to keep track of your learning.</p><p>On the d-day, If you don’t know the location, <strong>arrive in advance</strong>.</p><p>I have arrived at the right address around 15min before the given time. But it took me also 15min to find the exam center because it was hidden within all the buildings in a sort of a maze.</p><h4>No paper, no internet resource allowed</h4><p>Be sure, you have GCP products and services in memory. For the rest, your brain/CPU will be requested.</p><p><strong>Design experience</strong> and <strong>technical background</strong> are helpful because you’ll have some questions in a specific situation. For example: “the client has this structure but has this issue, what do you recommend to solve this problem?”.</p><p>I was a bit surprised about some questions that accurately pinpoint an error or a specific question. But the philosophy of the exam is to prepare for a designer role.</p><h4>No smartphone, no smartwatch allowed</h4><p>A countdown is displayed on the screen all along the examination to let you know the remaining time.</p><p>You have 50 questions to complete within 2 hours.</p><p>The big advice here is to make all the easiest questions first and mark the one you are unsure. So keep time some come back on them later.</p><p>Let’s say, you keep 15min for the marked questions. It lets you 105min for reading and deciding to answer/mark. So, keep the pace of <strong>2 minutes on average per question</strong>.</p><p>About me, I have consumed all the 2 hours to complete the questions.</p><h3>Result</h3><p>Once you have submitted the answers, you’ll get a provisional result. So you don’t stress a long time to know if you fail or pass.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uHsFbtIneP2BozPCGAQQBQ.png" /></figure><p>I have taken the exam on the 1st of March. Then it was pretty fast to get the final result. I have got it on the 4th of March.</p><p>If you pass, you’ll get an email with the <a href="https://www.credential.net/0y5ge7nw?key=caae2b119cfb4de7238caeccbffa3aab8883ffd11e76706272f2271c65f2fe9b">digital certification</a> which is nice if you want to brag on your favorite social media. You can now open the champagne!</p><h3>Bonus</h3><p>If you pass the exam, you’ll receive a nice gift from Google.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/1*tFyuNbdi8NPdv-LWpdme4w.jpeg" /></figure><h3>Tips recap</h3><p>Before the exam:</p><ul><li>Have a look at <strong>all </strong><a href="https://cloud.google.com/terms/services"><strong>services</strong></a><strong> and </strong><a href="https://cloud.google.com/products/"><strong>products</strong></a> of GCP.</li><li>Read and practice the <strong>cases studies in advance</strong>.</li><li>Learn about <strong>CI/CD pipelines</strong> if you don’t know about it.</li><li>Get familiar with the format by doing the <a href="https://cloud.google.com/certification/practice-exam/cloud-architect"><strong>practice exam</strong></a>.</li><li><strong>Book the date early</strong>.</li></ul><p>During the exam:</p><ul><li><strong>Arrive in advance</strong> on the examination center.</li><li><strong>Easy questions</strong> first and <strong>mark</strong> the one you have a doubt.</li><li><strong>Manage your time</strong>: reserve time for the marked questions and keep the pace.</li></ul><p>Good luck!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9813110613aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Zero Downtime Deployment (ZDD) and GCP AppEngine. Part 1/3]]></title>
            <link>https://medium.com/@belougatech/zero-downtime-deployment-zdd-and-gcp-appengine-part-1-3-1b4e7d6a831a?source=rss-bc223afbcb13------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b4e7d6a831a</guid>
            <category><![CDATA[design-process]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Monirath Ngor]]></dc:creator>
            <pubDate>Mon, 11 Mar 2019 20:38:50 GMT</pubDate>
            <atom:updated>2019-03-11T20:38:50.951Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>— What is your requirement about the application availability?</blockquote><blockquote>— Always up of course.</blockquote><blockquote>— Really?</blockquote><blockquote>— Really.</blockquote><p>I’m pretty sure you are familiar with this discussion when gathering requirements from the client or the end users.</p><p>One of the most common business requirements is to reduce downtime (or even to have none) during deployment of a new version, upgrades or fixes of an application or a system. It will make you think about deployment architecture. I’ll explain below the common patterns that are used commonly in the industry. Then, I’ll give a quick view of AppEngine, which will help to illustrate because we’ll mix them up at the last part.</p><p>So let’s get started with Zero Downtime Deployment first.</p><h3>What is Zero Downtime Deployment?</h3><p>Deployment teams may be faced to availability challenge when:</p><ul><li>A critical uptime is required. For example, an App is serving continuously with high demand. As a customer, you don’t want your preferred payment service, video-conference app, or social media displays you a prompt like “sorry, maintenance is ongoing, please retry later”.</li><li>Implementing Continuous Delivery or Agile processes. Updates will become more frequent. Dev teams are willing to move quickly to production in order to evaluate the new release.</li><li>Running worldwide services. Using a maintenance window is a good best practice for reducing downtime by using a period when the traffic is low. But when there is no break for international users, there is no ideal moment to perform the chance and ZDD can help.</li></ul><p>The goal will be to minimize the deployment impact when switching to the new version of an application or a system.</p><p>The principle is to avoid freezing the application during a long maintenance period in order to upgrade it. Instead, the strategy is to put in place a mechanism to route smoothly the users toward the new release.</p><p>ZDD methods can be applied whether the application is hosted in a Cloud or on-premises infrastructure.</p><h3>Common Zero Downtime Deployment patterns</h3><p>Here are the most common and popular patterns you can encounter in the industry and you can implement. Google, Facebook, Etsy, Netflix are using those methods (check the <em>readings</em> at the end of the post).</p><h4>Blue Green deployment</h4><p>In order to achieve Blue Green deployment, the following components are required:</p><ul><li>A second environment ready to handle the live traffic and as identical as the current environment. Its role will be to host the new version.</li><li>A Load Balancer (physical or software, router, DNS, proxy, etc. depending on the service). Its role will be to route users to the second environment.</li></ul><p>The principle is the following. The current app with version N is hosted in a first environment, and traffic in production is going through that path (let’s call it blue). And the new version N+1 is hosted in a second environment (green), there is no traffic in there. The deployment will consist of switching the traffic from the blue to the green path using the load balancer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l8wDLUz7mpofKtVjhUJLwA.png" /><figcaption>Basic Blue Green Deployment</figcaption></figure><p>After checking the new version is fully operational, the old version can be upgraded to N+1 or decommissioned for N+2 further upgrade.</p><p>The huge advantage is that rollback is really simple and fast. We just need to switch traffic back to version N if we encounter any issues along the way. No need to have a heavy rollback plan anymore.</p><h4>Canary Release</h4><p>Canary Release is a Blue Green Deployment associated deployment. The router doesn’t distribute the whole traffic but a piece or a percentage of users for the green path. It will help to check the service with real users and tests in production. In case of issues, the impact will be limited.</p><p>The transition can be realized in multiple steps. For example, by distribution only 1% first to the new release. If there is no issue, continue with 5% or 10%, 30% and ramp up as you want until 100% of the traffic. this method is helpful to verify the service stability when the load is growing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_QV3wFwQN9EkVauOB9u30Q.png" /><figcaption>Example of Canary Release</figcaption></figure><p>This method fits for A/B testing as well, by splitting traffic toward different versions and measure which version is performing better. The difference is that a Canary Release may imply a rapid rollback when encountering an issue, whereas A/B testing needs a longer period of observation.</p><h4>Dark Launch</h4><p>In this pattern, new features are visible to only a subset of the users. The new code is wrapped in the current version but is only activated by hitting a specific flag, tag or toggle.</p><p>Basically, users can be selected by their geographical location, email address, device, identifier, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*md39RJqoLlEXCRQje_Rq9A.png" /><figcaption>Example of Dark Launch by geographical location</figcaption></figure><p>In the beginning, the application is deployed with the new feature turned off. It’s transparent for the users at the moment. Then, changing the configuration of the application makes the feature available for the selected users.</p><p>The rollback is as easy as making the configuration change back.</p><p>Dark Launch is helpful to test a specific feature and verify its performance. So the feedback can be used for optimizing the application before the global release. Furthermore, it can be used for gradual deployment.</p><h3>Notes when designing</h3><h4>It’s not free</h4><p>Concerning Blue Green Deployment, another environment has to be dedicated and two versions are live at the same time. By consequence, it may also come with extra overhead (monitoring, processes, etc.). But the benefits will cover the cost rapidly.</p><p>If the application is hosted in a Cloud Service Provider, the move is quite straightforward because resources are elastic and deployment can be really fast. The extra VMs or containers created won’t cost that much as the old environment can be fastly decommissioned.</p><p>In the case of on-premises infrastructure or monolithic systems, some maths has to be considered during the design process. If the capacity planning and site reliability are done enough in advance, the deployment process can benefit from the extra environment. When scaling, a best practice is to split services horizontally (I will address this topic on next posts later on). In this case, the architecture may conduct already to multiple environments with one or two more in order to ensure high-availability. More the service is split, less cost is for resiliency.</p><p>Concerning Dark Launch, the cost will come from configuration management the development team has to adapt the code to allow toggle configuration.</p><h4>Use shared cache sessions and stateless when you can</h4><p>During the deployment, some users can be still attached to the old version of the application because of the session affinity set by the Load Balancer.</p><p>There are different ways to not drop the user:</p><ul><li>Use shared cache sessions so versions are transparent for the sessions.</li><li>When crafting the solution, think about decoupling stateful data from the application as much as possible.</li></ul><h4>What about databases?</h4><p>Database updates can be a pain, especially when the schema changes. It’s longer but possible to realize a ZDD.</p><p>The strategy is to decouple the application update from the database update. The application will have to support both versions of the database schema, or backward compatibility.</p><p>There are two approaches:</p><ul><li>Start with schema change which is backward compatible. Both old and new applications are compatible with the new schema. Perform then the Blue Green Deployment.</li><li>Start with Blue Green Deployment of the application. The new version has to be backward compatibility with the old and new schema. Then perform the schema change.</li></ul><h3>Notes when deploying</h3><h4>Shut down gracefully</h4><p>When switching the users to the new release, the old environment has to be drained without dropping them.</p><p>There are different ways to achieve it such as setting read-only mode, setting the load balancer to not point the old version any more or setting TTL for sessions.</p><p>In the release schedule, plan a period during when the application with the current version won’t accept new users.</p><p>Note that it may not work for an application running long processing (Big Data query for example).</p><h4>Combine them</h4><p>Deployment reliability can be improved by using several patterns one after the other. For example, after playing around with the new release in a sandbox, realize a FUT with internal users. Then, use Canary Release for a small number of end-users. At last, ramp up until global release.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l75ibGqePs0LefTRMIiyUw.png" /></figure><p>You can also use toggle features (Dark Launch) to realize a Canary Release.</p><h3>Best practices</h3><ul><li>Include zero downtime deployment consideration during the designing process, capacity planning or site reliability for example.</li><li>The environment hosting the new version has to be as much identical as possible with the current environment.</li><li>After a canary release, process a canary analysis where you’ll compare the new code with the old one (baseline) based on metrics: response time, errors, load, etc.</li><li>Automate everything you can, especially when deployments are very frequent. For example, automate the canary analysis process to get instantly the metrics instead of manual verifications.</li><li>Small and frequent changes are preferred. Failures will have less impact in comparison with heavy changes.</li></ul><h3>Bonuses</h3><p>Blue Green principle was used since a couple of years but named as such by Jez Humble and David Farley in their book Continuous Delivery.</p><p>Canary naming comes from the usage of <a href="https://en.wiktionary.org/wiki/canary_in_a_coal_mine">canaries in coal mines</a> in order to alert miners in the 19th-century. The Canaries can detect toxic gas emissions sooner than a human.</p><p>Dark launch pattern is called as such because companies don’t want to announce the rollout. Its name comes from Facebook when they have deployed usernames feature.</p><h4>Stories and Movies</h4><p><a href="http://code.flickr.net/2009/12/02/flipping-out/">Flipping out</a>, by <em>Ross Harmes</em> from Flickr.</p><p><a href="https://www.facebook.com/notes/facebook-engineering/hammering-usernames/96390263919">Hammering Usernames</a>, by <em>Tom Cook</em> from Facebook.</p><p><a href="https://developer.ibm.com/urbancode/docs/revealing-new-features-slowly-dark-launches/">Revealing new features slowly with dark launches</a>, by <em>Tim Mcmackin</em> from IBM.</p><p><a href="https://www.ebayinc.com/stories/blogs/tech/zero-downtime-instant-deployment-and-rollback/">Zero Downtime, Instant Deployment and Rollback</a>, by <em>Suresh Mathew</em> from eBay.</p><p><a href="https://landing.google.com/sre/workbook/chapters/canarying-releases/">Canarying Releases</a>, from Google SRE book.</p><p><a href="https://www.youtube.com/watch?v=aX54mhZbN58">AWS re:Invent 2015 | (DVO401) Deep Dive into Blue/Green Deployments on AWS</a>, conference by <em>Andy Mui</em> and <em>Vlad Vlasceanu</em> from Amazon.</p><p><a href="https://medium.com/netflix-techblog/deploying-the-netflix-api-79b6176cc3f0">Deploying the Netflix API</a>, by <em>Ben Schmaus</em> from Netflix.</p><h3>Wrap up</h3><p>Including Zero Downtime Deployment principles when crafting a solution may avoid pain in the future. The price to pay worths the benefits: anyone notices it, rollback is fast and simple, it can be used for gradual upgrades, etc.</p><p>In the next part, I’ll talk about AppEngine and why it completely fits with this principle.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b4e7d6a831a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[About architecture, GCP, Python, Mobile, IT processes…combinations and me]]></title>
            <link>https://medium.com/@belougatech/about-architecture-gcp-python-mobile-it-processes-combinations-and-me-93e662adfbdb?source=rss-bc223afbcb13------2</link>
            <guid isPermaLink="false">https://medium.com/p/93e662adfbdb</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[about-me]]></category>
            <category><![CDATA[itsm]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Monirath Ngor]]></dc:creator>
            <pubDate>Fri, 08 Mar 2019 14:54:22 GMT</pubDate>
            <atom:updated>2019-03-08T14:54:22.415Z</atom:updated>
            <content:encoded><![CDATA[<p>This is Monirath, <strong>technology lover and problem solver</strong>.</p><p>IRL discussions about how tech is interacting with our lives (personal or pro) triggered the desire to share my thoughts about it. That’s the reason I have created this channel — <em>be indulgent with the writing, this is my beginning :)</em> I’ll talk especially about domains of my expertise and knowledge, such as <strong>telecommunications, cloud design, data and many more</strong>.</p><p><strong>About me</strong></p><p>I have some <strong>backgrounds in telecommunications, networks and cloud computing engineering</strong> during my 13 years experience. <a href="https://www.linkedin.com/in/monirathngor/">My missions</a> have covered <strong>quality management, project management, studies, and architecture</strong>. For example, I’ve worked on designing scalable solutions for one of the first telco to roll out a fully <a href="https://newsroom.cisco.com/press-release-content?type=webcontent&amp;articleId=1824609">virtualized infrastructure</a> and private cloud with user traffic in production.</p><p>Then, I’ve participated in some entrepreneur projects such as a mobile app for helping children with educational disabilities after winning the <a href="https://twitter.com/sweparis/status/914551792096202752">2nd prize of <em>Startup Weekend AI</em></a>. As a <strong>side project</strong>, I’ve created from end-to-end the mobile app Contexte (<a href="https://itunes.apple.com/fr/app/contexte/id1431786421?mt=8">available in App Store</a>, but still waiting for Apple to accepts the updates…), which augments news and social media. Contexte is built with GCP, coded in Python, made available with Firebase and presented with Swift.</p><p>As a side note, I’m <strong><em>ITIL</em> (foundation and Service Transition) </strong>and<strong> </strong><a href="https://www.credential.net/0y5ge7nw?key=caae2b119cfb4de7238caeccbffa3aab8883ffd11e76706272f2271c65f2fe9b"><strong><em>Google Professional Cloud Architect</em></strong></a> certified.</p><p>One trait of my character is to be a <strong>self-taught person. </strong>So I have coding, Machine Learning and other things in my bag as well. And I like solving problems.</p><p>At last, and nothing to do with working, I’m freediver, play bass guitar and like photography.</p><p>Now, it’s time to mix everything up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2C119qXNTm1Kn6Smc4eJqg.jpeg" /><figcaption><a href="https://pixabay.com/fr/photos/ordinateur-portable-ordinateur-3187095/">Image</a> by <a href="https://pixabay.com/fr/users/rawpixel-4283981/">rawpixel</a> on Pixabay</figcaption></figure><p><strong>What you’ll find here</strong></p><p>As I mentioned, <strong>technologies influence fundamentally our relationship with so many sociocultural aspects</strong> such as communication, education, health or entertainment. But when we talk about technologies, it’s never about just one but a lot of them combined.</p><p>A smartphone would never work without a wireless station, which would never work without fiber link, nor compute resource and so on. And it’s not only about materials, but we also must not forget people, processes which may be the key points.</p><p>This is because of the <strong>combination</strong>. And not only one, but we can mix many of them, like legos, to propose multiple solutions to one problem. This is what I’d like to propose on this channel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qQuiEbpKbsoE345Brq-kFA.jpeg" /><figcaption><a href="https://pixabay.com/fr/photos/lego-build-blocs-de-construction-708087/">Image</a> by <a href="https://pixabay.com/fr/users/Efraimstochter-12351/">Efraimstochter</a> on Pixabay</figcaption></figure><p>In order to create a monitoring solution for a mobile backend, we can think about hosted or on-premises infrastructure, managed or internal services, micro-services or monolith service, etc…</p><p>The solutions will depend on the situation and the requirements. Qualitative, quantitative, scaling, size requirements will help to craft the architecture. Many factors will step in, such as latency, human resources, location, etc…but the beauty is that we have the choice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*gFSqy2flmyY2wy4Zycyv3A.png" /><figcaption>Defining quantitative requirements</figcaption></figure><p>During the next couple of months, I’ll come back on the designing process, combining tech and showing some solutions or clues.</p><p>For example, how we will 5G will need Cloud Computing, how to handle the capacity planning process in a virtualized infrastructure, how implementing ITIL with GCP, and so on.</p><p>See you in the next posts. It would be a pleasure to debate those topics. So don’t hesitate to write me for any comments, remarks or just to say hi!</p><p>Monirath</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93e662adfbdb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>