Blog

Software October 28, 2017 3 min read Anup Marwadi

Redis Performance Guidelines – Part 1

Redis Performance Guidelines – Part 1

Redis High Performance Tips

Redis is an amazing, in-memory, data structure store that is used by many large applications as an underlying data store as well as a high performance Cache.

Redis is a single threaded client, which means only one request can be processed at a time. To facilitate better Redis development, there are several important items we need to consider:

1. Don’t make redis payloads too big. 100KB is considered to be a large payload in Redis.

2. Don’t make clients wait too long to get their data or else hundreds of requests will start piling up and timeout will occur if they are not serviced in a timely manner.

3. Make sure there isn’t a lot of latency between the calling application and Redis. In terms of Data Centers, the Redis Server and the calling application have to reside in the same Data Center. In terms of Amazon/Azure, this means they have to reside in the same Region under the same Resource Groups (for Azure)

4. Make sure calling Clients have the bandwidth capacity to process incoming information rapidly. The last thing you want is the inability of a client to process an incoming request in a timely fashion thereby delaying other requests.

5. Try to pipeline multiple requests. Let’s say you have a method that needs a few items from the Redis. The right way of programming involves writing a method that checks Redis first, if the entry is available, it returns the value, else the record is fetched from the database. That way the logic to get a particular item is centralized behind one method. This comes with its own drawbacks because if you have 4 such methods that you need make 4 different round-trips to Redis.

The new way of thinking involves pipelining multiple Redis Requests into a single batch so that multiple round-trips are eliminated. Once the Redis responses come through, decisions can be made to invoke the Database to fetch records that were not available in Redis. It makes writing centralized code a little harder, but yields better outcomes. If you don’t think this is a big deal, your application probably isn’t getting the kind of traffic we see for some of the applications we make.

6. Stack Exchang C# Related – Treat the Redis Connection Multiplexer as a Singleton. This will save you a lot of frustration down the road. For a good implementation, check here: http://taswar.zeytinsoft.com/redis-for-net-developer-connecting-with-c/

7. Try using Hash data-structure instead of serializing JSON all the time for complex objects. This is again a departure from common-sense (or convenient) programming into a little bit more work but pays off huge dividends. We also know that Hashes are more performant so use them!

A couple of good reads here:

Frequently Asked Questions

Can I use PowerBI in a website?

Category: PowerBI

PowerBI offers a robust Web application that you can view and interact with reports from. However, if you need to use PowerBI from a 3rd party platform, you can always use PowerBI embedding. The pricing structure varies for embedding, please check the PowerBI website for more information.

Can you connect with 3rd party APIs?

Category: PowerBI

Yes, we connect with 3rd party APIs and pull data into your PowerBI platform on a regular basis. This requires additional custom coding or implementation of 3rd party tools like Zapier or Microsoft’s Power Automate

How do you charge for PowerBI services?

Category: PowerBI

We offer PowerBI services as a part of our HyperTrends Sense product offering. We usually charge an initial flat-fee for setup and data ingestion/transformation followed by monthly data management fees. Our pricing is simple, predictable and gives you the biggest ROI for your investment.

Anup Marwadi

Anup Marwadi is a technology entrepreneur, an investor and an avid-learner of business skills. He is the CEO of HyperTrends Global Inc. and TicketBlox and is currently involved in numerous advisory positions with Healthcare and Manufacturing companies. Anup is on a mission to build technology products that disrupt industries and help businesses grow by using technology and software as their primary differentiator. Anup is an avid traveler, a speaker and loves fitness and adventure. Anup is a board-member at Entepreneur's Organization (EO) - San Diego.

Leave a Reply

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

HyperTrends Global Inc.TM © 2024. All Rights Reserved.

HyperTrends Global Inc.TM is a Digital Innovation Agency with a mission to serve fast-growing businesses and help build their technology strategies