Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dapper memory usage when using many databases

Tags:

dapper

I have a setup using Dapper where I have many databases that are structured identically to each other. There could be potentially thousands of them, and the way I have to connect to them is by using a different connection string on each.

I know that Dapper caches some information for each query related to reflection and maybe other stuff, but I was wondering if having many different connection strings will result in a notable increase in memory usage over a single DB, or if the cache is more for reflection data and not connection-specific.

Thanks in advance.

like image 953
Grady Werner Avatar asked Mar 29 '26 02:03

Grady Werner


1 Answers

Dapper came out of some of the Stack Overflow development, and what you describe is exactly how Stack Overflow (or rather: the Stack Exchange Network) works - i.e. a multi-tenancy process that talks to any of hundreds or thousands of connection strings depending on the specific request. So: Dapper deliberately doesn't do anything that is connection or connection-string specific; all the caching is based on the look of the type, command or results.

like image 192
Marc Gravell Avatar answered Apr 02 '26 12:04

Marc Gravell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!