Suppose that my project uses 3 different databases MySql, Redis, Cassandra. I want to generalized my design so that
-
It will return respective database client based on input type at run time (similar to factory design pattern)
-
In Future, i can easily add or replace DB without much code changes
Something like this, suppose at run time if i want to read/update mysql db my design should return mysql db connection form connection pool, now i want to do same for Redis so based on input it should return Redis connection from connection pool.
Can any one please suggest me the best approach that i should follow to design my project?
Aucun commentaire:
Enregistrer un commentaire