Showing posts with label Cloud. Show all posts
Showing posts with label Cloud. Show all posts

Monday, August 3, 2015

Book Review: Cloud Based Architectures

Migrating to Cloud-Native Application Architectures, Matt Stine.

In the last few years, it can be very easy to believe marketing departments simply aren’t paid unless they use the word "Cloud" as often as possible.  Its usage has become so ubiquitous that is has inevitably become ambiguous so one very astute thing author Matt Stine does is outline what he means by "Cloud" (in particular cloud architectures) in the opening pages of this book.  Essentially, cloud architectures can be summarised by the three S’s. 

  • Speed: ability to provision and release resources (computing, networking and storage) with ease thereby achieving faster project development time
  • Safety: making software architectures more resilient (fault tolerance, fault isolation etc) 
  • Scalability: One the many non-functional characteristics that has become even more important with proliferation of mobile computing.  More mobile devices mean more application usage mean more back ends APIs getting hit.  Architectures must be able to respond to this demand otherwise applications fail. 

Twelve Factor App

Throughout the book approaches and patterns for achieving cloud based architectures are introduced. Now, if you have worked on anything distributed which was well architected, you will definitely experience a little bit of deja vu.  For example, the Twelve Factor App is a collection of patterns developed by engineers at Heroku containing twelve (you guessed it) principles to guide a good architecture fit for cloud.  You are sure to have used codebase (make deployable units have their own code base), dependencies (use proper tooling for managing dependencies), config (externalise configuration), backing services (databases, caches etc should be consumed identically by all resources) before but patterns are supposed to be common solutions to common problems and good architecture is good architecture, so it is not unexpected some of the described approaches won’t always sound completely new. 

Microservices

How do Microservices help enable the 3 S’s?
  • Speed: Deployment is much simpler and faster with independent code chunks.
  • Security: Not too much here, but it is fairly intuitive that if you break something large into small chunks it is much easier to access control sensitive parts. 
  • Scale:  Much easier to only have to scale the parts of an architecture you need to scale as opposed to having to scale the entire architecture - which is what happens in a Monolithic application.

Cloud Migration

For organisations to move to Cloud based architectures, several changes are needed:
  • DevOps rather than Silos: this is to facilitate speed of delivery.
  • Continuous Delivery:  one way to be to sure the problems of long release cycles are guaranteed to be avoided 
  • Decentralise autonomy:  yes, it is a nice idea to give everyone more power and influence. It will certainly speed things up. But, in my own view some things (core APIs, major technical architectural decisions) should only be handled by people of a certain technical background who are prepared to be fully accountable for them.  Would you let every person working on the design of a bridge or in a heart transplant have the exact same say? 
  • Inverse conway manoeuvre: Software companies should do their architecture first and then re-align their organisations to fit that so that they avoid the anti-pattern of making architectures to resemble an existing organisational structure.   This sounds nice in theory but it may not be so easy to achieve (possibly easier to do in very small companies that never have a strict organisational structure anyway).

Break up the Monolith

So if you have bought into the cloud based approach and since it’s unlikely your project is green field, you need to figure out how to break up the Monolith.  Some ideas include:
  • Bounded Contexts: This allows inconsistent definitions of concepts as long as they are consistent inside a well defined context which makes it much easier to decompose data models. For example, in the Security context a User may always refer to something that can be authenticated and has particular roles but in a Management context it would be something that has an image, an address and some application capabilities (checking out a shopping cart).
  • Identifying bounded contexts in the monolith and making them micro services.
  • Containerisation: Using something like Docker can provide many advantages to using VM's
  • Writing new features as micro services
  • Making the Monolith look like micro services by using anti-corruption layers

Spring cloud and Netflix

By the sounds of it Spring cloud's and the Netflix OSS project sound like an absolute must to checkout. Amongst other things, they help:
  • Achieve dynamic configuration
  • Implement sophisticated service discovery
  • provide alternative to load balancing which involve client side more.  
