What is the difference between uvm_config_db and uvm_resource_db?

if I have to set some value from the bottom to the top , which one should I use ?

uvm_config_db is working in the build phase in the top-down approach but if I write uvm_config_db in the connect phase which is a button - up approach . How does it will work in that case ?

I’ll first ask what exactly you need to pass or set from the lower to the upper level of the TB hierarchy during the build_phase.

Based on your answer, we can determine whether it really needs to be passed during the build_phase
If not, you could use something else instead — for example, analysis_ports or events

The main difference between uvm_config_db and uvm_resource_db that config_db is more flexible.

You can pass your data in any direction, but you have to take care the the target object is existing.