I am learning more about NoSQL and specifically DynamoDB. I recently asked this question: Mapping database structure from SQL Server to DynamoDB
In the comments under the accepted answer; the answers refers to a Service Bus and a Combo repository.
Q1) Is this a Service Bus? (see EventListener class): http://enterprisecraftsmanship.com/2015/05/06/combining-sql-server-and-mongodb-using-nhibernate/
Q2) What is a Combo repository? Is it a "Combination" repository i.e. some methods interface with multiple databases (SQL Server and DynamoDB).
I would usually ask the answerer, however we started to divert from the original post in the other question - the answerer mentioned this. Therefore I have decided to ask another question.
Good idea. It sounds like you are going down the path of Command Query Responsibility Segregation(CQRS). NoSql databases make for excellent read stores.
The link you referenced describes a technique to update Combining SQL Server and MongoDB using NHibernate - this is what I meant by 'Combo' (combining) Repository. "Combo Repository" isn't a standard pattern. Quoting the author:
You've tagged your original question with both a
Sql-Server
and aNoSql
database, so at a guess you're in the Polyglot spaceThe Repository Pattern is a very common abstraction layer around data persistence.
The "combining" link you've referenced specifically solves the problem of many-to-many relationships (often referred to as Junction tables in Sql), and the performance implications when there are many such relations.
In the more general sense, as an alternative to providing interception points in NHibernate, you may / may not have abstracted data access via the repository pattern.
Here's an ultra simple (and non-generic) repository interface in C#:
Suppose we already have a SqlRepository:
You could also choose to provide a
MongoDb
implementationAnd to maintain both databases simultaneously, here's an example of how this "combo" repository may look:
The above "combo" repository may well fulfil the needs of a single system (and there are many other ways to keep two databases synchronized).
CQRS is however frequently used at enterprise scale (i.e. where you have many systems, with many databases).
My comment about an Enterprise Service Bus will only make sense if you need to distribute data across an enterprise.
The concept is simple
Widget
system then publishes (broadcasts) a message to the bus detailing that a new widget has been added (with all the relevant widget information)Read Store
representations of the Widgets (e.g. into a NoSql database or cache, and in the format which makes most sense to them).Widget
system itself.