Multitenancy architecture with test and real data
Now we are tasked with making a demo version of our project for potential clients with test data. The frontend is on React and the backend is on Django Rest Framework. The way I see it:
- Users log in to the demo version.
- We send a request (GET) to the backend.
- In the middleware we check the request:
3.1 If it is a demo query, user connects to the sql-lite database with the test data
3.2 Otherwise, we connect to the main database
- If it is PUT, PATCH, DELETE, then we just show a popup that the action has occurred
Do you know of examples of this kind of functionality, or maybe see pitfalls along the way?