tug of war

Discussion – GitHub vs Bitbucket

If you want a large development team to collaborate and work on a certain project, you need to choose the right source platform to upload your code.

You can pick any repository hosting platform but unfortunately not every repository host makes your developers more productive in creating products as you’ve planned.

GitHub and Bitbucket are the two most popular repository hosts that provide its customers both public and private repositories.

These two have grown strong communities and user bases over the years.

Tl; dr;

GitHub and Bitbucket are the two best-known version control systems on the DevOps market.

The two offers features appealing to everyone from individual developers, to small teams and right through enterprise customers.

Their most basic and fundamental difference is that GitHub is more focused around public code having a huge open-source community, while Bitbucket is for private having mostly enterprise and business users.

What is GitHub?

github logo

Source: thenextweb

GitHub is a for-profit company that offers a cloud-based Git repository hosting service, helping developers store and manage their code, as well as track and control changes to their code.

It is the most popular version-control system with some 57 million code repositories on file. Also, it is loved by the open source community as public repositories are free.

It only supports Git (not Mercurial or SVN), written in Ruby and Erlang and is available for Windows, Mac and Android.

Its key features include:

  • Social coding;
  • Collaboration;
  • Integrated issue and bug tracking;
  • Graphical representation of branches;
  • Code review;
  • Code hosting;
  • Team management;
  • Project management;
  • Propose changes;
  • Protect branches;
  • Tracking and assigning tasks;
  • @mentions;
  • Conversations;
  • Milestones;
  • Assignees;
  • Integrations;
  • Documentation;
  • Set community guidelines;
  • Built-in review tools; and
  • Team and user permissions.

Advantages of using GitHub

  • An integrated issue tracker, helping teams to track issues within their project in real-time;
  • Contains milestones and labeling features to assist users in tracking information changes;
  • Offers branch comparison views reviewing the state of the user’s repository across commits, tags, and timescales;
  • Supports more than 200 different programming languages;
  • Allows users to host and publish theirown codes on the GitHub platform across the SSL, SSH or https environment; and
  • Has the ability to highlight syntax (its edge over other platform offers).

What is Bitbucket?

bitbucket logo

Source: stackshare

An Atlassian product (the makers of Trello and other apps), Bitbucket is very well-known for its full integration with other products in the Atlassian family such as Jira, Fisheye and Bamboo. It enables you to have a slick and clean interface the moment you log-in.

The product tool is primarily tailored in helping enterprise developers. It is written in Python and uses the Django web framework. It supports Git and Mercurial VCS (but not SVN) and comes with SOC 2 Type II security compliance.

Bitbucket is available for Mac and Windows and Android via an app.

Its key features include:

  • Workflow control
  • Access control to restrict access to your source code
  • JIRA software integration
  • Snippets
  • Collaborative projects
  • Smart mirroring (beneficial for enterprise level)
  • Code clustering
  • Mercurial repository hosting
  • Latest and Updated APIs
  • Full support for large files
  • Supports external authentication with Github, Facebook, Google and Twitter.

Advantages of using Bitbucket

  • Allows users to construct an internal issue tracker within their repository so that they can track down bugs in real-time;
  • Enables its users to access control features, regulating access permissions for different people involved in the project;
  • Incorporates two deployment models, allowing users to either placing the code in a cloud environment or launching a separate in-house server;
  • Offers both Git VCS and Mercurial;
  • Easy to navigate and search;
  • Helps users to migrate their code from old repositories to new repositories of BitBucket; and
  • Though not offering the highlight feature, Bitbucket still add comments and launch threaded discussions.

GitHub vs Bitbucket: Which one is better?

Summing up, Bitbucket is easy to use and a bit forgiving if you are just new to git, as you learn the workflow.

If you are interested with open-source development, GitHub is the major platform in open-source and public code. While, Bitbucket specializes in business clients.

For teams with only a few number of people Bitbucket can be your friend.

In terms of package, GitHub falls a bit on the pricier end of the spectrum in comparison to BitBucket and also promises a bigger community.

Weighing across other attributes and features, GitHub takes the top shelf and irrefutably the best version control repository in the market.

Whatever development tools you use, may it be Bitbucket or GitHub, anyone can guarantee great service for both of these products.

Summary

GitHub and Bitbucket are development tools that caters different services and demographics. GitHub basically has a huge open-source community while, Bitbucket has enterprise and business users mostly.

It is not that you can’t have a private repository on GitHub (yes you can) or you can’t post codes publicly on Bitbucket (again, you can). It is such that, the majority of the users aren’t doing so.

Outside their differences, the two platforms function very similarly.

By Tuan Nguyen

microservices logo

Microservices – when NOT to use?

For the last few years, Microservices has become a hot topic and many business are making their choice of moving into this software architecture.

