Monitor PostgreSQL queries, indexes, memory, connections and more
While working on enterprise applications, many times it happen that queries that seem to be working normally on Staging environment turn out to be slower on production.
Monitoring slow performing queries and optimising them is a continues process in case of growing enterprise applications.
If you are using PostgreSQL in your Rails application, you can use pghero gem to monitor query performance & health of the database server by integrating its interactive Dashboard.
It uses pg_stat_statements module of PostgreSQL to fetch query stats directly from database source & shares insights on the…
Force.com REST API Integration to push data to salesforce
This article is the first part of Salesforce Integration series and it focuses on Salesforce’s Force.com REST API integration, to push data from application to salesforce, with Rails (4.2) application.
In this article, we’re going to cover below topics -
Use https://developer.salesforce.com/signup link to get your developer edition account. Developer edition account comes with only one environment — production. It does not feature Sandbox or Test environment.
To use REST API to integrate…
It’s good to keep your code maintainable & optimized, especially while working with large enterprise applications.
Growing application codebase demands continuous refactoring in terms of making it more efficient.
Here is a quick guide on the usage of a couple of gems that can help to automate process of identifying instances in codebase where database queries can be optimized. It’s advisable to use them in development environment.
This gem can be used to find list of database columns that can be Indexed.
Add gem in Gemfile
group :development do
$ bundle install
Run below rake…
AWS CloudWatch is a resource & application monitoring service for AWS resources. It allows you to have visibility in the resource utilization, performance and traffic load demand patterns as it collects and tracks metrics. Also CloudWatch alarms send notifications when specific metric thresholds are breached.
CloudWatch default metrics collection includes CPU Utilization, Network traffic, and disk read/writes. It does not include metrics to monitor Disk space & Memory usage.
AWS provides CloudWatch monitoring scripts that can be configured on the Linux based EC2 instances to send Custom Metrics to CloudWatch.
These monitoring scripts are intended for use with Amazon EC2…
exception_notification gem provides support to send notifications to development team when an exception occurs in Rails application.
This tutorial explains how user can use Slack with exception_notification as a notifier.
gem ‘exception_notification’gem ‘slack-notifier’
This tutorial covers how you can launch EC2 & RDS instances on AWS, setup environment on EC2 & deploy your rails application (manually) from your GitHub repository.
Ruby 2.1.2, Rails 4.1, RVM, Phusion Passenger, Nginx, Ubuntu 14.04, MySql, GitHub, AWS(EC2, RDS, ElasticIP, AMI)
In this tutorial, we’ll deploy Rails app on AWS and will run inStaging environment. Hence, we need to do below listed changes in our rails app to enable Staging environment.