googleads
Golang Vs Ruby on Rails - Data Insertion Metrics | Hire Web Developers
preloder
Golang Ruby on Rails Web Development

Golang Vs Ruby on Rails – Data Insertion Metrics – A Study

Overview:

With the availability of lots of options to choose from the cost effective hardware in cloud environment, the storage has become so easy now a days. Once the storage is cheap, the immediate requirement for any software solution is to write an effective code to consume and expose the data. Agira team met a similar situation with one of our assignments last week.  The solution demanded uploading of  a very complex CSV data into an ETL Database. Improved performance was the goal and we started exploring the possibilities of developing the piece of code in Ruby on Rails and Golang.

Approach:

On the Rails side, we wrote the code on Ruby and executed the upload action using sidekiq jobs. Our good old concurrency bottlenecks of Ruby language hit the performance and the time taken to complete the job was not satisfactory. To handle the situation, we wrote the piece of code in Golang which does the similar task. On the developer’s laptop itself we could see the better performance of the Golang code.

Technology Bundle:

 

  • Ruby – 2.3.
  • Rails – 4.2.0
  • PostGres Gem – 0.18.4
  • PostGres DB – 9.3.11
  • GoLang – 1.5.3

 

Ruby Code Snippet:

 

 

GoLang Code Snippet:

 

 

Cloud Setup:

We wanted to do an extensive testing, so decided to have a cloud environment in AWS to test the performance in terms of huge data volumes.
The following AWS boxes configurations were considered for running the volume test:

Instance TypevCPUMemory (GiB)Networking PerformancePhysical ProcessorClock Speed (GHz)
c4.xlarge47.5HighIntel Xeon E5-2666 v32.9
c4.2xlarge815HighIntel Xeon E5-2666 v32.9

 

Record Set Sample:

 

ColumnData 1Data 2Data 3
Data 4Data 5
policyID119736448094206893333743172534
statecodeFLFLFLFLFL
countyCLAY COUNTYCLAY COUNTYCLAY COUNTYCLAY COUNTYCLAY COUNTY
eq_site_limit4989601322376.3190724.400
hu_site_limit4989601322376.3190724.479520.76254281.5
fl_site_limit4989601322376.3190724.400
fr_site_limit4989601322376.3190724.40254281.5
tiv_20114989601322376.3190724.479520.76254281.5
tiv_2012792148.91438163.57192476.7886854.48246144.49
eq_site_deductible00000
hu_site_deductible9979.20000
fl_site_deductible00000
fr_site_deductible00000
point_latitude30.10226130.06393630.08957930.06323630.060614
point_longitude-81.711777-81.707664-81.700455-81.707703-81.702675
lineResidentialResidentialResidentialResidentialResidential
constructionMasonryMasonryWoodWoodWood
point_granularity13131

 

Observation:

The code has been executed against 100k, 500k and 1million record sets. The time taken to update the records in database are captured from the log records. Look below for the time taken in AWS for different volume of record sets for the Golang & Ruby code snippets:

Code Reference:

The complete code scripts and the sample data used are available for your knowledge at the Git repository: https://github.com/agiratech/go_vs_ruby_metrics

Conclusion:

On the considered scenario for study, to upload records into ETL database, Golang code performance is better than Ruby code.

We at Agira, always believe in suggesting the best possible solution to our clients. Here too, our team expended it’s technical knowledge, suggested required technology stack for the product/application development to the clients for improved performance.

We offer Golang development services for building world-class enterprise apps. We have expertise in building most complex software solutions using Google’s Go language. Chat with us now and hire golang developers within 72 hours.

Turn your vision to magnificent reality With
Our Web and Mobile Solutions
The following two tabs change content below.
AgiraTech is a technology company whose business services and domain solutions supports global clients who comprise the current world economy. Services we offer : Web development, Mobile App development, Blockchain, IoT and DevOps Consulting

2 thoughts on “Golang Vs Ruby on Rails – Data Insertion Metrics – A Study”

Leave a Reply

Your email address will not be published. Required fields are marked *

[contact-form-7 id="120788" title="Web Page Form"]

Schedule Your Call