Microservices is a major architectural pattern in the software industry. This architectural model can optimize your team’s speed by adjusting how they design and ship code.

That’s why, developers and business leaders can accomplish their projects in no time.

In my previous blog post, we have discussed briefly about microservices and what they can offer. But not all things are always the 100% right solution and microservices is not an exception. Here’s why.

Tl; dr;

Microservice jigsaw puzzle

Source Open Source For You

Microservices is a discrete software service, typically defined as breaking up a complex system into more manageable, smaller units of work that can be independently developed and deployed.

That’s why developers and business leaders who implemented the model can be able to solve complex system level problems easier by breaking it into smaller ones.

Microservices

microservices structure

Source: microservices.io

Microservices develop applications through small interlocking pieces of one giant whole. These are split into decoupled components that interact with each other via Application Programming Interfaces (APIs) and is developed and maintained “separately” from one another so updates don’t require re-doing the entire codebase.

Upon implementation, the model enables an organization to evolve its technology stack with continuous delivery or deployment of large, complex applications.

Though the key benefits of microservices are loosely coupled, independently deployable, highly maintainable and testable, and organized around business capabilities, it is also poses certain challenges:

  • It is hard to design correctly. Takes you a lot of iterations to land on satisfying domain design and boundaries.
  • It comes with a host of technical complexities.It multiplies the number of APIs, has complex transactions across several services and debugging distributed systems, and introduces network latency.
  • It requires an organization shift to autonomous, cross-functional teams. Meaning frontend and backend developers, data platform engineers, QAs, product managers, and ops are all in a single team.
  • It requires a change of process and practices. Microservice architecture’s success depends upon the capacity of organization and process to change.

When NOT to use it?

Microservices is not always 100% right solution for your products or fit for your team.

As it turns out, what works for largely complex programs doesn’t always work at a smaller scale.

In an interview, Daniel Bryant, a Chief Scientist at OpenCredo and a JAX London speaker, gets asked about this and he said:

“I get asked this question quite a lot, and it is difficult to give a definitive answer. However, situations where microservices may not be beneficial include:
– Working with a simple application domain
– Developing software with a small number of people in the team
– No problem/solution or product/market fit e.g. you are a startup that is still exploring your business domain and how to make money
– When the organisation is not embracing DevOps principles (i.e. see Martin Fowler’s Microservice Prequisites article).”

In addition, you also need to ponder on these practical points

  • Don’t go full with microservices if you are uncertain of what you are doing. It can have unsuspected difficulties along the way. Next thing you know, you are grinding your development to a HALT.
  • Don’t go for microservices when you don’t want to invest in more extensive logging and monitoring. Developers need to prepare for unfindable bugs or performance issues.
  • Don’t go for microservices when you don’t know: where your bounded context boundaries lie; which parts of your application need to be scalable; or which modules will be very chatty.

Summary

Microservice architecture is an approach in designing software applications wherein some types of applications become easier to build and maintain when they are broken down into smaller parts which work together – each component is continuously developed and separately maintained.

The model enables an organization to evolve its technology stack with continuous delivery or deployment of large, complex applications upon implementation.

But it poses certain challenges:

  • It is hard to design correctly.
  • It comes with a host of technical complexities.
  • It requires an organization shift to autonomous, cross-functional teams.
  • It requires a change of process and practices.

You DON’T use microservices if:

  • you are working with a simple application domain;
  • you are developing a software with a small number of people in the team;
  • you have no problem/solution or product/market fit – if you are a startup who’s still exploring your business domain and how to make money;
  • the organization is not embracing DevOps principles;
  • you are uncertain of what you are doing;
  • you don’t want to invest in more extensive logging and monitoring;
  • you don’t know where your bounded context boundaries lie;

By Tuan Nguyen

microservices logo

Microservices – what are they?

Microservices is one of the buzz-word in the technology world these days. Every big name likes to say it, lots of salespeople speak of it. This post will discuss about what is a microservice, and how does it change the way we design the software architecture.

Thanos quote

Tl; dr;

A big monolithic application can be split out into smaller components, or in this case, services. A service should have one task, and one task only. This approach increases efficiency, scalability, and allow for smaller development teams.

What are microservices?

Monolithic vs Microservices architecture

A “microservice architecture” is an approach to developing a software application as a series of small services, each running autonomously and communicating with each other, for example, through HTTP requests to their APIs.

Normally there is a minimum number of services that manage common things for others (such as database access), but each microservice is small and corresponds to a business area of ​​the application.

In addition, each one is independent and its code must be able to be displayed without affecting others. Even each one of them can be written in a different programming language since they only expose the API (a common interface, which does not care about the programming language in which the microservice is programmed below) to the rest of the microservices. There are no rules on what size each microservice should have, nor on how to divide the application into microservices.

Comparing the “monolithic” approach with the microservices approach

