Monday 17 June 2019

What is Microservices Architecture?


Introduction


The micro-services architecture pattern is getting a lot of attention these days and it’s trending. If it is hard to believe, then just check what Google Trends says.
As its name its a micro applications or services those run independently. Mean we can manage (update) independently.

What is micro-services architecture




A micro-services architecture make more sense when we compare it with a monolithic architecture. In a monolithic architecture all modules of the application are tightly coupled inside a single execution or web server.
An example of monolithic application is a like shopping cart application, in which users module, products module, categories module etc are developed in a single project and deployed on a single server like apache or nginx.
This means when we have to update something in project then we need to test the whole project and deploy it again.

In other architecture mean in micro-services architecture all module are developed separately and deployed on different servers. For example users module on one server, products on another server and payment system on another server. So with this approach when we need to update product module then just update product build/server, no need to touch other modules.

Here some other definition of micro-services

  • Very very small application that focusing on a single thing
  • Independent application
  • Individual team can work on it
  • Easy to scalable

Risk in micro-services

We had gone through the possible benefits of micro-services, but there some risk as well



  • Bad design decision
  • Testing very hard with micro services
  • Data storing and sharing
  • Compatibility issue

Principal of Micro services

There are 3 principal of micro services architecture


  • Never ever try to make micro-service from day one: Mean understand application maturely, clearly, data models, communication protocols etc
  • Premature splitting is then the root of all evil: Don’t split application if you don’t know how application interact with root application.
  • Don’t design “CRUD” micro-services: Micro-services should have HTTP apis that not reflect database but provide behavior, actions, like hay sent this report to this user.

Standard protocols

Here are some protocols that used to communication between services



  • HTTP: Socket, message pack, binary protocol
  • RestFull: Resource base endpoint (Put, Patch, Post, Path)
  • Swagger, Json-schema: Specification json based serialization
  • Token Based Authentication: Authentication for request

Keep in mind while designing HTTP API


  • Don’t surface too many details
  • Version your api
  • Backward compatibility make your life easier
  • Json-schema can help for data checking


Monday 3 June 2019

AI & Machine Learning


What is AI?


You can think of deep learning, machine learning and artificial intelligence as a set of Russian dolls nested within each other, beginning with the smallest and working out. Deep learning is a subset of machine learning, and machine learning is a subset of AI, which is an umbrella term for any computer program that does something smart. In other words, all machine learning is AI, but not all AI is machine learning, and so forth.

Here are a few other definitions of artificial intelligence
  • A branch of computer science dealing with the simulation of intelligent behavior in computers.
  • The ability of a digital computer or computer-controlled robot to perform tasks commonly associated with intelligent beings.
  • The capability of a machine to imitate the intelligent human behavior 
  • A computer system able to perform tasks that normally require human intelligence, such as visual perception, speech recognition, decision-making, and translation between languages.

What is Machine Learning?


Machine learning is an application of artificial intelligence (AI) that provides systems the ability to automatically learn and improve from experience without being explicitly programmed.
Machine learning focuses on the development of computer programs that can access data and use it learn for themselves. It is a category of algorithm that allows software applications to become more accurate in predicting outcomes without being explicitly programmed.

The basic premise of machine learning is to build algorithms that can receive input data and use statistical analysis to predict an output while updating outputs as new data becomes available.

How Machine Learning Works?


The process of learning begins with observations or data, such as examples, direct experience, or instruction, in order to look for patterns in data and make better decisions in the future based on the examples that we provide. It is also similar to data mining and predictive modeling.

Some machine learning methods: Machine learning algorithms are often categorized as supervised or unsupervised.

  • Supervised Algorithm: Supervised algorithms require a data scientist or data analyst with machine learning skills to provide both input and desired output. It can apply on what has been learned in the past to new data using labeled examples. The system is able to provide targets for any new input after sufficient training.
  • Unsupervised Algorithm: Unsupervised algorithms do not need to be trained with desired outcome data. Instead, they use an iterative approach called deep learning to review data and arrive at conclusions. Unsupervised learning algorithms -- also called neural networks -- are used for more complex processing tasks than supervised learning systems, including image recognition, speech-to-text and natural language generation.   
  • Semi-supervised: somewhere in between supervised and unsupervised learning, since they use both labeled and unlabeled data for training – typically a small amount of labeled data and a large amount of unlabeled data. The systems that use this method are able to considerably improve learning accuracy. Usually, semi-supervised learning is chosen when the acquired labeled data requires skilled and relevant resources in order to train it / learn from it. Otherwise, acquiringunlabeled data generally doesn’t require additional resources.
  • Reinforcement Algorithm: This area of deep learning involves models iterating over many attempts to complete a process. Steps that produce favorable outcomes are rewarded and steps that produce undesired outcomes are penalized until the algorithm learns the optimal process.

Free Online Artificial Intelligence  

  • Google’s Free Machine Learning Course
  • Andrew NG’s Free AI Course on Coursera
  • Free Udacity Online AI Course