简体   繁体   中英

Replace HTTP sessions in Cloud using REDIS cache

We have HTTP sessions in on-premise application. We want to migrate application to Cloud. We got the direction to use REDIS cache implementation in Cloud to replace HTTP sessions.

Do we save user specific(HTTP Session) data in REDIS? Is there any other elegant way to handle this scenario?

Thanks in advance.

Assuming you're talking about a legacy app, you can set Redis (Azure Redis Cache) as your State Provider.

Here's a link about it:

https://docs.microsoft.com/en-us/azure/azure-cache-for-redis/cache-aspnet-session-state-provider

Yes it is possible and Redis is one of the pinpoint solutions for this kind of requirements. It is super fast in-memory key/value store just like sessions(get/set). Most of the modern frameworks come along with built-in session support for Redis. Even it is a legacy app, you may integrate easily(there could some libraries that do that). You may just use commands such as SET , GET , EXPIRE , EXISTS , DEL for a session store.

If it is going to be just string/string you may go with string , if you have some json values you may use hash . Both solutions provide EXPIRE option for you to not store forever and manage your memory.

I am not familiar with Azure side but AWS has ElastiCache service that supports Redis. Another option could be installing one in a EC2 instance for on-prem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM