Showing posts with label Rails application. Show all posts
Showing posts with label Rails application. Show all posts

Friday, December 10, 2021

How To Improve Performance Of Your Rails App Using DynamoDB And Memcached

 

With the increasing number of apps going live on the web, it's becoming common to see that they use multiple servers. This is mainly due to scalability and availability purposes. But, these types of applications are also often not as responsive as they should be. Using a simple gem called DynamoDB and Memcached will allow you to achieve higher performance in your Rails app. Let me explain,

What is Memcached

Memcached is a high performance, free and open source distributed memory caching system used to speeding up dynamic web applications by alleviating database load. Memcached is simple yet powerful. Its simple design promotes quick deployment, ease of development, and solves many problems facing large data caches.

It is used for speeding up dynamic web applications by reducing database load. In other words, every time a database request is made it adds additional load to the server. Memcached reduces that load by storing data objects in dynamic memory (think of it as short-term memory for applications). Memcached stores data based on key-values for small arbitrary strings.

How does Memcached work?

Memcached is comprised of four main components

1.    Client software - Which is given a list of available Memcached servers
2.    A client-based hashing algorithm - Chooses a server based on the "key"
3.    Server software - Stores values and their keys into an internal hash table
4.    LRU - Determines when to throw out old data or reuse memory

Each item is comprised of a key, expiration time, and raw data.

At a high-level Memcached works as follows:

Read More On How To Improve Performance Of Your Rails App

Wednesday, January 25, 2017

Ruby on Rails Integration Testing with Minitest and Capybara


http://blog.andolasoft.com/2017/01/rails-integration-testing-minitest-capybara.html


Hi Guys! I am back again with one more article about ruby on rails. 

I hope this is the right time to share one of my technical stuffs on ruby on rails after sharing PHP and Mobile stuffs.

Minitest and Capybara: integration testing demystified

In this article, I am going to share my own experience and ideas of ruby on rails integration testing using Minitest and Capybara and tell you the process how it serves as one of the most preferred alternative for controller test.

A lot of you must have heard about Capybara but still for those who are new to this - 

Capybara is an acceptance test framework used for web applications and supports developers in integration testing of Ruby on Rails applications with Minitest.

So, let’s get into the details about Capybara, Minitest and Integration Testing

Minitest is the default and a complete testing suite for Ruby application, which supports ancillary test-driven development (TDD), behavior-driven development (BDD), mocking, and benchmarking for fast, clean and reliable test results.

Whereas, Capybara is the acceptance test framework for web applications and frequently used for end-to-end testing in Rails Applications. 

Rails developer can suggest user on web page and Capybara provides API to interact with web page.

Integration Testing are used to test the most important workflows of applications and test different fragments of application together while unit testing inspects the individual part of the application work.

Before sharing the real process how to use Capybara with Minitest for integration testing of your Ruby on Rails applications, let me tell you the prerequisites of this testing process.

Ruby version 2.3.3, Rails version 5.0.0.1, 

Minitest version 5.10.1, and Capybara version 2.11.1 are required for the smooth operation and you can use gem install rails to get started.