Should i need to use Caching for Jira Plugin developing Using Spring Boot and React

I am developing jira Plugin using spring boot and React but the performance of Plugin is very slow Because every time Db calls . So i want to use caching But that is not syncing with Db .So any idea which caching i should use or any other help for improving the performance of app.

Is this for server or cloud?

There are several tutorials for caching in Spring Boot on the internet. E.g.: Getting Started | Caching Data with Spring

1 Like

If this is for Server/DC, you might want to use the Atlassian Cache API right?

Well the category says “Jira Cloud” for me. :stuck_out_tongue:

1 Like

Oh crap. I always forget to look at the category :man_facepalming:

1 Like

Thanks for Your Reply
Yes i used spring boot annotations for caching But these all are not syncing up with db.(When i am adding new record to db without restarting that is not coming to cache memory) Any Solution for this.

Thanks for reply…
Yeah its for Cloud what is your view to improve performance of My app How can i make it more fast??

Well, how are you adding new entries to the DB? If you are using your Spring repositories to do so, Spring should usually be smart enough to update/invalidate the cache automatically.

If you are adding entries into the DB manually, then it’s a whole different story. How should Spring know that you edited the database?

Either way, you probably want to look into cache evicting. For example. you could set up a REST endpoint that invalidates your repository caches. You could hit it after manual modifications to the DB, etc.

Be aware that correctly invalidating cache at the right time is not an easy task. Especially if you’re dealing with a distributed system and not just a single Spring Boot server. So for this reason I’d like to leave you with this famous quote:

There are only two hard things in Computer Science: cache invalidation and naming things.
– Phil Karlton

2 Likes

Thanks @sven.schatter for your response
I am inserting data through repository but while using post method i inserted data into db then at same time that data is not reflecting into cache means cache is not in sync with DB. So I think i need to write more methods which helps in updating the cache or something else??

Yes, if you want to build a mechanism that clears the cache, look into the cache evicting link in my earlier answer.