Posts

Load balancing and Fail-over systems

Image
Load balancing is a technique of distributing your requests over a network when your server is reaching maximum amount of size of the CPU or disk or database IO rate. The objective of load balancing is optimizing resource use and minimizing response time, thereby avoiding overburden of any one of the resources. The goal of fail-over is the ability to continue the work of a particular network component or the whole server, by another, should the first one fail. Fail-over allows you to perform maintenance of individual servers or nodes, without any interruption of your services. It is important to note that load balancing and fail-over systems may not be the same, but they go hand in hand in helping you achieve high availability. Implementing Load Balancing: Although the idea of load balancing is very clear, its implementation is not. In this post, I would touch upon the basic ideas of implementation of load balancing. Load balancing can be performed with the help of hardware a...

Only one usage of each socket address (protocol/network address/port) is normally permitted exception throwing in WCF

Lets say that you are invoking a web service from another web service. Both are on the same box. You might be making authenticated or unauthenticated calls and perhaps you are setting the  KeepAlive = false.  Intermittently, (under load) you might get  "Only one usage of each socket address (protocol/network address/port) is normally permitted (typically under load)."  You might be wondering why are you getting a *SOCKET* Exception... Here is the scoop 1. When you make authenticated calls, the client is closing connections. And when you are making authenticated calls  repeatedly to the same server, you are making and closing connections repeatedly 2. The same might happen when you are making regular http [un authenticated] calls but setting keep-alive = false. When a connection is closed, on the side that is closing the connection the 5 tuple  { Protocol, Local IP, Local Port, Remote IP, Remote Port} goes into a TIME_WAIT state for 240 secon...

API Gateway

Image
An API gateway is a service which is the entry point into the application from the outside world. It’s responsible for request routing, API composition, and other functions, such as authentication. Let’s take a look at the API gateway pattern. Overview of the API gateway pattern The drawbacks of clients making multiple requests in order to display information to the user are well known (I describe them in my book!). A much better approach is for a client to make a single request to what’s known as an API gateway. An API gateway is a service which is the single entry-point for API requests into an application from outside the firewall. It’s similar to the Facade pattern from object-oriented design. Like a facade, an API gateway encapsulates the application’s internal architecture and provides an API to its clients. It might also have other responsibilities, such authentication, monitoring, and rate limiting.  Figure 1 shows the relationship between the clients, the API gatew...

R and Python language?

If you want to upgrade your data analysis skills, which programming language should you learn? For a growing number of people, data analysis is a central part of their job. Increased data availability, more powerful computing, and an emphasis on analytics-driven decision in business has made it a heyday for data science.  R and Python are the  two most popular programming languages used by data analysts and data scientists. Both are free and open source, and were developed in the early 1990s—R for statistical analysis and Python as a general-purpose programming language. For anyone interested in machine learning, working with large datasets, or creating complex data visualizations, they are godsends. But which of these programs is best to learn? As a former data analyst, it is the question I have been asked more than any other in my professional life. Though you could just try to learn both R and Python, each requires a significant time investment—particularly...

Grakn Architecture

Image
Nowada ys , the amount of biological data av ailable online has proliferated, but this has been accompanied by enormous challenges arising from the need to integrate and connect related information from different sources. Common problems include locating resources, differing data formats, am- ambiguity and duplication, relationships between data and the sheer v olume and granularity of the information. As y et, there is no standard memorization and query format for this kind of data, so each resource usually requires a different approach to be properly handled. we introduce BioGrakn, based on GRAKN.AI  which is a deductiv e database in the form of a knowledge graph, allowing complex data modelling, verification, scaling, querying and analysis. The database behind GRAKN.AI uses an ontology to facilitate the modelling of extremely complex data sets, functioning as a data schema constraint to guarantee information consistency . GRAKN.AI stores data in a wa y...

Detailed Explanation of WSGI- We server Gateway Interface of Python

Image
WSGI- Web Server Gateway Interface:  WSGI, authored by Philip J Eby and published on December 7, 2003, is a Web Server Gateway Interface, a specification that explains how a web server communicates with web applications, and how the applications can be chained together to generate requests. There was one major flaw in Python application, and that was negative interoperability. It was designed for only one FastCGI, mod_Python, CGI, or other API of a specific web server, and they didn’t allow for interoperability. Unfortunately mod_Python, an Apache module, was not an official specification, and there was little security. Developers needed a new solution to combat the execution of Python web application. This was the area where WSGI figured in. It had a standard interface for routing web apps and frameworks to web servers. The framework traces its origins to CGI or Common Gateway Interface, and was in use in the early days of the internet. The success of CGI was because it coul...

Django Framework - Python

Django  Django is a Python-based free and open-source web framework, which follows the model-view-template architectural pattern. It is maintained by the Django Software Foundation, an independent organization  Design your model Although you can use Django without a database, it comes with an  object-relational mapper  in which you describe your database layout in Python code. The  data-model syntax  offers many rich ways of representing your models – so far, it’s been solving many years’ worth of database-schema problems. Here’s a quick example: mysite/news/models.py from django.db import models class Reporter ( models . Model ): full_name = models . CharField ( max_length = 70 ) def __str__ ( self ): return self . full_name class Article ( models . Model ): pub_date = models . DateField () headline = models . CharField ( max_length = 200 ) content = models . TextField () repor...