In addition, Netflix's Hystrix library (which provides some very useful metrices) employs some clever fault tolerance patterns:
  • circuit breakers - if a system notices that another system is broken it stops calling it.
  • bulkheads -  failure is limited by strict partitioning

Any negatives?

So lots of positives about this book.  Plenty of well explained information in a short number of pages. That is a major achievement.   I have alluded to a few minor points above, but they are very minor.  It would be very difficult to criticise this book in any substantial manner especially when it is free.    

However, it is important for the reader to bear a few considerations.
  • Business realities: Approaches such as Continuous Delivery just may not fit your business plan.  Why would you want to provide a feature someone hasn’t paid for?  (In fairness, the author does make this very point, but it really is worth re-iterating)
  • Technical realities:  One problem I have with many software approaches is that they assume that everyone is at a given skill level. In an ideal world the only people who work in software engineering would be very good engineers but the reality is there is always a very wide range of skill levels on any project.  From super meticulous to complete spoofers.  This means that some things that can sound very elegant in theory but a lot more difficult to achieve in practise.  When considering moving to things like DevOps, there will definitely be benefits. But are organisations going to find it easier or harder to make engineers accountable? I would imagine there would be serious risks of it being latter if it is not properly thought through.
  • Some concepts e.g. Client Side load balancing sound very interesting. But, they are only introduced rather than critically analysed.  Much more research and thought would be required (for me anyway) before considering adopting.  


Friday, June 10, 2011

A very good example of a Cloud Computing product from Dublin's JLizard

Logentries is an interesting product from Dublin start up JLizard. This product is a brilliant example of SaaS. Users run software hosted in the cloud; they don’t worry about complex set up; they use the software via a thin client; they pay only for what they agree to use. Now, since JLizard have a Dublin connection (it is a spin out company from the Performance Engineering Lab at UCD) we gotta fill you in!

Help me understand my logs?

We all know log files can get verbose very quickly making it difficult to spot patterns and identify what’s important. The Logentries product solves this problem by allowing you define tags for your logfile to identify parts (for example the exceptions). It also allows you to generate a pictorial view of your logfile which highlight your tags. Not only is this a very good way to provide a summary of a logfile, it makes it much easier to spot patterns.

In addition the logentries product allows searching and filtering to make it easier to identify the important parts of the logfile quickly. It also makes it easy to check on-line resources. For example, let’s say you get a DB2 exception with a DB2 error code. Just highlight it, and immediately you can check what Google and Google code can tell you about that obscure error code. All clever stuff. The UI is also very user friendly. A demo is available here.

So what’s the relevance of the Cloud to all this?

Where Logentries gets really interesting is that it is architected in a Cloud as a Saas. So what difference does this make to a tool that can make an ugly logfile look pretty? Well quite a lot really.

Suppose you have customers in disparate places all running your software and generating logfiles on their systems. When problems inevitably happen, you will need to see the logs. This requires co-ordination and some ftp’ing which all mean time. Logentries solves this problem. It provides instant access by using an agent which is deployed in the system listening to what is being logged. Effectively, the agent is a like a smart log4J appender - listening to what is being logged but unobservable to the system which does the logging. The logged information is sent to the Cloud securely in real-time. This means you can view it instantly.

But if my customers are already in the cloud (or I can access their VPN) what difference does this all make?

The point here is that the customer does not have to move to the cloud. Many organisations are reticent about moving their architectures to public cloud or many just don’t have the need. Virtualization suffices. The Logentries agent means the load balancer, the AppServer, byte code and the database data stay where they are because it handles the communication – securely. All that ends up in the cloud is the logfile.

Any more?

Of course. The Logentries product is a very good example of the usefulness of the elasticity provided by a Cloud architecture. If more logs are generated than you anticipated and you need more disk space and upload bandwidth, it’s no problem because the Cloud means if you need more resources you can get them – quickly.

