SlideShare a Scribd company logo
1 of 6
Download to read offline
From the Resource Library of Andolasoft.Inc | Web and Mobile App Development Company 1
From the Resource Library of Andolasoft.Inc | Web and Mobile App Development Company 2
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.
From the Resource Library of Andolasoft.Inc | Web and Mobile App Development Company 3
At a high-level Memcached works as follows:
1. The client requests a piece of data which Memcached checks to see if it is stored in
cache.
2. There are two possible outcomes here:
1. If the data is stored in cache: return the data from Memcached (no need to
check the database).
2. If the data isn't stored in cache: query the database, retrieve the data, and
subsequently store it in Memcached.
3. Whenever information is changed or the expiry value of an item has expired,
Memcached updates its cache to ensure fresh content is delivered to the client.
A few important points about Memcached architecture include:
Data is only sent to one server.
Servers don't share data.
Servers keep values in RAM. If RAM runs out the oldest value is discarded.
What is DynamoDB
Amazon DynamoDB is a fully managed NoSQL database service that provides fast and
predictable performance with seamless scalability. With DynamoDB, you can create database
tables that can store and retrieve any amount of data and serve any level of request traffic. You
can scale up or scale down your tables' throughput capacity without downtime or performance
degradation.
DynamoDB is a particularly good fit for the following use cases
Applications with large amounts of data and strict latency requirements
Server less applications using AWS Lambda
From the Resource Library of Andolasoft.Inc | Web and Mobile App Development Company 4
Data sets with simple, known access patterns
Installing Memcached
There are a few ways you can install Memcached. Depending on which system you're using, the
method will vary. As outlined on the official Memcached Installation Wiki, installation from a
package is simple.
Using Memcached with DynamoDB in Rails
Memcached is a quick in-memory protest reserving framework that can make Rails run much
quicker with not very many changes. Memcached will work on any database used in Rails
application.
When the table is small and request volume is low this isn’t much of an issue, but as your
database and user volume grow, these can impact the performance of your application. In such
cases Memcached plays an important role to reduce the database load by caching the request
object in memory.
To use Memcached in Rails app, follow the below steps
Install dalli gem
gem 'dalli'
Add "dalli" gem to your gem file and install it.
Development/Production file
config.cache_store = :dalli_store
From the Resource Library of Andolasoft.Inc | Web and Mobile App Development Company 5
config.action_controller.perform_caching = true
Add the above lines in your development.rb or production.rb file as per the requirement
Add Memcached in your method
search_query = "user_id = :user_id AND is_approved = :is_approved"
search_param = {":user_id" => params[:user_id], ":is_approved" => 't'}
all_games = Rails.cache.fetch('all_lists', expires_in: 2.minutes)
{
do_scan(Article.table_name,search_query,search_param)
}
The above query syntax is an example of combination of Memcached and DynamoDB. In this
example once the query executed and the result will store in the "all_list" key of the
Memcached and expire after 2 minutes automatically.
Conclusion:
DynamoDB and Memcached is a powerful combination for your Rails app. If you're looking to
improve the performance of your Rails application, this may be the solution for you.
DynamoDB and Memcached involves storing information in an external database, which can be
retrieved with a single call. This will allow you to avoid the constant querying of data from your
application's memory.
From the Resource Library of Andolasoft.Inc | Web and Mobile App Development Company 6
There are many benefits to this gem, but most importantly, increased response time for your
application. Faster response times mean less downtime and more satisfied customers.
You have rails application but don’t know how to maximize the performance with DynamoDB
and Memcached. Andolasoft has experienced rails developer who has good hands on
DynamoDB and Memcached. So fell free to discuss about your project. Book a free consultation

More Related Content

What's hot

high performance databases
high performance databaseshigh performance databases
high performance databasesmahdi_92
 
Consistent join queries in cloud data stores
Consistent join queries in cloud data storesConsistent join queries in cloud data stores
Consistent join queries in cloud data storesJoão Gabriel Lima
 
SQL Server 2016 novelties
SQL Server 2016 noveltiesSQL Server 2016 novelties
SQL Server 2016 noveltiesMSDEVMTL
 
Mule database-connectors
Mule database-connectorsMule database-connectors
Mule database-connectorsPhaniu
 
Getting the most out of MariaDB MaxScale
Getting the most out of MariaDB MaxScaleGetting the most out of MariaDB MaxScale
Getting the most out of MariaDB MaxScaleMariaDB plc
 
EEDC 2010. Scaling Web Applications
EEDC 2010. Scaling Web ApplicationsEEDC 2010. Scaling Web Applications
EEDC 2010. Scaling Web ApplicationsExpertos en TI
 
Using all of the high availability options in MariaDB
Using all of the high availability options in MariaDBUsing all of the high availability options in MariaDB
Using all of the high availability options in MariaDBMariaDB plc
 
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent Ozar
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent OzarGeek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent Ozar
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent OzarIDERA Software
 
MinneBar 2013 - Scaling with Cassandra
MinneBar 2013 - Scaling with CassandraMinneBar 2013 - Scaling with Cassandra
MinneBar 2013 - Scaling with CassandraJeff Smoley
 
Gavin M
Gavin MGavin M
Gavin MOntico
 
How to Manage Scale-Out Environments with MariaDB MaxScale
How to Manage Scale-Out Environments with MariaDB MaxScaleHow to Manage Scale-Out Environments with MariaDB MaxScale
How to Manage Scale-Out Environments with MariaDB MaxScaleMariaDB plc
 
Sql server 2016 new features
Sql server 2016 new featuresSql server 2016 new features
Sql server 2016 new featuresAjeet Singh
 
Parameter substitution in Aginity Workbench
Parameter substitution in Aginity WorkbenchParameter substitution in Aginity Workbench
Parameter substitution in Aginity WorkbenchMary Uguet
 
Introduction To MongoDB
Introduction To MongoDBIntroduction To MongoDB
Introduction To MongoDBElieHannouch
 

What's hot (20)

high performance databases
high performance databaseshigh performance databases
high performance databases
 
Consistent join queries in cloud data stores
Consistent join queries in cloud data storesConsistent join queries in cloud data stores
Consistent join queries in cloud data stores
 
SQL Server 2016 novelties
SQL Server 2016 noveltiesSQL Server 2016 novelties
SQL Server 2016 novelties
 
Mule database-connectors
Mule database-connectorsMule database-connectors
Mule database-connectors
 
Scalable web architecture
Scalable web architectureScalable web architecture
Scalable web architecture
 
Getting the most out of MariaDB MaxScale
Getting the most out of MariaDB MaxScaleGetting the most out of MariaDB MaxScale
Getting the most out of MariaDB MaxScale
 
EEDC 2010. Scaling Web Applications
EEDC 2010. Scaling Web ApplicationsEEDC 2010. Scaling Web Applications
EEDC 2010. Scaling Web Applications
 
Caching Strategies
Caching StrategiesCaching Strategies
Caching Strategies
 
Data Management
Data ManagementData Management
Data Management
 
Java script framework
Java script frameworkJava script framework
Java script framework
 
Using all of the high availability options in MariaDB
Using all of the high availability options in MariaDBUsing all of the high availability options in MariaDB
Using all of the high availability options in MariaDB
 
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent Ozar
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent OzarGeek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent Ozar
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent Ozar
 
Azure SQL Database
Azure SQL DatabaseAzure SQL Database
Azure SQL Database
 
MinneBar 2013 - Scaling with Cassandra
MinneBar 2013 - Scaling with CassandraMinneBar 2013 - Scaling with Cassandra
MinneBar 2013 - Scaling with Cassandra
 
Gavin M
Gavin MGavin M
Gavin M
 
How to Manage Scale-Out Environments with MariaDB MaxScale
How to Manage Scale-Out Environments with MariaDB MaxScaleHow to Manage Scale-Out Environments with MariaDB MaxScale
How to Manage Scale-Out Environments with MariaDB MaxScale
 
Sql server 2016 new features
Sql server 2016 new featuresSql server 2016 new features
Sql server 2016 new features
 
Parameter substitution in Aginity Workbench
Parameter substitution in Aginity WorkbenchParameter substitution in Aginity Workbench
Parameter substitution in Aginity Workbench
 
Introduction To MongoDB
Introduction To MongoDBIntroduction To MongoDB
Introduction To MongoDB
 
SQL server part 1
SQL server  part 1SQL server  part 1
SQL server part 1
 

Similar to How to boost performance of your rails app using dynamo db and memcached

Schema-based multi-tenant architecture using Quarkus & Hibernate-ORM.pdf
Schema-based multi-tenant architecture using Quarkus & Hibernate-ORM.pdfSchema-based multi-tenant architecture using Quarkus & Hibernate-ORM.pdf
Schema-based multi-tenant architecture using Quarkus & Hibernate-ORM.pdfseo18
 
Mysql wp memcached
Mysql wp memcachedMysql wp memcached
Mysql wp memcachedkbour23
 
How to Optimize Your MERN Stack Application Performance_ Complete Guide 2023.pdf
How to Optimize Your MERN Stack Application Performance_ Complete Guide 2023.pdfHow to Optimize Your MERN Stack Application Performance_ Complete Guide 2023.pdf
How to Optimize Your MERN Stack Application Performance_ Complete Guide 2023.pdfElsner Technologies Pvt. Ltd.
 
MongoDB Evenings Chicago - Find Your Way in MongoDB 3.2: Compass and Beyond
MongoDB Evenings Chicago - Find Your Way in MongoDB 3.2: Compass and BeyondMongoDB Evenings Chicago - Find Your Way in MongoDB 3.2: Compass and Beyond
MongoDB Evenings Chicago - Find Your Way in MongoDB 3.2: Compass and BeyondMongoDB
 
AWS Summit 2013 | Singapore - Understanding Databases Options
AWS Summit 2013 | Singapore - Understanding Databases OptionsAWS Summit 2013 | Singapore - Understanding Databases Options
AWS Summit 2013 | Singapore - Understanding Databases OptionsAmazon Web Services
 
Webinar: What's New in MongoDB 3.2
Webinar: What's New in MongoDB 3.2Webinar: What's New in MongoDB 3.2
Webinar: What's New in MongoDB 3.2MongoDB
 
Dynamo Amazon’s Highly Available Key-value Store Giuseppe D.docx
Dynamo Amazon’s Highly Available Key-value Store Giuseppe D.docxDynamo Amazon’s Highly Available Key-value Store Giuseppe D.docx
Dynamo Amazon’s Highly Available Key-value Store Giuseppe D.docxjacksnathalie
 
Membase Meetup 2010
Membase Meetup 2010Membase Meetup 2010
Membase Meetup 2010Membase
 
Microsoft Sql Server 2016 Is Now Live
Microsoft Sql Server 2016 Is Now LiveMicrosoft Sql Server 2016 Is Now Live
Microsoft Sql Server 2016 Is Now LiveAmber Moore
 
MagentoECG-UsingRedisasaCacheBackendinMagento
MagentoECG-UsingRedisasaCacheBackendinMagentoMagentoECG-UsingRedisasaCacheBackendinMagento
MagentoECG-UsingRedisasaCacheBackendinMagentoKirill Morozov
 
IRJET - The 3-Level Database Architectural Design for OLAP and OLTP Ops
IRJET - The 3-Level Database Architectural Design for OLAP and OLTP OpsIRJET - The 3-Level Database Architectural Design for OLAP and OLTP Ops
IRJET - The 3-Level Database Architectural Design for OLAP and OLTP OpsIRJET Journal
 
How to scale your web app
How to scale your web appHow to scale your web app
How to scale your web appGeorgio_1999
 
AWS tutorial-Part59:AWS Cloud Database Products-2nd Intro Session
AWS tutorial-Part59:AWS Cloud Database Products-2nd Intro SessionAWS tutorial-Part59:AWS Cloud Database Products-2nd Intro Session
AWS tutorial-Part59:AWS Cloud Database Products-2nd Intro SessionSaM theCloudGuy
 
Ieee-no sql distributed db and cloud architecture report
Ieee-no sql distributed db and cloud architecture reportIeee-no sql distributed db and cloud architecture report
Ieee-no sql distributed db and cloud architecture reportOutsource Portfolio
 
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...Prolifics
 
