0

We are facing this problem in one of our ORG. 9.6MB of space is used out of 10MB of custom settings data size.

Can we request Salesforce Support Team to increase the limit? I came across other method to solve this by converting list custom settings to custom metadata types.

But this will add limitation on other side. This will add queries on custom meta data type records to SOQL limts Also we cannot do Create, Update and Delete operations on records in custom meta data types

Does the second method really solves my problem? Does this create any performance issue, as Custom Meta data type records are not cached?

Any help on this topic is much appreciated

Thanks, Anil

2

Actually, meta-data queries do not impact SOQL limits. You can update meta-data from within APEX using the meta-data API although this is more complicated than the same method in custom settings.

And yes, there's a small performance hit but in most cases this is negligible. And if you really need the information cached you can use a combination of custom meta-data and the platform cache (store your settings in meta-data and only query them when the cache is invalid).

  • Thank you @gNerb for your help! Thank you for clarifying on SOQL quey limits on Metadata types, update/delete operation on Metadata, performance. And also suggestion on Platform Cache. Your help helps me lot going forward on these problems. – Anil Kumar Aug 13 '18 at 20:16
0

Review your architecture if everything is needed to store as Custom settings.

There are other options available, which I can suggest you to use Platform Cache which has greater limits.

  • Enterprise Edition - 10 MB
  • Unlimited and Performance - 30 MB

Store values in cache

// Add a value to the cache
DateTime dt = DateTime.parse('06/16/2015 11:46 AM');
Cache.Org.put('ns1.partition1.orderDate', dt);
if (Cache.Org.contains('ns1.partition1.orderDate')) {
    DateTime cachedDt = (DateTime)Cache.Org.get('ns1.partition1.orderDate');
}

You can retrieve the values from cache as follows without using SOQL queries

Cache.Org.put('orderDate', dt);
if (Cache.Org.contains('orderDate')) {
    DateTime cachedDt = (DateTime)Cache.Org.get('orderDate');
}

In my experience, I have got excellent benefit using custom settings with Platform cache together.

Custom settings are good if you are using configuration settings related data which will be available frequently. So, you need to revisit your architecture what type of data to be stored or cached.

Here are few points I have followed:

  1. If you have configurable settings which are same irrespective of orgs then store them as Custom MetaData Types.

  2. If you want to insert, update, or delete configurable settings store them in Custom Settings for cache.

  3. If you have large volume of data which you cannot accommodate in custom settings then store in Custom object and use Platform cache also. So, if cache is empty then add values to the cache (one SOQL query will be good) and next time read them from cache.

  • I thought about recommending platform cache but you can't add information into the cache manually in the back-end the same way with custom settings and meta-data. Additionally, the cache has a limited lifespan making it less than Idea for long-term configuration storage. – gNerb Aug 13 '18 at 19:27
  • @gNerb, here OP needs to revisit the architecture which things need to put on cache and where he should use custom settings or metadata types – Santanu Boral Aug 13 '18 at 19:29
  • I agree he needs to stop using custom settings but the org cache is not the correct approach, even with your update of saying to use both doesn't work because it still relies on custom settings for long term storage which means he will still be limited to 10mb. He needs custom meta-data and if he needs it cached he needs to combine custom meta-data with the org cache. – gNerb Aug 13 '18 at 19:31
  • Here I am talking about using both Custom settings along with Platform cache – Santanu Boral Aug 13 '18 at 19:33
  • 1
    I understand, unfortunately since the end user is having issues with storing information in custom settings, I wouldn't recommend continuing to use custom settings. – gNerb Aug 13 '18 at 19:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.