So that you really understand what we are doing with the microservices, let us examine a very simple example. Imagine that we want to make a web application, Amazon type, but simpler. Users enter our website, see the products we have for sale, and when they buy an item, we manage the delivery of the product to their home.

Monolithic structure

monolithic architecture

A first idea of ​​how to deal with this application would be the following monolithic structure: We can access the website of the store, make purchases, etc., thanks to a server, a machine that is executing the code of the application, in the form of a war file, which eventually connects to a database to retrieve information.

When a user purchases a product via the web, the application will respond the way we have programmed, but the code of the different business logic (inventory, payments, shipments) although it may be separated into different modules of the code, it is finally packaged in a single executable file. That’s why we call it monolithic architecture.

In addition, to scale the application (for example, to serve many users) we will have to run copies of our application under load balancers, which will redirect users to one site or another, depending on whether the system is very saturated. In this case, we will have to replicate the entire application, even if only the payment module concentrates the overload.

But on the other hand, if our application is not very complex, the upload will be simple and easy to manage, since in this case, we are talking about a single executable file.

Vision of microservices

microservice architecture

Instead of having a single executable, each component is an executable by itself, and the services communicate with each other through calls. In this case, we also have a microservice that implements the web interface with which users interact and certain logic below to call the microservice for payments, inventory, and shipments when necessary.

Characteristics of microservices

Here are some of the characteristics of microservices.

  • Components via services. Each small components of the application, e.g. database, payment gateway, shopping cart, etc., can be put into their own services.
  • Services organized with a focus on business capabilities. Your payment gateway can be custom-tailored to your business needs. You need to integrate Paypal – make a service that does just that. You need to hide the apartments that do not allow pets from people who have dogs – make a service to do that, and intercept the dataset coming back from the API.
  • Products and not projects. Each microservice represents a product. They can be treated separately without the need of knowing what is happening to other microservices.
  • Decentralized government. There are no central application to dictate how the whole application works. Each service talks to each other, forming some sort of a peer-to-peer network.
  • Decentralized data management. As a best practice, microservices should have their own local data storage. Therefore each service can have the data that is relevant to its task stored locally.
  • Evolving design. Business requirements can demand microservices to be put in or pull out as needed. As the business grows, it is much easier to create/remove microservices than to alter the huge code base of a monolithic structure.

Advantages and disadvantages of microservices

Now we know what microservices are as well as their architecture and main characteristics. Therefore, we will detail some of its advantages and disadvantages.

Advantages

  • Minimal work team. Each team can manage the development of a microservice, and this generally does not need a lot of people (small team of 3 to 4 people is preferred)
  • Increase in efficiency. By optimizing each microservice, the total efficiency can be improved.
  • Scalability. It is much easier to increase the capacity of a microservice, and combine with other services, it boost the the application’s ability to serve more users.
  • Modular functionality, independent modules. microservices should be independent from each other. For instance, a microservice should only care about the input data, not where the data is coming from.
  • Freedom of the developer to develop and deploy services independently. developers can use any programming languages that he or she feels comfortable with, or it is the most suitable language for the task at hand. In monolithic application, there is less flexibility in choosing which language to use.
  • Allowing the deployment and development of the application quickly. With the introduction of Docker, Kubernettes, AWS, etc., continuous integration/continuous deployment is another buzz word now. Business needs to have a quick development phase to keep up with the ever-changing requirements. By deploying microservices concurrently, booting an application to its ready state is much faster.

Disadvantages

  • High memory consumption. Each microservice needs a certain memory and storage to operate. Having a considerable amount of them can cost a lot of resources.
  • The complexity of management of a large number of services. Netflix has over 13,000 git repositories, and most of them are services. Sometimes it is not transparent if there is an existing microservice that resolves a problem.
  • Network latency or load balancing. If not structure correctly, microservices will keep calling each other, resulting in a chaotic communication network. As a result, the time to return the result to the end user can be impacted negatively.
  • Complex tests or tests for distributed deployment. End-to-end tests can be a nightmare. For example, we need to test the workflow of putting a product into a shopping cart, then use American Express to checkout. This could involve multiple microservices and the testing solutions can be complicated.

Summary

As we have seen, microservices have numerous advantages that facilitate processes when using an app. However, being a novel system a large majority of CIOs will be slowed down to implement these systems in their company due to the complexity of some features.

However, the implementation of microservices could have a great impact on large companies in a positive way for increased efficiency. An example of this we see in Amazon or Netflix that have already implemented this technology.

More information on microservices can be found here.

Next post: Microservices – When NOT to use?

By Tuan Nguyen

Katalon logo

Software review: What is Katalon?

One of my friends was looking for an end-to-end testing framework to integrate with his stack, and suggested that Katalon was something that he had been considering.

