WebSocket

WebSocket is a fairly recent communication protocol which provides full-duplex communication over a single TCP connection. This protocol was standardized in 2011. Although this protocol is different from HTTP, there is a certain relation between them.

Continue reading “WebSocket”

Laravel

A few days back I wrote about Python-based web application framework called Django. Let’s talk about another framework for web app development framework which is built in PHP. It is called as Laravel and has become popular in PHP community for various reasons.

What is Laravel?

Laravel is a PHP based framework which is build using Symphony2 components. Being a framework it provides services and libraries to handle web requests, database etc. This implements MVC architecture (Model-View-Controller) and has 3 different components meant for MVC.

Eloquent provides Object Relational Mapping (ORM) component, which interacts with an underlying database such as MySQL, PostgreSQL or MSSQL.

Blade is a component that provides the view in this framework. It is the templating engine that Laravel uses, supports inheritance and support extensible control structures

Controllers provide a way to group request handling logic and is used in conjunction with Routes to handle the HTTP requests.

Laravel - MVC
Laravel – MVC architecture

Why is Laravel becoming popular?

  • Routing system
  • Intuitive Templating Engine – Blade
  • Open source
  • Built-in support for authentication
  • Uses Inversion of Control (IoC) design pattern to remove dependencies on third-party components, yet maintaining the functionality and flexibility for the developers
  • Built-in support for unit testing.
  • Built-in command line tool – Artisan
  • Security
  • Support database migration to facilitate incremental development.
  • Interface to various Queues such as Amazon SQS, IronMQ, Redis Queues
  • Abstraction layer for filesystem – supports Amazon S3, FTP/SFTP, Local or Dropbox!

Laravel has shown consistent releases at regular intervals. It has great community support and hence has gained a lot of traction and attention from PHP community in last 2-3 years. You can see complete timeline on Wikipedia page

Related Links

Related Keywords

Web app Framework, PHP, MVC, Software Architecture, CodeIgnitor, Symfony, Yii

Munin

You are a system administrator, managing a set of servers. As a part of your job, you need to ensure that all the servers are up and running 24X7, they are resources are utilized optimally. And that no single server is overloaded or consuming huge memory or some similar abnormal behavior over a time period. Obviously, you will be needing a monitoring tool. Munin is one such tool, which helps system administrators to keep track of system resources.

Munin Architecture

Munin derives its name from mythology. It means memory. This monitoring software memorizes what it sees and hence the name.

This monitoring tool uses Master-node architecture. Master periodically pulls data from all the configured nodes and processes it to create graphical dashboards.

Munin Architecture
Munin Architecture – Source: http://guide.munin-monitoring.org/en/latest/architecture/index.html

One of the advantages of Munin is its vast plugin eco-system. There are several hundred plugins available, which make it a powerful monitoring system. Munin itself uses RRDTool, which is written in Perl, whereas plugins could be written in any language. This tool is available on various distros such as Debian, Ubuntu, and CentOS.

Munin-memory-week
Munin graph depicting memory usage over a week
Once data is collected from nodes, it is processed by the master and various graphs are made available on the dashboard. One of the components is – Munin-limits – which monitors the values between configured “ok”, “warn” and “crit” levels and can create a notification for the administrators.

Alternate Server Monitoring Tools

Several alternatives are available.

  • Nagios
  • NewRelic
  • Netdata
  • Zabbix

Considering that most of the deployments are in the cloud these days, you may want to use the monitoring tools provided by your cloud providers:

  • AWS Cloudwatch
  • Azure Monitor
  • Google Cloud – Stackdriver monitoring

Related Links

Related Keywords

Server Monitoring, AWS Cloudwatch, Azure Monitor, Nagios, NewRelic

 

Filestack

You are launching a service, where your users need to upload their files to your app or web app. Your userbase is global. You are currently supporting only a handful of sources to pick files from. Also, it is observed that your users are leaving because file upload takes too long or fails due to a variety of issues. Filestack comes to your rescue.

But what is Filestack?

Filestack is a developer service that allows app developers to build apps which can connect to several sources and also upload the files reliably. It solves 2 problems:

  • Making uploads reliable and faster
  • Enabling users to upload files from several sources (25+)

The Filestack team has used an interesting model to make the uploads faster. It is a two-step process. The process uses an S3 bucket as an intermediate hop. S3 is a file storage solution by AWS, which has a presence across the globe. Using this network, Filestack uploads the user-provided file to the nearest S3 bucket. This turns out to be faster due to the elimination of network latency. As soon as the upload is completed, it returns URL to the application and application can start processing the file as per the need. In the background, the file from Filestack S3 bucket is moved to cloud storage specified by the app. The URL is updated to point to new location and app can continue to use that URL for rest of the lifecycle. So, even if it includes additional hop, it turns out to be faster from a user perspective.

Filestack - Content ingestion network illustration
Filestack – Content ingestion network illustration (Source: https://www.filestack.com/features/content-ingestion-network)

Filestack not only solves above mentioned two problems, but it also provides several additional functionalities for image files.

  • Image transformation such as adding borders, flipping the image, applying filters, image rotation
  • Resizing of images – on the fly
  • Image cropping
  • Collage
    You can check out the live examples here.

It also provides some advanced features based on ML (Machine Learning)

  • Object recognition
  • Object detection
  • OCR (Optical Character Recognition)
  • Copyright detection

Alternatives to Filestack:

Obviously, you can build your own connectors for various sources, but probably you would end up spending more time to implement all the functionality that Filestack is already providing. There have been some alternatives available:

  • UploadCare
  • Kloudless
  • Filespin.io

Related Links

Related Keywords

Machine Learning, Google Vision, AWS S3