C
C#•3mo 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•3mo ago
the stackexchange lib. are there any others?
Alex
Alex•3mo ago
is it possible to use it with models? In documentation I only found hashset where you adding fields or saving string
Pobiega
Pobiega•3mo 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
Alex•3mo 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•3mo ago
well yeah its redis you don't search by anything but key
Alex
Alex•3mo ago
while I want to save it like object
No description
Alex
Alex•3mo ago
I want for example search by primary or secondary point or start time
Pobiega
Pobiega•3mo ago
sidenote, what redis UI client is that? looks neat.
Alex
Alex•3mo ago
it's redis/redis-stack container I run it in docker
Pobiega
Pobiega•3mo 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
Alex•3mo 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•3mo ago
Message Not Public
Sign In & Join Server To View
Pobiega
Pobiega•3mo ago
Unknown User
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Alex
Alex•3mo ago
Thank you for the suggestions, I will try both and see which one works out
Unknown User
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Alex
Alex•3mo ago
done, I usually add .gitignore, just was I a hurry that time😀
Unknown User
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Alex
Alex•3mo 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•3mo ago
Message Not Public
Sign In & Join Server To View
Alex
Alex•3mo ago
probably I just display some notification in react app that data is missing, if I undestand your question correctly
Unknown User
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Alex
Alex•3mo 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•3mo ago
Message Not Public
Sign In & Join Server To View
Alex
Alex•3mo 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•3mo ago
Message Not Public
Sign In & Join Server To View
Alex
Alex•3mo 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•3mo ago
Message Not Public
Sign In & Join Server To View
Alex
Alex•3mo ago
sure, I'll check it, thank you for the help
Tvde1
Tvde1•2mo ago
I had to learn this the hard way
Unknown User
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
Alex
Alex•2mo 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•2mo ago
Message Not Public
Sign In & Join Server To View
Alex
Alex•2mo 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•2mo ago
lots of timeouts
Unknown User
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
Tvde1
Tvde1•2mo 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•2mo ago
Message Not Public
Sign In & Join Server To View
Tvde1
Tvde1•2mo ago
google one
Unknown User
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
Tvde1
Tvde1•2mo ago
No description
Tvde1
Tvde1•2mo ago
some day probably
Unknown User
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
Alex
Alex•2mo ago
sure, I understand