Jump to content

Best practices for deploying Inspections

From Resco's Wiki
Revision as of 09:22, 21 January 2022 by Jzambor (talk | contribs) (Created page with "{{Inspections TOC}} {{WIP}} When you deploy Inspections in large projects without considering performance, your users may experience performance degradation. Learn about t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Warning Work in progress! We are in the process of updating the information on this page. Subject to change.

When you deploy Inspections in large projects without considering performance, your users may experience performance degradation. Learn about the possible problems in advance and set up your questionnaires correctly to mitigate the risks.

What are some of the problems that you may encounter?

Server problems
Client problems
  • Slow synchronization
  • High memory consumption
  • Sluggish experience

Questionnaire size

We recommend a maximum of 200 questions per questionnaire.

On the server side, creating a questionnaire with several hundreds of questions may lead to performance degradation in the Questionnaire Designer. On the client side, performance can be also negatively affected, particularly on older mobile devices. Obviously, current high-end devices can handle more than low-end phones from several years ago.

Too many images

If you add too many images to a single questionnaire, the mobile app may become sluggish or unresponsive. Some devices may encounter performance degradation after several dozens of images, other can handle 100+ without problems. This depends on a variety of factors, such as device memory, operating system, and image size.

Mitigation strategies:

  • In the Questionnaire Designer, set the proper limits on the Properties pane for Image/Media type of questions, such as the maximum count of images per question, the maximum size of the uploaded file, or maximum image resolution.
  • Split the questionnaire in two.
  • Deploy modern devices with high RAM.

Rapidly increasing database footprint

If you created your Resco Inspections organization some time ago, the default setting used to be that every single answered questionnaire is saved in a self-contained way, i.e., it includes the answers, but also the questions along with any possible custom images (logo), business rules, and styles. This approach ensures that even if the original questionnaire template changes, your answered questionnaires are unaffected.

In scenarios where questionnaires are changing frequently and each questionnaire is answered only a limited number of times, this is a valid approach. However, if your inspectors perform hundreds or thousands of inspections every day, you might discover that your database gets full of redundant data.

Eliminate redundant data

Use the parameter Dependency Level in the properties of a questionnaire template to control this behavior.

  • None: Questionnaires are self-contained, at the cost of an increased database footprint.
  • Images: In this case, static images of the questionnaire template (such as the logo) are not included in each answer.
  • Full: Save only the answers. Static images, questions, rules, and styles are not included; instead, they are replaced with a reference to a questionnaire template. This option is recommended if your questionnaires rarely change and it is only available for versioned questionnaire templates.
Using versioned templates means that old template versions gain the archived state. Sometimes, the sync filter for the Questionnaire entity is configured to exclude archived templates. If you attempt to view old answered questionnaires (that use an archived template with medium or high dependency level) in the app in offline mode, you may encounter the Questionnaire template not found! error. In this case, consider modifying the sync filter to make archived templates available in the offline mode.

Template dependency can save 60-80% of the storage in a typical scenario. Savings can be much more extreme, for example, if you use a high-resolution questionnaire logo 2MB logo for a short questionnaire.

External document storage

Another complementary option is saving your images in external cloud document storage, rather than in the database. This behavior is configured on the Properties pane for images in the parameter Storage Entity. Cloud document storage is often much cheaper than databases. Resco Inspections supports third-party document storage by Box, Dropbox, Google Drive, OneDrive, and SharePoint. See Cloud storage for questionnaire images for more information.

Sync: upload takes too long

Inspectors in the field who perform many large inspections regularly may sometimes experience the problem that the upload phase of synchronization takes too long, particularly if the network isn't too good.

There are two main configuration settings that can dramatically improve sync performance:

  • Eliminate redundant data using template dependency
  • Greatly reducing the number of transferred records by saving all answers from a questionnaire as a single JSON string

Increasing the dependency level to full as described above can help, because the amount of data for upload is reduced. Additional savings can be accomplished by changing how questionnaire answers are stored and uploaded.

Edit your questionnaire template and on the Properties pane, configure the Answer Storage to select how should the answers be stored.

  • Records: This is the default option. Each answer is transferred as a single record during synchronization. This may make synchronization slower, but ensures the best compatibility with the backend servers and allows you to leverage existing tools to visualize the data.
  • JSON or Compressed JSON: These options offer improved synchronization performance, however, not all tools understand JSON.

Sync: download takes too long

If your app users (inspectors in the field) experience long download times followed by many deletions, consider setting the Synchronization strategy for the entity Questionnaire to Incremental with Sync Filter.

Slow questionnaire loading time

Note This problem may apply to questionnaires created before release 13.1.

If your complex questionnaire templates include many On Change rules, app users may experience slow performance when they open the questionnaire in the app. This issue affects particularly older devices.

Edit your questionnaire template and on the Properties pane, set the Rules Version parameter to Latest, to take advantage of optimized handling of On Change rules during questionnaire loading. To learn more about this parameter, read Rules version.