Progressive Image

Large images on landing pages is a nightmare for any web developer. She has to optimize the page load time without affecting the user experience or the quality of the images on the page. If the landing page loads slow, it usually drives away the visitors. This is where the progressive image might be helpful.

What is Progressive Image?

Progressive Image is actually a JPEG format image, which is created using algorithms that load the image in successive waves. When an image is loaded into the browser, it starts rendering the image immediately. A standard JPEG image, also known as Baseline Image, is rendered from top to bottom and appears to be loading in tranches. Whereas when a progressive image is rendered, an entire image block is rendered in one go, albeit at a reduced quality. As the remaining image is loaded, the quality of the image improves. With baseline image, the user may get a feeling of slow loading time, whereas in the second case, the user starts seeing the image almost instantly and hence there’s perceived improvement in user experience.

Almost all the image processing software allows users to create a progressive image, should the user chooses to. Thing to note is that the size of the image increases marginally.

Any examples?

Take a look at this example given in “TourWriter” Blog

Baseline JPG loading
Baseline JPG loading
Progressive Image Loading
Progressive Image Loading

You can also watch a nice video on this here.

Then why not everyone using Progressive Image?

As can be expected, there have been several studies around the usefulness of progressive images for improving the user experience. And there are opposite opinions. I came across one such study by Radware Blog. This team carried ou an experiment with 700+ participants. By observing the facial expressions while watching different types of images, page load times etc, they have come to a conclusion that Progressive Image doesn’t improve the user experience to a large extent.

Related Links

Related Keywords

Web Development, User Experience

 

 

ESB

Ever wondered how heterogeneous applications communicate with each other? e.g. A Java application that needs to communicate with a .Net application. And not just one-to-one communication. Consider use cases where there are several applications talking to more than one applications. How does it happen? Does each application need to implement an interface for every other application? Enterprise Service Bus i.e. ESB comes to your rescue.

What is Enterprise Service Bus?

ESB implements a communication system between various applications which need to communicate with each other. The primary goal of ESB is to enable faster integration between Enterprise applications commonly referred as EAI.

ESB
Consider a set of applications which need to communicate with each other. This is a heterogeneous set and each one talks separate standard, protocol. And many of them need to talk to more than one applications. ESB removes the need that each application needs to implement communication with more than one other applications. If one tries to implement point-to-point communication between apps, it is going to get messy. Changing one part would result in breaking something else. ESB handles the communication transparently and hence eases up the process of communication.

Key capabilities of ESB

  • Transport protocol conversion – JMS to file
  • Message transformation
  • Routing e.g. content based routing
  • Message enhancement e.g. Order data that only has a client ID can be enhanced to pass Order Data and client details together to next level. In this case, client details are pulled from a different source and the incoming message is “enhanced” with additional client data before passing it to next application.
  • Security / Authorization – incoming messages are checked for required authorization before processing them further.
  • Mediation
  • Monitoring

Key providers of Enterprise Service Bus software

  • Microsoft BizTalk Server
  • MuleSoft
  • Oracle Enterprise Service Bus
  • Tibco Software
  • Apache ServiceMix

Related Links

Related Keywords

Software Architecture, Service Oriented Architecture

 

TypeScript

TypeScript is an opensource programming language, which is a superset of Javascript. This language was originally developed at Microsoft and was later made opensource in Oct 2012.

TypeScript
TypeScript programmer

What is so special about TypeScript?

JavaScript was originally developed to handle simple applications. As applications started growing, the code became complex. Additionally, JavaScript wasn’t offering several concepts from standard object-oriented programming e.g. easy class definitions. It also didn’t offer type check and type of the variable was inferred at runtime.

TypeScript resolves problems like this. TypeScript scripts are compiled and converted into JS files. All the existing JS files are completely valid in TypeScript (in fact you can rename a JS file as TS file and can use it!!). However, the reverse is not true.

Key advantages of using TypeScript language:

  • Static Type (Optional): Developer can define a type of the variables and it will be checked during compile time. This helps in reducing the errors at runtime. Supported types are explained briefly in the section below.
  • OO support: Developer can define the classes and have OO implemented using TypeScript. They can use static functions, variable scopes, function overloading, interfaces and inheritance
  • JS compatibility: Existing Javascript files could be used as TypeScript files without any problem.
  • Modules: Allows to define your own modules as well as allows to combine external modules easily.

Supported variable types:

  • Any – default type – all JS variables get initially mapped to this type until their type could be inferred at runtime.
  • boolean
  • number (integer, long, short…)
  • string (string, char)
  • type[] (Arrays)

