Monolithic vs Decoupled Schema


Let us understand what we mean by Monolithic and Decoupled architecture, Schema with an example.

Setting up a library

Let us take example of library. A new library is opening up. It would have many books, may be on various subjects. First task for librarian is, to store the books in library.

Librarian started with obvious approach first, i.e. start putting all books in shelf, one after other. It was quick. She puts all the books quickly in the shelves; and created an index to search any book.  




Benefits:
  • It was quick, easy, and less work. Just one simple storing strategy, every new book will go to next available space.
  • You have all sort of books at one place, which means just keep updating one index for every new book – no need to maintain separate indexes.
  • Readers can find all sort of books at one place for all of their tastes. They need not to go to multiple places. Just iterate over and you will find what you need.
  • For librarian, access management is easy. Anyone having access to library, can access any book easily. Less time spent on management.
  • It is easy for readers to refer any other related book also. For ex: if you reading astronomy book, and need to refer a math book. It might just be somewhere in same row.

All setup done. Things started rolling. All good so far. Eventually library become popular and started getting more readers and requirements for new books. Librarian started ordering more and more books on various subjects.

Challenges:

However, as volume of books increased, Librarian started observing few issues. Like: