Memcached Vs Redis, Which One to Pick for Large Web App?

Introduction:

MemcacheD is easy yet powerful. It’s manageable design promotes fast deployment, ease of exaggeration, and solves many problems related to large data caches. It has its inbuilt APIs which provide a very large hash table distributed across multiple machines & uses internal memory management which is more efficient in the simplest use cases because it consumes comparatively less memory for metadata. MemcacheD supports only String data type which are ideal for storing read-only data.

Memcached is a volatile in-memory key-value origin. It is rude, multi-threaded and used primarily for caching objects.

Redis is an open source in-memory data structure store which also can be used as a database as well as caching. It supports almost all types of data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes through radius queries. Redis also can be used for messaging system used as pub/sub.

Internal Architecture:

Internal Architecture

 

Here are the key points to consider,

Installation:

Installing Redis is so much easier. No dependencies required.

Memory Usage:

MemcacheD’s internal memory supervision, while not exactly a substitute to Redis; Is more efficient because it consumes comparatively less memory resources for metadata. For easy key-value pairs, MemcacheD is more memory efficient than Redis. Redis is more memory efficient, only after you use Redis hashes.

Persistence:

If you are using MemcacheD, data might be lost with a restart and rebuilding cache is a costly process. On the other hand, Redis can handle persistent data. By default it syncs data to the disk at least every 2 seconds, offering optional & tuneable data persistence meant to bootstrap the cache after a planned shutdown or an unintentional failure. While we tend to regard the data in caches as volatile and transient, persisting data to disk can be quite valuable in caching scenarios.

Replication:

MemcacheD does not support replication, whereas Redis supports master-slave replication. It allows slave Redis servers to be the exact copies of master servers. Data from any Redis server can replicate to any number of slaves. Replication can be used for implementing a cache setup that can withstand failures and find the maintenance for uninterrupted facilitation to the application.

Storage type:

MemcacheD stores variables in its memory & retrieves any information directly from the server memory instead of hitting the database again. On the other hand, Redis is like a database that resides in memory. It executes (reads and writes) a key/value pair from its database to return the result set. Developers use Redis for real-time metrics & analytics too.

Read/Write Speed:

MemcacheD is very good to handle high traffic websites. It can read lots of information at a time and give you back at a great response time. Redis can neither handle high traffic on read nor heavy writes.

Data Structure:

MemcacheD uses strings and integers in its data structure. Hence, everything you save can either be one or the other. With integers, the only data manipulation you can do is adding or subtracting them. If you need to save arrays or objects, you will have to serialize them first and then save them. To read them back, you will need to un-serialize.

In comparison Redis has stronger data structures, which can handle not only strings & integers but also binary-safe strings, lists of binary-safe strings, sets of binary-safe strings and sorted sets.

Key Length:

MemcacheD’s key length has a maximum of 250 bytes, whereas Redis has a maximum of 2GB.

Here is the benchmarking result by DB-Engines, which clearly shows the leader.

Conclusion:

Use Redis, if you need to do operations on cached datasets at once or need to spread one enormous cache over a geographically challenged area. Read-write splitting against caching will enormously help performance and alleviate the cache connection starvation.

On the other hand, you might want to stick to Memcached for its simplicity, reliability and speed.

SEE ALSO: How to Install and Configure Redis Server on Centos/Fedora Server

If you’re thinking anything on Ruby on Rails, get in touch with Andolasoft’s experts. Let’s convert your idea into an App.

Have something to add to this topic? Share it in the comments.

Enhance Speed of your web app with Backbone.js

Backbone.js is a popular open source JavaScript framework that allows us to develop single page web application. It offers a MVC framework for organizing Javascript application.

backbonerails-new1

 

 

 

 

 

 

 

 

What is Backbone.js?

  • Building single-page web apps or complicated user interfaces will get extremely difficult by simply using JQuery alone. Because JavaScript libraries are great at what they do, without realizing it you can build an entire application without any formal structure. Whereas Backbone.js is a lightweight framework that allows us to create single page applications in a structured manner. Backbone.js enforces that communication to the server should be done entirely through a RESTful API. The web is currently trending such that all data will be exposed through an API, because the browser is no longer the only client, now we have mobile devices, tablets and electronic fridges etc.
  • Website speed is the demand of the day. Running a website with full server dependencies, is not cost effective in terms of speed. If for each and everything we depend upon server and every request is served with a page refresh, then it will be annoying to any user. If you use MVC client architecture like Backbone.js, then most of the load on server is reduced and the website is depends on server only for getting json data and not for the logic of how to display it.
  • Better user experience is needed for every website that wants more and more users to visit it. And Backbone.js provides a very good user experience, as the demand of the users are served only in the client machine. User does not need a page refresh for any action.