Let us take a quick look into it and deduce some of its advantages as well as disadvantages.

 

Tl; dr;

Katalon will not be my first choice when it comes to E2E testing. I think if I have a choice to rewrite my end-to-end testing code, I would choose a framework like cypress or puppeteer. Mainly because I am heavily tech oriented.

Some pros that I uncovered:

  • Non-technical oriented.
  • What you see is what you get.
  • Can use different browsers (Firefox, Chrome, etc.).
  • Less work to create test cases to start testing.

And some cons, of course:

  • Usage of versioning to keep track of updating/creating test cases are not straightforward. I have more thoughts into this below.
  • Big application size.
  • Unknown backward compatibility for created projects.

 

Installation

Katalon is free to download and use. You can easily get it from https://www.katalon.com.

This step really takes me back to the old day when software applications didn’t come with an installation file, instead they came with just a zip archive and after extracting the file. Boom!!! You got the ready to run software.

Only thing that I personally feel a bit uneasy is the size of the software. The archive file is about 331.5MB, and after extraction, the whole thing takes approximately 500MB. Big application size can sometimes slow down your CI/CD process, since it takes some time to download and therefore delays other dependent tasks to run.

 

First look

Katalon first look

Looking quite simple. To start using Katalon, you just need to open the application, and create a project. Then, click on Record web button to start working on your first test.

 

“Writing” your test

Not really writing though, the brilliance of Katalon is that you can interact with the website normally, and it will record all your activities, step by step. Then you will need to add your own conditions into the test to verify that the workflow is doing what you want it to do.

Let’s see a simple workflow below.

You can see that just in a few clicks, I already have a simple test case to test whether the login failed text displays. This is super useful for non-technical background people, since they can just interact with the website and do little editing, they can already test the website.

 

Some thoughts…

The documentation seems to be detailed. Most of the information that I need to have a quick look-around is in there. They clearly have spent quite a bit of time into documenting and make our lives easier.

Workflow is simple and visual. Personally if I am not technical oriented, this will be my first choice to learn about E2E testing. However, comparing to other frameworks like cypress or puppeter, we need to commit the whole project and note down the version of Katalon so that we can replicate the project in another machine. This can cause incompatibility and inconsistency. With other frameworks, we can create a git repository and simply push all test cases code to it. With npm, it is easy to reinstall in another machine.

Imagine that you created a project in version X, then later on decided to upgrade Katalon to version Y. There are unknown compatibility issues that may happen, which we will need to read the actual test cases code to resolve the problems. I think it defeats the purpose if we need to actually write/edit the code for Katalon, even though they offer an option to do so.

 

Epilogue

Well that is my 5 cents on Katalon, and how would I use it to test a website. There are so many features that I have not touched yet. There is a high possibility that it offers something extraordinary that defeats other frameworks. However for a quick look, it does not appeal to myself as a technical person.

How to upgrade PHP version to 7.2 on Ubuntu 16.10

I decided to upgrade the PHP version in one of my servers from 7.0 to 7.2 to live with the bleeding edge. The process went quite smoothly, except for the last step which I needed to do a bit research.

 

First thing’s first: check your current version

php --version

Also create phpinfo.php file in your /var/www/html directory

<?php phpinfo();

and run the file to be sure that both php CLI and apache version are the same.

 

The Upgrade

You can use a third-party repository to install the latest version of PHP. We’ll use the repository by Ondřej Surý.

First, you need to install the repository.

# install required package so you can add repository
sudo apt-get install software-properties-common

# install the repository and update the repository list
sudo add-apt-repository ppa:ondrej/php

Then, update packages in the system

sudo apt-get update && apt-get upgrade

 

Install PHP 7.2 (or newer version, you can just change the version number in the command)

sudo apt-get install php7.2

 

(optional) install PHP modules, depending on your needs. Note that the version of PHP has to be specified

sudo apt-get install php7.2-dev php7.2-zip php7.2-curl php7.2-gd php7.2-mysql php7.2-mcrypt php7.2-xml libapache2-mod-php7.2

 

Verify PHP version using the command line

$ php --version
PHP 7.2.13-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Dec  7 2018 08:07:08) ( NTS )

 

Verify PHP version using phpinfo.php file we created earlier.

!@$^%@$^, the PHP version is still the previous one!!! The reason is that apache is still running with the old PHP version. We will need to change that so the server can run with PHP7.2.

Let’s run the following commands:

# disable old php module
sudo a2dismod php7.0

# enable new php module
sudo a2enmod php7.2

# restart the server
sudo service apache2 restart

Verify the PHP version again, and it should be updated to our new version.

PHP version 7.2.13

If you want to upgrade to a different version of PHP, just change the version number while installing, and don’t forget to disable the old PHP module and enable the new one for Apache.

I hope this helps you with your work, and have fun upgrading 😀