koen
koen

Reputation: 13737

what patterns allow for object persistance using sql and nosql databases?

With the rise of the nosql movement we see different options for storing objects. Are there object persistence patterns that can handle both sql and nosql backends and allow to easily switch between the two?

Upvotes: 1

Views: 476

Answers (2)

FrenchData
FrenchData

Reputation: 630

In addition to the Repository pattern proposed by cwap, you should also look at the Data Mapper pattern. (Data Mapper). From my understanding, both work together. Repository relies on the Data Mapper when it comes to write or read the object to the database (or other persistance media). It is the data mapper that deals with the specific persistance technology. The Repository on the other hand can remain unchanged even if the repository changes.

Upvotes: 1

cwap
cwap

Reputation: 11277

The Repository-pattern is a well-known and widespread pattern to map you DAL to you domain-layer.

Upvotes: 3

Related Questions