Advantages of Backbone.js

  • Streamlined Event handling
    When a project grows, the jQuery declarations and callbacks gets more complex. The code becomes more cluttered. Backbone.js overcome this problem by providing an event-driven communication between views and models. The backbone.js events build on top of regular DOM events, which makes the mechanism very versatile and extensible.
  • Syncing with a back-end
    The models in Backbone.js can be easily tied to a back-end. The framework provides excellent support for RESTful APIs in that models can be mapped to RESTful endpoints.
  • Maintainability by following conventions
    Conventions are a great way to introduce a common coding style without the need of coming up with an extensive set of coding standards. Backbone.js is particularly helpful to maintain a clean code base despite having multiple developer involved in the coding.
  • Organized Code
    Backbone.js is a client-side MVC architecture. It is a design pattern where we separate the data from the way it is defined, manipulated and displayed. It allows you to structure your Javascript code in an MVC pattern.
  • Speed
    In the MVC platform, web application depends upon server for getting json data for the logic on how to display it. Here load on server is reduced and it helps in increasing the speed of the website.
  • Reduced data transfer
    Normally when client searches a record from the database, it sends a request to server.And then, to render output, database starts processing and send response.
    Server -> database processing-> rendering output-> Response
    But with Backbone.js request will be sent only for data and data will be returned from server in json format. Those data is manipulated at client-side.

 

In essence the backbone is the way to structure your application better. You can easily organize client side ‘JavaScript’ code into MVC pattern of Rails applications. Check out implementation of ‘Backone.js’ into Rails applications.

We have implemented numerous Rails applications with backbone.js. Two out of them are KurrentJobs and OrangeGigs.

Please share your experience of implementation of Backbone.js in Rails.

 

Andolasoft launched service on QA Automation

We are excited to announce launching of QA Automation service at Andolasoft.
QA is an important phase of SDLC (Software Development Life Cycle) for releasing quality software.

Why QA Automation?

While manual testing is appropriate in some cases, it is a time-consuming and tedious process that is inefficient and conflicts with today’s shorter application development cycles.

As a result, it impedes the ability to thoroughly test an application. Whereas, Automated testing creates new efficiencies that accelerate the testing cycle and promote software quality.

Automated tests are quicker to run than manual tests as there’s no lag time between input and checking, as a result you can run more tests in multiple browsers rapidly.

Manual testing has a high risk of missing out of any test case, whereas Automated tests have zero risk of missing out a pre-decided test case.

Automation_Testing

Benefits of Software Automation Testing

Saves Time :
As automated tests are run by tools, it runs tests significantly faster than human users which adds to the first benefit of saving time.

Cost Effective :
Software automation tools are expensive for short-term, but you can save money in long-term. With the help of Automation tool, you can easily find bugs in less time. This allows your team to react more quickly, as a result it saves your precious time and money.

Consistency:
Automated testing offers a level of consistency, which is not achievable through use of manual testing.

Repeatable:
Testers can test how the software reacts under repeated execution of the same operations.

Reusable:
Tests can be reused on different versions of an application, even if the user interface changes.

Reliable:
Tests perform precisely the same operations each time they are run, thereby eliminating human error.

Comprehensive: You can build a suite of tests that covers every feature in your application.

Programmable:
Testers can program sophisticated tests that bring out hidden information from the application.

Quality:
Automation tools cuts costs and reduces software product time, as well as it help to ensure high level of quality in software projects.

Why QA Automation from Andolasoft ?

We have worked on various test automation models empowering us to provide custom solution based on client needs. Andolasoft uses only the latest performance testing technology like

  • Selenium (For Automation Testing)
  • Load UI and Browsermob (For Load Testing)
  • Accunetix, N-stalker, Nsparker & Websecurify (For Security Testing)
  • Browserlab & IE tester (For UI Testing)
  • Our own product Orangescrum (For Bug Tracking)

Our approach to Automation Testing is as illustrated below:

  • Decide and Design the framework
  • Prepare Test Cases / Business flows
  • Based on the number of flows and their size, effort estimation is prepared
  • Testers are involved in effort estimation process
  • Implement the framework by developing user defined functions / procedures and reusable actions required by the framework
  • Begin automating the scripts by means of the framework
  • Review the completed scripts
  • Use the scripts to check the sanity of the script against the AUT(Application Under Test)
  • Defect found during regression logged in defect tracking tool(Orangescrum)
  • Test execution report submitted to the stakeholders
  • Preparing metrics analysis
  • Enhancements or GUI changes handled with proper documentation
  • Based on the enhancement / change, scripts tweaked
  • As and when need arises required set of scripts executed
  • Regression testing is run in a batch in unattended mode
  • Delivering results to client for approval

You can check out the latest trends for the Software Testers.

Andolasoft follows a test automation strategy where our testing engineers do analyse your applications and provides you all the possibility of test automation.

Read more on accessibility testing tools

This analysis helps our client to achieve the optimum return on their investment and provide real benefit to the projects in which they are working with. If you wish to avail of our test automation consulting services, please contact us.

Visit our Quality Assurance services for more information about the Manual and Automation testing. We look forward to your feedback/comment.