You can use custom settings or custom metadata, I do recommend custom settings because for custom metadata you need to use the Operations Class methods to update the values.
Custom Settings
The limits from custom settings are the same as custom objects. Since they are a special type of Custom Object, it shouldn't lead to any problem if follows the SF best practices.
Custom settings are a type of custom object. Each custom setting counts against the total number of custom objects available for your organization.
https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_custom_settings.htm
Edit: https://help.salesforce.com/s/articleView?language=en_US&id=sf.cs_limits.htm&type=5
Custom Metadata:
https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_Operations.htm
For custom metadata you should consider how many updates you'll do on the value:
For deployments, because of Metadata.Operations.enqueueDeployment() uses asynchronous Apex, queued deployment jobs and deployment callbacks are counted as asynchronous jobs in the current org. Queued deployment jobs and callbacks are subject to governor limits. See Lightning Platform Apex Limits.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_metadata_security.htm