mercredi 24 février 2016

Good approch to design project that uses different type of Databases in single project

Suppose that my project uses 3 different databases MySql, Redis, Cassandra. I want to generalized my design so that

  1. It will return respective database client based on input type at run time (similar to factory design pattern)

  2. 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