Comments (10)
Interesting approach! I had not thought of that, but it may be interesting. Especially to prevent the application to stop working in a maintenance reboot of redis.
Although not entirely clear to me, at what level do.
If done more by django, the current implementation has to be modified considerably. And I doubt that these changes would accept the core of django.
Another option, would do on a "django-redis". But other questions go here:
If the redis server falls automatically fallback to db, but when and how I have to decide to return to redis on this goes up? These constants checks can add a significant overhead.
Have a suggestion about this?
It's a very interesting feature, but needs design decisions to implement it well.
from django-redis.
Hello Fellow,
I guess that you got the idea, the cache should operate just like a plus not something that blocks.
And for sure we have some big design decisions here, can you throw to defaults backends inside django-redis when you catch the redis connection exception, in other words you can pass to others backends, in that case django-redis will operate just like a proxy until the Redis Server get up?
We can create some filters system, exemple.. the request number 1 try to use Redis and get bad results then our filter system get that behavior and start to pass directly to the second backend, in order. We can defined some Ratio, to not try to connect in Redis Server for each request, but using that Ratio, for example 1 test for each 30 requests (using counting). When we receive that Redis Server in on so our filter are free.
The question, throwing to other backends that was previously defined inside settings.CACHES is easy? cosidering that these backends are already implemented inside Django..
may it's the first step to think about..
any idea?
Cya!
from django-redis.
Look at this Andrey:
https://code.djangoproject.com/ticket/16006
Cya!
from django-redis.
Okay, I agree that the cache has to be an addon, not something blocking.
I had an idea similar to yours but the concept of the counter was not in my mind.
Another feature I want is to implement master-slave connection and I have to see how to implement this feature you propose.
I do a refactor the code to make the connection to be lazy redis. Among other things. So for a major release (3.0)
I will start working on it one of these days, as have some time.
from django-redis.
Andrey, Are you considering the implementation of that (optional) function system that is called when the system detect that the Redis Server is off?
It's very important i guess because can implement notices to someone (maybe email) about the situation, the implementation of that function should be by the user.
hugs..
from django-redis.
I'm not moving on this issue because of my limited time. Right out while I wear with this.
I mention this so you know I have not been forgotten this feature;)
from django-redis.
Now, experimental fallback switching feature added on branch feature/master-slave: 5ec9658
Among other things, has been refactored all the code and add support for Master-Slave setup.
from django-redis.
Hello Niwibe,
Sorry i'm late,
I tried 5ec9658, but i'm getting:
that error: http://i.imgur.com/ckEok.jpg
You have already plans to merge with main branch?
thank you for your effort!
from django-redis.
Sorry to keep you waiting so long. I was pretty busy with other things.
The error it gives is due to a failure very silly and others are caused by that bad you should have the format of the connection string.
I made ββsmall changes to the last commit. Pass all tests (no shard).
Andrey
from django-redis.
It still implemented with slighty different approach on failover experimental client (now merged to master).
I don't have mucho time for this feature. But all improvements are welcome.
And... Sorry for my very late reply.
from django-redis.
Related Issues (20)
- Connection Pooling doesn't work as intended HOT 1
- Pytest 7.0 compatibility HOT 1
- Drop django 4.0
- Drop support for django 3.2 HOT 1
- How to configure and connect redis cluster correctly? HOT 2
- Django `TIMEOUT` setting not working as expected HOT 2
- Which timezone wil it take? system timezone or django timezone HOT 1
- Why Django Redis does not raise exception while connecting to Redis Server with SSL param equal string "False"
- `Expire` method fails when using `DEFAULT_TIMEOUT` HOT 1
- Getting/Setting occasionally extremely slow HOT 5
- django requirements update
- Add NX, XX, GT and LT to expire and pexpire HOT 2
- Multiple redis caches with fallback mechanism HOT 1
- Is it necessary to get coverage of tests directory? HOT 2
- Implementing HGET
- using redis in django getting connection error HOT 1
- strict_map_key
- Connection refused on Celery health checks HOT 3
- how to support hash ops, such as hset, hget...
- Reauthentication with Azure AD / Entra ID
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-redis.