Skip to content

Added Redis Caching for Authorization Services#34

Open
KaltrinaKrasniqi wants to merge 1 commit into
mainfrom
cache_implementation
Open

Added Redis Caching for Authorization Services#34
KaltrinaKrasniqi wants to merge 1 commit into
mainfrom
cache_implementation

Conversation

@KaltrinaKrasniqi
Copy link
Copy Markdown
Collaborator

Authorization data such as permissions and roles rarely change but are queried frequently on every request especially for access control. Caching them in Redis will:
-Reduce load on the database
-Speed up authorization checks
-Improve overall response time

Specifically, the following services are now cache-enabled:
-TenantPermissionService
-RolePermissionService
-RoleService
-UserRoleService

In order to use Spring’s @Cacheable and @CacheEvict annotations which work on method level, we must override Base methods in the concrete service classes and annotate them appropriately.

INSTRUCTIONS:
Redis is required for the cache to work locally. So all of the group members should:
Install Docker Desktop: Install the first option

Start Redis container:
docker run -d --name redis-server -p 6379:6379 redis
Verify it's running:
docker ps

OTHERWISE will get exceptions on startup or during endpoint calls which uses cache.

Copy link
Copy Markdown
Collaborator

@mirgetagashi mirgetagashi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

Copy link
Copy Markdown
Collaborator

@erzagashi11 erzagashi11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants