Sunday 28 April 2019

Salesforce Org Health Check | Security Health Check | Apex PMD Tools | Checkmarx




"It is health that's real wealth and not items of gold and silver", is something that very aptly applies to Salesforce.com orgs as well. You do not need a Salesforce.com org plagued with problem like CPU timeouts, Query timeouts and Row Lock errors. And the good part is that you simply yourself can be the doctor of your org.

The things can be as simple as checking the storage stats of the objects in your org or analysing the way your batches are scheduled and the time they take for execution. The next step after the analysis is complete is to provide remediation to the caused issues. And that is not too hard either. The main aim is to make small but necessary changes to the configuration of your system, while keeping the behavior intact and without compromising the performance.


We did one session in ApexHours with Saket Joshi on sale topic.


In that session we covered the frequency of performing these health-checks on your org to ensure scalability of the system. Once the issues are fixed, it is expected to have improved system performance and less issues caused because of either concurrency or data fragmentation.


Some Key Point :-

Your Salesforce org is unwell?

Identifying the wellness of your org

  1.     Performance Issues
  2.     Data Storage Limitations
  3.     Scalability and Planning
  4.     Record Locking & Contention

Symptoms of an Unhealthy Salesforce Org

Symptoms of an Unhealthy Salesforce Org

  1.     Storage Limits Exceeded
  2.     Frequent Issues
  3.     Record Locking & Contention
  4.     Unnecessarily Installed Packages
  5.     Concurrent and Ever-Running Batch Classes

Diagnosis

Diagnosis

  1.     Generate a report of issues found
  2.     Prioritizing the issues
  3.     Organizing the issues by complexity
  4.     Solutioning a quick-fix to the issues

Tools for Diagnosis


Some Common Tools for Diagnosis

  1.     Salesforce Health Checker ( URL)  
  2.     ApexPMD Tool ( URL )
  3.     Checkmarx Apex Code Scanner ( URL )  
  4.     Salesforce Accelerators (URL)   
  5.     Manual Org Assessment

Remediation

Remediation

1) Analyse and fix the record skew

  • Decentralization of records

2) Data Archival & Cleanup

  • Deletion of unnecessary data
  • Using third-party APIs (Amazon Cloud)

3) Fix the row lock issues

  • Avoid parallel processing
  • Using SOQL locks

4) Avoid the CPU Timeouts and/or Query Timeouts

  • Field Indexing
  • Using Async Apex for long running operations
  • Optimizing the query/report filters
  • Database refactorization

5) Uninstalling unwanted packages


6) Rescheduling the batches & schedulers

  • Analyse batch duration & change batch chunk size
  • Simultaneous running of non-related batches
  • Deciding the frequency


Here is recording of session.






Thanks,
Amit Chaudhary
amit.salesforce21@gmail.com 
Capture.JPG  @amit_sfdc    @ApexHours
  Salesforce Apex Hours 
     #SalesforceApexHours