Case Study: Improving Performance of MySQL, Thinking Sphinx in a Rails app

Recently, we faced a huge performance problem with one of our installed apps. The application is a Call Center ERP solution. The Call model is updated very frequently as there are about approximately 8,000 - 10,000 calls being made everyday. For every action there is an audit trail, so updates and inserts into database are … Continue reading Case Study: Improving Performance of MySQL, Thinking Sphinx in a Rails app

Manual active record db connection in ruby using mysql adapter

Here is the code to make manual connection with database require 'active_record'ActiveRecord::Base.establish_connection( :adapter => "mysql", :host => "localhost", :username => "root", :password => "abcd", :database => "funonrails" )Load database configurations from yml file dbconfig = YAML::load(File.open('database.yml'))ActiveRecord::Base.establish_connection( dbconfig )

How to map irregular database tables with rails models

Rails specifies standard conventions while creating models, controllers, migrations ( database tables ).Conventions for creating database tables1. Table name should be plural2. id field must be primary_key for table.3. foreign_key  must be like <model_name>_id i.e. post_id, site_idConventions for creating models & Controllers1. Model name must be singular and controller name should be plural.Although rails have … Continue reading How to map irregular database tables with rails models