martes, 29 de marzo de 2016

Microservices

This week we read the article "Microservices" by James Lewis and Martin Fowler.
The microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API. These services are built around business capabilities and independently deployable by fully automated deployment machinery. There is a bare minimum of centralized management of these services, which may be written in different programming languages and use different data storage technologies.

Enterprise Applications are often built in three main parts: a client-side user interface (consisting of HTML pages and javascript running in a browser on the user's machine) a database (consisting of many tables inserted into a common, and usually relational, database management system), and a server-side application. The server-side application will handle HTTP requests, execute domain logic, retrieve and update data from the database, and select and populate HTML views to be sent to the browser. This server-side application is a monolith - a single logical executable. Any changes to the system involve building and deploying a new version of the server-side application.

Characteristics of a Microservice Architecture

- Componentization via Services
When talking about components we run into the difficult definition of what makes a component. Our definition is that a component is a unit of software that is independently replaceable and upgradeable.

Microservice architectures will use libraries, but their primary way of componentizing their own software is by breaking down into services. We define libraries as components that are linked into a program and called using in-memory function calls, while services are out-of-process components who communicate with a mechanism such as a web service request, or remote procedure call.

- Organized around Business Capabilities
The microservice approach to division is different, splitting up into services organized around business capability. Such services take a broad-stack implementation of software for that business area, including user-interface, persistant storage, and any external collaborations. Consequently the teams are cross-functional, including the full range of skills required for the development: user-experience, database, and project management.

- Products not Projects
Microservice proponents tend to avoid this model, preferring instead the notion that a team should own a product over its full lifetime. A common inspiration for this is Amazon's notion of "you build, you run it" where a development team takes full responsibility for the software in production. This brings developers into day-to-day contact with how their software behaves in production and increases contact with their users, as they have to take on at least some of the support burden.

- Smart endpoints and dumb pipes
The microservice community favours an alternative approach: smart endpoints and dumb pipes. Applications built from microservices aim to be as decoupled and as cohesive as possible - they own their own domain logic and act more as filters in the classical Unix sense - receiving a request, applying logic as appropriate and producing a response. 

- Decentralized Governance
Teams building microservices prefer a different approach to standards too. Rather than use a set of defined standards written down somewhere on paper they prefer the idea of producing useful tools that other developers can use to solve similar problems to the ones they are facing. These tools are usually harvested from implementations and shared with a wider group, sometimes, but not exclusively using an internal open source model. Now that git and github have become the de facto version control system of choice, open source practices are becoming more and more common in-house.

- Decentralized Data Management
Decentralization of data management presents in a number of different ways. At the most abstract level, it means that the conceptual model of the world will differ between systems.

- Infrastructure Automation
Infrastructure automation techniques have evolved enormously over the last few years - the evolution of the cloud and AWS in particular has reduced the operational complexity of building, deploying and operating microservices.

- Design for failure
A consequence of using services as components, is that applications need to be designed so that they can tolerate the failure of services. Any service call could fail due to unavailability of the supplier, the client has to respond to this as gracefully as possible. 

- Evolutionary Design
Microservice practitioners, usually have come from an evolutionary design background and see service decomposition as a further tool to enable application developers to control changes in their application without slowing down change. Change control doesn't necessarily mean change reduction - with the right attitudes and tools you can make frequent, fast, and well-controlled changes to software.

If you are interested in reading this article, here is the link: Microservices.

martes, 15 de marzo de 2016

The 4+1 View Model

This week we review two videos and one little article.

Video: 4+1 View Into Software Architecture
UML has several ways to describe how our system will look like. And so we can divide in Structure diagrams, Behavior diagrams and Interaction diagrams which define the mechanical or technical structure of the system, how the system is expected to behave, and how the system is expected to interact with other components or systems.

But UML is not the only way to describe how a system works, we have several different tools as: Use cases, Class diagrams, Deployment diagrams, Sequence diagram, State machines.
We have a special view which will help us achieving the same results: it is the "4+1 View Into Architecture" which is mainly describe as (4 views) Logical View, Development View, Process View and Physical View, and the (+ 1) Use Case View/Scenarios.

- Logical view: What sort of objects we are going to be building for the product.
- Development view: How the system is organized also called Implementation view.
- Process view: describe the concurrency and synchronized aspects of the software.
- Physical view: how the software and hardware are related.
- Use Case view: Explanation of how the system is expected to behave.
All separate but complementing each other.

Video: Six Blind Men
This video is about 6 blind men who touch an elephant to know how it looks like. The thing is that each of the blind men touch a different part of the elephant having each a different opinion of what an elephant looks like. At the end they all have a fight because no opinions are the same, even though they all touch the same animal.

Article: The Elephant and the Blind Programmers by Grady Booch
This is a little story about 5 blind programmers, as the story of the last video, this story is about an animal that arrives to the the town and 5 blind programmers approach to see what animal is it about. They all touch a part and made their own opinions and begin to argue. Finally a wise man Rashomon, tell them that they are all correct but each one of them is looking the animal with their own perspective and knowledge. So, in truth, the creature has all the characteristics that they all have observed.

If you are interested in watching these videos here are the links:
4+1 View into Software Architecture
Six Blind Men

Link for the article:
The Elephant and the Blind Programmers