Closed sebitsi closed 3 years ago
If indentity server is in separate service, we must install redis. Is this correct ?
Yes, redis can help to share data between IDS4 and your host.
@hitaspdotnet and @gdlcf88 Thanks for answeres.
Yes, redis can help to share data between IDS4 and your host.
How is this "sharing" related to ABP or maybe ASP.NET Core ? I mean, is this ABP or ASP.NET core feature ?
Is this redis cache basicaly very fast service for setting and getting key-value pairs ?
I don't know more, maybe you can start looking for answers here: https://github.com/abpframework/abp/issues/2224#issuecomment-557024682
Thanks @gdlcf88. There is no much info on this question.
I hope @hikalkan can write some documentation what is important when using ABP with redis. Or point me to one if there is any.
I found ASP core documentation about implementing redis cache.
There is a link to chocolately windows instalation which is 4 years old.
What version do you recoment using on windows ?
@sebitsi Redis is also important if you have clustered environment and you use SignalR (since SignalR Core have currently no backplane option for MSSQL).
Thanks @leonkosak.
For start i just want to collect needed data for implementing identity server as standalone service. SignalR is not in first plan. Luckily. ;)
I'm preparing to upgrade my zero projects to abp.io. It is not so easy as i expect.
It's not only about code. We must look ahead what we can and can not do in production environment.
So any additonal info is desirable.
Hello @sebitsi, Redis is volatile but can be persistent on disk to prevent data loss. Meaning; in-memory db, stored in RAM hence very very fast.
It is used for caching purpose mostly. You don't need an extra server in monolithic apps since you can use in-memory cache already which lives in your application life cycle (memcache).
But in distributed systems when you need to cache some data instead of making thousands of http requests, you need an extra server for that.
One of the use cases in ABP is for caching permissions where you need to check if the requesting token (user) has the permission of the requested resource.
I see you hate installing extra stuff to your windows like me :) Use docker for windows! Works like a charm.
Afterwards you only need to run the command docker run --nameredis-container -p 6379:6379 -d redis
and change the redis connection string in your appsettings to localhost:6379
.
Not to mention you can use mongodb, postgres etc on containers without installing aswell.
Hope this info helps.
@gterdem Thanks for your explanation and clarification. Yes it helps.
You put together all my knowledge and confirm it. ;)
Of course, I could use docker for installing redis. But i have limitations on production server. This is first point. Second is: I need to monitoring it, updating it. So mantaining it. ;(
Some more questions:
Identity server is central point for checking credetials, generating tokenc, etc. Right ? It wouldn't by nice if identity server has a cache for caching all that requests ? Yes maybe this is not good enought for extra large systems. But for small to middle.. ? It Will bi simpler to deploy, maintain and less compex.
How redis fits in permission checkig flow ? I mean: who store permissions into redis ? Identity server or micro service ? How long this key stays in cache ?
Have you some information about redis integration implementation in code ? I mean: Is this bassicaly ASP.NET Core code extendet with ABP or pure ABP ?
Thanks for advance.
Edvin
I advice you create normal asp.net core website do tests on redis and once you make a decision to use redis, you can enable it.
Otherwise you can disable it in abp, its and optional. Sounds like you want someone to prove to you why use redis yet its optional and depends with what you are doing in your project.
@dicksonkimeu
I want to use indetity service as separate service. I just want to get big picture how redis is integrated into ABP. How and when should i use it. I need to advice admins on customer's production environment why we need redis, how to configure and maintain it, etc
In ABP docs there is only one sentence. Redis is required. And this is it.
I hope, guys in ABP are goint to make some docs about it.
Its not how redis is integrated to ABP. Nothing special on ABP. Its about redis and asp.net core.
Create a asp.net core project (without abp) and test how redis works.
@dicksonkimeu
Ok. Thanks. I know nothing about redis. Where i can start ? What do you suggest ?
Nothing special on ABP.
Maybe. But they create template which requires redis. So i expect they explain how they use it and why.
@gterdem Thanks for your explanation and clarification. Yes it helps.
You put together all my knowledge and confirm it. ;)
Of course, I could use docker for installing redis. But i have limitations on production server. This is first point. Second is: I need to monitoring it, updating it. So mantaining it. ;(
Some more questions:
- You wrote that redis is used for caching permissions ....
Identity server is central point for checking credetials, generating tokenc, etc. Right ? It wouldn't by nice if identity server has a cache for caching all that requests ? Yes maybe this is not good enought for extra large systems. But for small to middle.. ? It Will bi simpler to deploy, maintain and less compex.
- How redis fits in permission checkig flow ? I mean: who store permissions into redis ? Identity server or micro service ? How long this key stays in cache ?
- Have you some information about redis integration implementation in code ? I mean: Is this bassicaly ASP.NET Core code extendet with ABP or pure ABP ?
Thanks for advance.
Edvin
With signalR how can I use redis to share connection between multiple instance. I have read this document. But I don't know how to implement it with abp.io https://docs.microsoft.com/en-us/aspnet/core/signalr/scale?view=aspnetcore-3.1
I am very appreciate if someone explain them.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Redis (REmote DIctionary Server). This open-source application provides in-memory caching. It is known for its high-performance capabilities.
It’s very fast for reading/writing data. That’s why we use Redis for distributed cache in the following projects
You only need to install Redis for the n-tier
architecture where Web and HTTP API layers are physically separated. If you work on an n-layered
solution with no HTTP API project, then you don't need Redis.
You can see in which cases Redis is pre-required from the documentation page: docs.abp.io/en/abp/latest/Getting-Started-Setup-Environment?UI=MVC&DB=EF&Tiered=Yes
When you see the IDistributedCache
interface, it means Redis is required by default. The following modules are already using Redis (some modules are commercial modules):
SettingManagementStore
for setting values.PermissionStore
for granted permissions.TenantDeletedHandler
and TenantStore classUrlShortingPublicAppService
class for Shortened URL CachesFileDescriptorAppService
class for the Download Token Cache.DynamicTemplateDefinitionStore
class GdprRequestAppService
class for Download Token Cache.Finally, I want you to know that you can replace Redis with any other caching provider like Memcached.
Also see https://docs.abp.io/en/abp/latest/Deployment/Clustered-Environment#switching-to-a-distributed-cache
Basic answer:
Hi.
In documentation Redis is noted as pre-requirement.
If we use identity server included inside httpapihost project redis is not needed. If indentity server is in separate service, we must install redis. Is this correct ?
Why is that ? Can you explain a little more. Can we avoid to install redis ?
As ABP Framework is .NET core based, it is cross platform deployable. Redis is linux. Right ? This is not convenient for windows "users" as myself. Can you give us some support/docks/links about redis. I mean - some links to docs about how to ?
Please don't give me link to redis official site. There is a lot of informations. For begginer like me, i don't know where to start.
Thanks for advance.
Edvin