Configuration and Deployment Guide For Memcached on Intel® Architecture
Configuration and Deployment Guide For Memcached on Intel® ArchitectureConfiguration and Deployment Guide For Memcached on Intel® Architecture
Configuration and Deployment Guide For Memcached on Intel® ArchitectureOdinot Stanislas
 

Similar to How to boost performance of your rails app using dynamo db and memcached (20)

Schema-based multi-tenant architecture using Quarkus & Hibernate-ORM.pdf
Schema-based multi-tenant architecture using Quarkus & Hibernate-ORM.pdfSchema-based multi-tenant architecture using Quarkus & Hibernate-ORM.pdf
Schema-based multi-tenant architecture using Quarkus & Hibernate-ORM.pdf
 
Mysql wp memcached
Mysql wp memcachedMysql wp memcached
Mysql wp memcached
 
How to Optimize Your MERN Stack Application Performance_ Complete Guide 2023.pdf
How to Optimize Your MERN Stack Application Performance_ Complete Guide 2023.pdfHow to Optimize Your MERN Stack Application Performance_ Complete Guide 2023.pdf
How to Optimize Your MERN Stack Application Performance_ Complete Guide 2023.pdf
 
Mysql wp memcached
Mysql wp memcachedMysql wp memcached
Mysql wp memcached
 
How To Scale v2
How To Scale v2How To Scale v2
How To Scale v2
 
Building a SaaS Style Application
Building a SaaS Style ApplicationBuilding a SaaS Style Application
Building a SaaS Style Application
 
MongoDB Evenings Chicago - Find Your Way in MongoDB 3.2: Compass and Beyond
MongoDB Evenings Chicago - Find Your Way in MongoDB 3.2: Compass and BeyondMongoDB Evenings Chicago - Find Your Way in MongoDB 3.2: Compass and Beyond
MongoDB Evenings Chicago - Find Your Way in MongoDB 3.2: Compass and Beyond
 
AWS Summit 2013 | Singapore - Understanding Databases Options
AWS Summit 2013 | Singapore - Understanding Databases OptionsAWS Summit 2013 | Singapore - Understanding Databases Options
AWS Summit 2013 | Singapore - Understanding Databases Options
 
Webinar: What's New in MongoDB 3.2
Webinar: What's New in MongoDB 3.2Webinar: What's New in MongoDB 3.2
Webinar: What's New in MongoDB 3.2
 
Dynamo Amazon’s Highly Available Key-value Store Giuseppe D.docx
Dynamo Amazon’s Highly Available Key-value Store Giuseppe D.docxDynamo Amazon’s Highly Available Key-value Store Giuseppe D.docx
Dynamo Amazon’s Highly Available Key-value Store Giuseppe D.docx
 
Membase Meetup 2010
Membase Meetup 2010Membase Meetup 2010
Membase Meetup 2010
 
netezza-pdf
netezza-pdfnetezza-pdf
netezza-pdf
 
Microsoft Sql Server 2016 Is Now Live
Microsoft Sql Server 2016 Is Now LiveMicrosoft Sql Server 2016 Is Now Live
Microsoft Sql Server 2016 Is Now Live
 
MagentoECG-UsingRedisasaCacheBackendinMagento
MagentoECG-UsingRedisasaCacheBackendinMagentoMagentoECG-UsingRedisasaCacheBackendinMagento
MagentoECG-UsingRedisasaCacheBackendinMagento
 
IRJET - The 3-Level Database Architectural Design for OLAP and OLTP Ops
IRJET - The 3-Level Database Architectural Design for OLAP and OLTP OpsIRJET - The 3-Level Database Architectural Design for OLAP and OLTP Ops
IRJET - The 3-Level Database Architectural Design for OLAP and OLTP Ops
 
How to scale your web app
How to scale your web appHow to scale your web app
How to scale your web app
 
AWS tutorial-Part59:AWS Cloud Database Products-2nd Intro Session
AWS tutorial-Part59:AWS Cloud Database Products-2nd Intro SessionAWS tutorial-Part59:AWS Cloud Database Products-2nd Intro Session
AWS tutorial-Part59:AWS Cloud Database Products-2nd Intro Session
 
Ieee-no sql distributed db and cloud architecture report
Ieee-no sql distributed db and cloud architecture reportIeee-no sql distributed db and cloud architecture report
Ieee-no sql distributed db and cloud architecture report
 
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
 
Configuration and Deployment Guide For Memcached on Intel® Architecture
Configuration and Deployment Guide For Memcached on Intel® ArchitectureConfiguration and Deployment Guide For Memcached on Intel® Architecture
Configuration and Deployment Guide For Memcached on Intel® Architecture
 

More from Andolasoft Inc

How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Essential Functionalities Your Real Estate Web App Must Have.pdf
Essential Functionalities Your Real Estate Web App Must Have.pdfEssential Functionalities Your Real Estate Web App Must Have.pdf
Essential Functionalities Your Real Estate Web App Must Have.pdfAndolasoft Inc
 
A Complete Guide to Developing Healthcare App
A Complete Guide to Developing Healthcare AppA Complete Guide to Developing Healthcare App
A Complete Guide to Developing Healthcare AppAndolasoft Inc
 
Game-Changing Power of React Native for Businesses in 2024
Game-Changing Power of React Native for Businesses in 2024Game-Changing Power of React Native for Businesses in 2024
Game-Changing Power of React Native for Businesses in 2024Andolasoft Inc
 
A Complete Guide to Real Estate Website Development
A Complete Guide to Real Estate Website DevelopmentA Complete Guide to Real Estate Website Development
A Complete Guide to Real Estate Website DevelopmentAndolasoft Inc
 
How to Build Cross-Platform Mobile Apps Using Python
How to Build Cross-Platform Mobile Apps Using PythonHow to Build Cross-Platform Mobile Apps Using Python
How to Build Cross-Platform Mobile Apps Using PythonAndolasoft Inc
 
Impact of AI on Modern Mobile App Development
Impact of AI on Modern Mobile App DevelopmentImpact of AI on Modern Mobile App Development
Impact of AI on Modern Mobile App DevelopmentAndolasoft Inc
 
How to Optimize the SEO of Shopify Stores
 How to Optimize the SEO of Shopify Stores How to Optimize the SEO of Shopify Stores
How to Optimize the SEO of Shopify StoresAndolasoft Inc
 
14 Tips On How To Improve Android App Performance
14 Tips On How To Improve Android App Performance14 Tips On How To Improve Android App Performance
14 Tips On How To Improve Android App PerformanceAndolasoft Inc
 
The Ultimate Guide to Setting Up Your WooCommerce Store
The Ultimate Guide to Setting Up Your WooCommerce StoreThe Ultimate Guide to Setting Up Your WooCommerce Store
The Ultimate Guide to Setting Up Your WooCommerce StoreAndolasoft Inc
 
Ranking The Best PHP Development Companies in the World
Ranking The Best PHP Development Companies in the WorldRanking The Best PHP Development Companies in the World
Ranking The Best PHP Development Companies in the WorldAndolasoft Inc
 
Top 8 WordPress Design and Development Trends of 2023
Top 8 WordPress Design and Development Trends of 2023Top 8 WordPress Design and Development Trends of 2023
Top 8 WordPress Design and Development Trends of 2023Andolasoft Inc
 
List of 10 Best WordPress Development Companies
List of 10 Best WordPress Development CompaniesList of 10 Best WordPress Development Companies
List of 10 Best WordPress Development CompaniesAndolasoft Inc
 
WooCommerce vs Shopify: Which is Better For Your Online Store
WooCommerce vs Shopify: Which is Better For Your Online StoreWooCommerce vs Shopify: Which is Better For Your Online Store
WooCommerce vs Shopify: Which is Better For Your Online StoreAndolasoft Inc
 
Why Choose WooCommerce For Your eCommerce Store
Why Choose WooCommerce For Your eCommerce StoreWhy Choose WooCommerce For Your eCommerce Store
Why Choose WooCommerce For Your eCommerce StoreAndolasoft Inc
 
Django Workflow and Architecture
Django Workflow and ArchitectureDjango Workflow and Architecture
Django Workflow and ArchitectureAndolasoft Inc
 
