I'm working in a project that must maintain a lot of records in cache (Apache Ignite), this records are divided by companies.
Ex:
Company; product; quantity
CompA; A; 15
CompA; B; 10
CompB; A; 20
CompB; B; 12
My doubt is about performance between create entries in the same cache appending tenant with key (company + product) and create a new cache for each tenant like:
CacheConfiguration<String, String> cfgCompanyA = new CacheConfiguration<>();
cfgCompanyA.setName("CompanyA");
IgniteCache<String, String> cacheCompanyA = ignite.getOrCreateCache(cfgCompanyA);
CacheConfiguration<String, String> cfgCompanyB = new CacheConfiguration<>();
cfgCompanyB.setName("CompanyB");
IgniteCache<String, String> cacheCompanyB = ignite.getOrCreateCache(cfgCompanyB);
I would recommend to create separate caches per tenant. Performance with these two approach should not be different, but the data will be better isolated from each other which will simplify the code.
It depends on your requirements. I am not an Apache Ignite expert, so I'll address that on a general level.
Arguments for separate caches:
Arguments against separate caches:
A good alternative is to use use a mixture of both:
This allows you to:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With