vendredi 14 septembre 2018

Design Pattern for database connection

Recently, I had an interview with cognizant. During the interview they asked me write a singleton design pattern, Which I did. After that they asked me 'ok, now tell us where you can use singleton ? ' I said 'to manage database connection'.

They were not satisfied with my answer and they asked ' ok, so can you manage 1 million users accessing your database with singleton pattern?' and I was speechless cause I didn't know the answer.

I want to know which design pattern is best for database connection? if i have to mange more than 10000 user connections to my database how can i do that?

I would really appreciate if you guys can help me with this topic.

Thank you

Aucun commentaire:

Enregistrer un commentaire