Don’t forget it’s a SaaS!

Logentries is a brilliant example of a SaaS. You pay to use the software, it resides in the cloud, set up and ready to go. You only pay for what you use. It is a brilliant example of the type of products we can expect as the computer industry moves to generation Cloud.

References:

1. http://twitter.com/logentries

2. https://logentries.com/

3. https://logentries.com/blog/

4. http://www.linkedin.com/company/jlizard%27s-logentries

5. http://www.siliconrepublic.com/start-ups/item/21146-jlizard-secures-50-000-inv

Saturday, June 4, 2011

Cloudspeak

Let's have a look at some of the technology lexicon associated with Cloud Architectures.

BigTable
Cloud database offered by Google. It is non-relational and highly scalable.

Cloud computing
There are five principles of cloud computing
1. Resources are pooled
2. Machines are virtualised (achieves maximum utilisation)
3. Elasticity. Users can scale up or down very easily.
4. Virtual machines can be created or deleted automatically
5. Billing is by resource usage rather than by a flat fee

CloudBursting
Cloudbursting concerns hybrid architectures where a classical enterprise architecture can make use of a cloud on demand. This means that part of the architecture can be behind a private firewall and be kept away from the cloud completely but the elastic benefits of the cloud are still possible should periodic or unexpected traffic occur. In the cloud bursting model, the load balancer is not in the cloud. The load balancer decides when to use the cloud based on demand and traffic.

Commodity computers
Commodity computers are cheaper computers used in architectures which do not require the hardware to be highly reliable. This is usually possible when the software has a high degree of failover incorporated. Google's MapReduce framework uses commodity computers and then reassigns tasks if any of the commodity computers fail and do not finish allocated tasks.

Data centre
The physical home which stores all computational resources
Facebook has various data centres in the US see:
http://www.datacenterknowledge.com/the-facebook-data-center-faq/

Infrastructure as a Service (IaaS)
This is the lowest level of service available from a Cloud. In this case, the Cloud provider simple provides virtual machine images with an operating system. Amazon's EC2 is an example of IaaS.

Hypervisor (also called virtual machine manager)
A thin layer of software that allocates hardware resources dynamically and transparently to virtual machines. The term hypervisor was coined as an evolution of the term "supervisor," the software that provided control on earlier hardware.

Platform as a service (PaaS)
Allows users to create their own application using the Cloud provider's platform and tools. This allows rapid development but also means there is a risk of vendor lock-in.

Example: Google's AppEngine, Microsoft's Azure, force.com

SimpleDB
Cloud database offered by Amazon. It is non-relational and highly scalable.

Sharding
Sharding is based on the "shared-nothing" principle. There are no dependencies between different portions of data. To achieve this usually involves denormalising data so that dependent data is stored together. The result is parallel processing of independent data is possible and hence higher concurrency is possible.

Data can also then be partitioned very easily. This is usually done horizontally - splitting up rows into separate partitions. Each individual partition is referred to as a shard or database shard. Partitioning data means the total number of rows in each table is reduced. This reduces index size, which generally improves search performance.

Software as a service (SaaS)
Allows users to run existing online applications.

Example: Salesforce.com, pixlr.com, jaycut.com

Private Cloud
In this model there are no subscribing customers, the computing resources are controlled by a single organisation. But, the resources are still pooled and shared; machines are still virtualised. The difference between the private cloud and standard virtualisation is that in the private cloud model, the virtual machine creation and deletion can be automated and can achieved very quickly and thus elastic scaling characteristics that are associated with cloud computing that can't be with standard virtualisation can be achieved.

References:
1. Google AppEngine http://en.wikipedia.org/wiki/Appengine
2. Google's map reduce http://en.wikipedia.org/wiki/Mapreduce
3. The Cloud at your Service, Jothy Rosenbery, Arthur Mateos (Manning).