IDE support for TypeScript

  • MS Visual Studio
  • IntelliJ IDEA
  • Eclipse Plugin

TypeScript compiler compiles the “.ts” scripts to generate javascript code. During this compilation, the compiler checks for various errors, thereby reducing the problems getting detected at runtime.

Related Links

Related Keywords

AngularJS, Angular, Javascript, CoffeeScript, ECMAScript, Grunt, Node.js

ADC – Application Delivery Controller

Application Delivery Controller aka ADC is an advanced version of server load balancing (SLB) which includes traditional load balancing along with some advance features such as health checks, SSL offloading, DDoS protection, Reverse Proxy, WAF etc.

Application Delivery Controller
Network Panel

History of Application Delivery Controller

Load balancing among several servers is not new. An initial version of load balancing was to have 1 to many relations between the domain name and IP addresses in DNS server. This severely lacked health checks as clients wouldn’t know if given IP is working or not. This drawback gave rise to next level of load balancing where a specific IP address was exposed to the world. This IP was catered by clustering software, which routed the traffic from clients to several servers in the backend.

Next generation load balancers introduced health monitors. If any of the servers goes unresponsive, the load balancer would stop sending traffic to that server until it was recovered. This also allowed system administrators to build some custom logic to add or reduce the servers in the farm based on the monitoring data.

ADCs are current generation load balancers which provide a variety of functions bundled together. Some of them are listed in the section below.

Features of ADC

Application Delivery Controller
Application Delivery Controller – ADC. Source: https://aiscaler.com/application-delivery-controllers-on-the-cloud
  • SSL Offloading: ADC can handle the terminating SSL connection keeping the traffic between ADC and backend servers in plain text. And hence it helps in reducing the load on the application servers in the server farm.
  • Multilayer load balancing: These load balancers can balance traffic at Layer 3/4 as well as Layer 7 of OSI model. Thus it gives an ability to route traffic based on IP addresses, subnets as well as based on the URL patterns, domains and HTTP header fields.
  • Load balancing methods: ADCs can use various methods such as round robin, least packets, least bandwidth, latency or hashing of certain parameters.
  • DDoS Protection: ADCs can look into the incoming traffic and detect DDoS before it starts loading the application servers, thereby defeating the attack.
  • WAF: ADCs can have built-in Web Application Firewall which can prevent common security attacks such as Cross-site scripting XSS.

For a much more comprehensive list, you can to the article in related links section.

Related Links

Related Keywords

Load Balancer, Hardware, WAF, DAF

Circuit Breaker Pattern

As the name suggests, the “circuit breaker” is a design pattern in software architecture, which has gain prominence in the distributed environment.

MCB
Miniature Circuit Breaker

Circuit Breaker Pattern in detail

Almost each one of us knows about the MCB – miniature circuit breaker that is used in our homes. Its function is to break the electric supply of a particular circuit – either of a room or of an entire house – if it detects some anomaly in the electric supply or usage. Once the anomaly is removed, we can restore earlier state and the electricity resumes.

In this design pattern, there’s a component named “Circuit Breaker” which does exactly same. It acts as a proxy for certain function/API calls. If the call fails beyond a certain threshold, this component starts returning an error to the caller, even without checking if the proxied function/API is working.

Unlike MCB, this being a software component, it can be made more intelligent. This Circuit Breaker component can have a threshold and timeout defined. Once the error rate crosses the threshold, the component starts returning an error to the caller for a timeout period. After that, it tries to call the proxied function/API few times. If successful, it can slowly resume the service over a period of time.

Circuit Breaker
Circuit Breaker diagram – Source: https://martinfowler.com/bliki/CircuitBreaker.html

But, wait, wouldn’t it cause a problem for the users?

It could. However, in the distributed architecture, failure is always a possibility. This design pattern teaches to embrace failure rather than denying the possibility of failure. The overall architecture can handle such failures gracefully. e.g. if a service providing recommendations for titles of movies or books, you could easily show something else or not show anything at all. That would still allow your users to use the overall application – albeit w/o some functionality. This would anyway be better than failing entire application.

Also, the component can include the monitoring feature as well. This can push data about the failure rate to a central dashboard, which will allow administrators to check the failed components and take corrective measures.

Example of Circuit Breaker Pattern

Netflix has implemented this pattern very effectively and has also released the library which provides various functionalities they are using internally – Hystrix. There are some very good articles available which are mentioned in the links below.

Related Links

Related Keywords

Microservices Architecture, Hystrix, API Gateway