Service Oriented Architecture in NodeJS
Service Oriented Architecture in NodeJSService Oriented Architecture in NodeJS
Service Oriented Architecture in NodeJSAndolasoft Inc
 
Top Features And Updates Of Angular 13 You Must Know
Top Features And Updates Of Angular 13 You Must KnowTop Features And Updates Of Angular 13 You Must Know
Top Features And Updates Of Angular 13 You Must KnowAndolasoft Inc
 
How To Organize And Structure Your SASS Code
How To Organize And Structure Your SASS CodeHow To Organize And Structure Your SASS Code
How To Organize And Structure Your SASS CodeAndolasoft Inc
 
Why Businesses Need Open Source Software
Why Businesses Need Open Source Software Why Businesses Need Open Source Software
Why Businesses Need Open Source Software Andolasoft Inc
 

More from Andolasoft Inc (20)

How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Essential Functionalities Your Real Estate Web App Must Have.pdf
Essential Functionalities Your Real Estate Web App Must Have.pdfEssential Functionalities Your Real Estate Web App Must Have.pdf
Essential Functionalities Your Real Estate Web App Must Have.pdf
 
A Complete Guide to Developing Healthcare App
A Complete Guide to Developing Healthcare AppA Complete Guide to Developing Healthcare App
A Complete Guide to Developing Healthcare App
 
Game-Changing Power of React Native for Businesses in 2024
Game-Changing Power of React Native for Businesses in 2024Game-Changing Power of React Native for Businesses in 2024
Game-Changing Power of React Native for Businesses in 2024
 
A Complete Guide to Real Estate Website Development
A Complete Guide to Real Estate Website DevelopmentA Complete Guide to Real Estate Website Development
A Complete Guide to Real Estate Website Development
 
How to Build Cross-Platform Mobile Apps Using Python
How to Build Cross-Platform Mobile Apps Using PythonHow to Build Cross-Platform Mobile Apps Using Python
How to Build Cross-Platform Mobile Apps Using Python
 
Impact of AI on Modern Mobile App Development
Impact of AI on Modern Mobile App DevelopmentImpact of AI on Modern Mobile App Development
Impact of AI on Modern Mobile App Development
 
How to Optimize the SEO of Shopify Stores
 How to Optimize the SEO of Shopify Stores How to Optimize the SEO of Shopify Stores
How to Optimize the SEO of Shopify Stores
 
14 Tips On How To Improve Android App Performance
14 Tips On How To Improve Android App Performance14 Tips On How To Improve Android App Performance
14 Tips On How To Improve Android App Performance
 
The Ultimate Guide to Setting Up Your WooCommerce Store
The Ultimate Guide to Setting Up Your WooCommerce StoreThe Ultimate Guide to Setting Up Your WooCommerce Store
The Ultimate Guide to Setting Up Your WooCommerce Store
 
Ranking The Best PHP Development Companies in the World
Ranking The Best PHP Development Companies in the WorldRanking The Best PHP Development Companies in the World
Ranking The Best PHP Development Companies in the World
 
Top 8 WordPress Design and Development Trends of 2023
Top 8 WordPress Design and Development Trends of 2023Top 8 WordPress Design and Development Trends of 2023
Top 8 WordPress Design and Development Trends of 2023
 
List of 10 Best WordPress Development Companies
List of 10 Best WordPress Development CompaniesList of 10 Best WordPress Development Companies
List of 10 Best WordPress Development Companies
 
WooCommerce vs Shopify: Which is Better For Your Online Store
WooCommerce vs Shopify: Which is Better For Your Online StoreWooCommerce vs Shopify: Which is Better For Your Online Store
WooCommerce vs Shopify: Which is Better For Your Online Store
 
Why Choose WooCommerce For Your eCommerce Store
Why Choose WooCommerce For Your eCommerce StoreWhy Choose WooCommerce For Your eCommerce Store
Why Choose WooCommerce For Your eCommerce Store
 
Django Workflow and Architecture
Django Workflow and ArchitectureDjango Workflow and Architecture
Django Workflow and Architecture
 
Service Oriented Architecture in NodeJS
Service Oriented Architecture in NodeJSService Oriented Architecture in NodeJS
Service Oriented Architecture in NodeJS
 
Top Features And Updates Of Angular 13 You Must Know
Top Features And Updates Of Angular 13 You Must KnowTop Features And Updates Of Angular 13 You Must Know
Top Features And Updates Of Angular 13 You Must Know
 
How To Organize And Structure Your SASS Code
How To Organize And Structure Your SASS CodeHow To Organize And Structure Your SASS Code
How To Organize And Structure Your SASS Code
 
Why Businesses Need Open Source Software
Why Businesses Need Open Source Software Why Businesses Need Open Source Software
Why Businesses Need Open Source Software
 

Recently uploaded

Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 

Recently uploaded (20)

Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 

How to boost performance of your rails app using dynamo db and memcached

  • 1. From the Resource Library of Andolasoft.Inc | Web and Mobile App Development Company 1
  • 2. From the Resource Library of Andolasoft.Inc | Web and Mobile App Development Company 2 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.
  • 3. From the Resource Library of Andolasoft.Inc | Web and Mobile App Development Company 3 At a high-level Memcached works as follows: 1. The client requests a piece of data which Memcached checks to see if it is stored in cache. 2. There are two possible outcomes here: 1. If the data is stored in cache: return the data from Memcached (no need to check the database). 2. If the data isn't stored in cache: query the database, retrieve the data, and subsequently store it in Memcached. 3. Whenever information is changed or the expiry value of an item has expired, Memcached updates its cache to ensure fresh content is delivered to the client. A few important points about Memcached architecture include: Data is only sent to one server. Servers don't share data. Servers keep values in RAM. If RAM runs out the oldest value is discarded. What is DynamoDB Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability. With DynamoDB, you can create database tables that can store and retrieve any amount of data and serve any level of request traffic. You can scale up or scale down your tables' throughput capacity without downtime or performance degradation. DynamoDB is a particularly good fit for the following use cases Applications with large amounts of data and strict latency requirements Server less applications using AWS Lambda
  • 4. From the Resource Library of Andolasoft.Inc | Web and Mobile App Development Company 4 Data sets with simple, known access patterns Installing Memcached There are a few ways you can install Memcached. Depending on which system you're using, the method will vary. As outlined on the official Memcached Installation Wiki, installation from a package is simple. Using Memcached with DynamoDB in Rails Memcached is a quick in-memory protest reserving framework that can make Rails run much quicker with not very many changes. Memcached will work on any database used in Rails application. When the table is small and request volume is low this isn’t much of an issue, but as your database and user volume grow, these can impact the performance of your application. In such cases Memcached plays an important role to reduce the database load by caching the request object in memory. To use Memcached in Rails app, follow the below steps Install dalli gem gem 'dalli' Add "dalli" gem to your gem file and install it. Development/Production file config.cache_store = :dalli_store
  • 5. From the Resource Library of Andolasoft.Inc | Web and Mobile App Development Company 5 config.action_controller.perform_caching = true Add the above lines in your development.rb or production.rb file as per the requirement Add Memcached in your method search_query = "user_id = :user_id AND is_approved = :is_approved" search_param = {":user_id" => params[:user_id], ":is_approved" => 't'} all_games = Rails.cache.fetch('all_lists', expires_in: 2.minutes) { do_scan(Article.table_name,search_query,search_param) } The above query syntax is an example of combination of Memcached and DynamoDB. In this example once the query executed and the result will store in the "all_list" key of the Memcached and expire after 2 minutes automatically. Conclusion: DynamoDB and Memcached is a powerful combination for your Rails app. If you're looking to improve the performance of your Rails application, this may be the solution for you. DynamoDB and Memcached involves storing information in an external database, which can be retrieved with a single call. This will allow you to avoid the constant querying of data from your application's memory.
  • 6. From the Resource Library of Andolasoft.Inc | Web and Mobile App Development Company 6 There are many benefits to this gem, but most importantly, increased response time for your application. Faster response times mean less downtime and more satisfied customers. You have rails application but don’t know how to maximize the performance with DynamoDB and Memcached. Andolasoft has experienced rails developer who has good hands on DynamoDB and Memcached. So fell free to discuss about your project. Book a free consultation