-
-
Notifications
You must be signed in to change notification settings - Fork 203
Add option to set API in read-only mode #22
Comments
How would this option be set? Is it an API call? a configuration option? |
Good question @danielfrentz.... It can be either a flag in What are your thoughts on this? |
I think it can be applied to both. use the configuration to set it initially and then allow the user to set it via the api. |
I agree that the config makes the most sense, but we should really focus on moving anything that needs to be updated after install to |
Both is going to be confusing.. let’s put it in directus settings. |
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. |
@benhaynes @rijkvanzanten I was about to create a feature request for this, but then I saw there was already an issue for it. I have an odd use case for this feature- we are planning to run Directus 7 with multi-region redundancy on Amazon Aurora MySQL. As of right now, only read-only replicas are supported. Multi-master support is on the way, but it's not something we will want to pursue due to complexity. Since we will be hosting an instance of the API in two different regions for redundancy, we'd like to have the "master" region (with the writeable master database) host a writeable copy of Directus, while have the "slave" region (with the read-only replica) host a read-only copy of Directus. The only way to do this is through a config file setting, and not through the database, since the database contents must match in both the master and the replica. Do you guys have any thoughts? Does my use case make sense? Thank you! |
@computerwizjared This makes total sense 🙂 It also means that |
@rijkvanzanten Wonderful!! For now, we'll continue down our path of upgrading to Directus 7 with multi-region support, regardless of this feature, since our application is read-only anyways. However, it would be awesome to be able to enforce this from the Directus API perspective so that we can be sure no writes will ever hit the replica database. If, in the future, we would need to write to the Directus API, we would put a direct endpoint in our app to that instance in the "master" region. Another possible idea that would work for our use case is to have a database endpoint in the config for a writer database, and another for a reader, so all reads would hit the reader database, and all writes would hit the writer (which would be located in the "master" region). This would probably be an idea for another ticket, though. Let me know if you have any questions about our use case; I'd be happy to answer any. Thank you! |
I really like what you're suggesting here. We've been playing around with hosting Directus multi-tenant on a pretty big scale, and this could help out performance / prevent bottlenecks in a major way as well. @benhaynes 🔔 |
@rijkvanzanten That's sweet. Yeah, we're not hitting any scaling issues in our use case (a basic website CMS), but the redundancy is something we're aiming for in case of an S3/RDS/EC2 outage in our primary region. The latency reduction using Route 53 geo-routing is a nice side benefit too. RDS provides a reader endpoint that load balances among all reader database instances, and a writer endpoint that hits the primary writer database instance, so it would be great to be able to utilize that. |
Ooh, I like that too. In my head I was imagining this setup as two "projects" (different databases), but many people will keep these in sync, so keeping it within the same project also makes sense. 👍 |
To achieve better clarity/visibility, we are now tracking feature requests within the Feature Request project board. This issue being closed does not mean it's not being considered. |
Adding a option to put the API in read-only mode, we lock all actions except reading data from the API.
We can aggressively cache the result as there's not change to be expected.
The text was updated successfully, but these errors were encountered: