C
C#•9mo ago
Alex

suggest .net redis library

I get every minute >150 data items about road situation, item has nested structure. I want to use cached data when user make a request to API . First I need to clear pervious data using prefix and after add all items. It would be great if I could use class models for the data. What .net library for Redis can you recommend?
44 Replies
Pobiega
Pobiega•9mo ago
the stackexchange lib. are there any others?
Alex
AlexOP•9mo ago
is it possible to use it with models? In documentation I only found hashset where you adding fields or saving string
Pobiega
Pobiega•9mo ago
redis is a key-value store. If you want to store models, serialize your model to json/protobuf etc before saving/loading it
Alex
AlexOP•9mo ago
I tried to save json using library and it saves it in string format which I can't use to search by field or other operations.
No description
Pobiega
Pobiega•9mo ago
well yeah its redis you don't search by anything but key
Alex
AlexOP•9mo ago
while I want to save it like object
No description
Alex
AlexOP•9mo ago
I want for example search by primary or secondary point or start time
Pobiega
Pobiega•9mo ago
sidenote, what redis UI client is that? looks neat.
Alex
AlexOP•9mo ago
it's redis/redis-stack container I run it in docker
Pobiega
Pobiega•9mo ago
RedisInsight
thanks, I've been looking for a good replacement for RDM looks like what you want is achievable via the JSON.SET method in redis... I think stackexchange supports that. lemme try
Alex
AlexOP•9mo ago
it's Redis.OM library that creates "object like structure", but it's beta version I'm not sure I can use it to delete items by prefix
Unknown User
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
Pobiega
Pobiega•9mo ago
Unknown User
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
Alex
AlexOP•9mo ago
Thank you for the suggestions, I will try both and see which one works out
Unknown User
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
Alex
AlexOP•9mo ago
done, I usually add .gitignore, just was I a hurry that time😀
Unknown User
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
Alex
AlexOP•9mo ago
I have a background worker in backend that make a request to https://tie.digitraffic.fi/api/traffic-message/v1/messages?situationType=ROAD_WORK&includeAreaGeometry=false every minute, after I parse json response to get features (road works), I need to store them in a cache. I also have a react app, there is a map where road works are displayed. As I think first I need to call tie.digitraffic api and get response, after I clean previous roadwork data in redis and save new one
No description
Unknown User
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
Alex
AlexOP•9mo ago
probably I just display some notification in react app that data is missing, if I undestand your question correctly
Unknown User
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
Alex
AlexOP•9mo ago
Idk I was given this task as a course project, and it's actually right now is written in typescript and I'm trying to rewrite in to c#, that the way previous student team implemented it
Unknown User
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
Alex
AlexOP•9mo ago
yes I can override data, I used Redis.OM and it creates key automatically and I couldn't use roadwork id to identify and override the data, that's why I decided maybe it's a good idea to clear the data first and save new
Unknown User
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
Alex
AlexOP•9mo ago
yes, but can I actually filter data using library you named? Not by the key, but other fields, for example startTime or roadNumber? or do I need to get all roadwork values and filter them using LINQ or something else? Probably I probably still missing how the redis works
Unknown User
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
Alex
AlexOP•9mo ago
sure, I'll check it, thank you for the help
Tvde1
Tvde1•8mo ago
I had to learn this the hard way
Unknown User
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
Alex
AlexOP•8mo ago
hi, I know it's off topic here I didn't know where to ask for it, but do you review project code by chance? Just to look at its structure in general
Unknown User
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
Alex
AlexOP•8mo ago
yes I posted there about 3 days ago but nobody answered, guess I should make more condensed description because it looks too hard to understand
Tvde1
Tvde1•8mo ago
lots of timeouts
Unknown User
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
Tvde1
Tvde1•8mo ago
both json and proto application insights says proto deserialisation is taking a lot of cpu/ram yeah I have big values
Unknown User
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
Tvde1
Tvde1•8mo ago
google one
Unknown User
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
Tvde1
Tvde1•8mo ago
No description
Tvde1
Tvde1•8mo ago
some day probably
Unknown User
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
Alex
AlexOP•8mo ago
sure, I understand
Want results from more Discord servers?
Add your server