Class design to split DB READ and WRITE
I am about to design for DB connection handling. I want to split read and
write assuming they could be different slave and master DB host.
I have an idea now. I don't want developers to worry about creating WRITE
DB connection. So I want my design or my DB class to auto-detect the
writes, checking "UPDATE" or "INSERT" keyword for example and create the
write DB connection internally (in the DB CLASS).
So the developer won't even know about the split. So default DB connection
for developers to create is just one.
I don't know my approach is good or bad. Idea?
No comments:
Post a Comment