MathWorks - Mobile View
  • Sign In to Your MathWorks AccountSign In to Your MathWorks Account
  • Access your MathWorks Account
    • My Account
    • My Community Profile
    • Link License
    • Sign Out
  • Products
  • Solutions
  • Academia
  • Support
  • Community
  • Events
  • Get MATLAB
MathWorks
  • Products
  • Solutions
  • Academia
  • Support
  • Community
  • Events
  • Get MATLAB
  • Sign In to Your MathWorks AccountSign In to Your MathWorks Account
  • Access your MathWorks Account
    • My Account
    • My Community Profile
    • Link License
    • Sign Out

Videos and Webinars

  • MathWorks
  • Videos
  • Videos Home
  • Search
  • Videos Home
  • Search
  • Contact sales
  • Trial software
  Register to watch video
  • Description
  • Full Transcript
  • Related Resources

Using the MATLAB Production Server REDIS Cache to Rapidly Store and Retrieve Data

Gabriel Ha, MathWorks

The REDIS high-speed cache shipped with MATLAB Production Server™ allows you to store data. This function is particularly useful to:

  • store transient data between calls
  • load a large data file that is required for execution, such as a machine learning model (.mat) file

See how REDIS works with an example that calculates the remaining useful life (RUL) of a machine.

This video highlights a feature of MATLAB Production Server introduced in R2018b: the ability to store persistent data in a high-speed in-memory cache.

MATLAB Production Server requests are stateless, meaning that each call is independent of the previous one. There are times when you will want to store data or a state between calls, and MATLAB Production Server implements this feature by utilizing a high-speed in-memory database called REDIS. REDIS is shipped with MATLAB Production Server for on-premise installations, and MATLAB Production Server on the cloud lets you call the cloud service provider’s implementation, for example, Azure REDIS cache.

There are 2 primary scenarios where you’ll want to use the REDIS persistent cache:

  1. Storing transient data between calls to MATLAB Production Server, like preference settings, or for calculating a moving average
  2. Loading a large data file required for execution, like a .mat file containing a machine learning model

The following example demonstrates both these scenarios. It uses incremental machine learning to predict the RUL—the remaining useful life of a motor.

The machine learning RUL algorithm has been deployed to MATLAB Production Server, and the predictive machine learning model required for the algorithm has been stored on REDIS.

The client application sends current samples of the motor to MATLAB Production Server, along with a request for the RUL given those samples. The RUL algorithm runs on a worker process which loads the predictive machine learning model from REDIS. This happens very quickly since REDIS is an in-memory database.

The predicted RUL is returned to the client application.

The model is also incrementally updated with the sample data and written back to REDIS to await the next invocation.

The results collected over time can be plotted on a chart in the client application.

Let’s see how this plays out.

We have data from a motor collected in sequence all the way to the end of its “Remaining Useful Life.” The 'monitorRUL' test script will perform an expedited simulation of the RUL for this motor by sending all those samples in sequence to MATLAB Production Server. It will also plot the RUL results as results are retrieved.

Line 6 of this code shows the syntax for connecting to a running REDIS cache. Lines 18 and 20 show how to use MATLAB 'put' and 'get' functions to write and read data to and from the cache.

Let’s now run the monitorRUL script, which will be sending the data to a MATLAB Production Server instance containing the deployed RUL algorithm and the corresponding predictive model stored in a REDIS cache.

We see that after about 2500 minutes of data, the model indicates a steep decline in the motor’s remaining useful life. A predictive maintenance application would use this information to alert someone to schedule maintenance for this particular motor.

To learn more about how to use persistence in MATLAB Production Server, visit the following website: https://www.mathworks.com/help/mps/ml_code/use-a-data-cache-to-persist-data.html

Related Products

  • MATLAB Production Server

Learn More

Request a trial of MATLAB Production Server
Related Information
Try it

Feedback

Featured Product

MATLAB Production Server

  • Request Trial
  • Get Pricing

Up Next:

38:28
MATLAB Production Server for Financial Applications

Related Videos:

20:17
Building a Big Engineering Data Analytics System with MATLAB
19:44
Access Data from Bloomberg Terminal, Server, and B-PIPE
53:22
Acquiring Data from Standalone Instruments and Data...
12:06
Setting Up MATLAB Parallel Server with MATLAB Job Scheduler

View more related videos

MathWorks - Domain Selector

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

Select web site

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文Chinese
    • English
  • 日本Japanese (日本語)
  • 한국Korean (한국어)

Contact your local office

  • Contact sales
  • Trial software

Explore Products

  • MATLAB
  • Simulink
  • Student Software
  • Hardware Support
  • File Exchange

Try or Buy

  • Downloads
  • Trial Software
  • Contact Sales
  • Pricing and Licensing
  • How to Buy

Learn to Use

  • Documentation
  • Tutorials
  • Examples
  • Videos and Webinars
  • Training

Get Support

  • Installation Help
  • Answers
  • Consulting
  • License Center
  • Contact Support

About MathWorks

  • Careers
  • Newsroom
  • Social Mission
  • Contact Sales
  • About MathWorks

MathWorks

Accelerating the pace of engineering and science

MathWorks is the leading developer of mathematical computing software for engineers and scientists.

Discover…

  • Select a Web Site United States
  • Patents
  • Trademarks
  • Privacy Policy
  • Preventing Piracy
  • Application Status

© 1994-2021 The MathWorks, Inc.

  • Facebook
  • Twitter
  • Instagram
  • YouTube
  • LinkedIn
  • RSS

Join the conversation