I have recently come across the idea of persistence ignorance, the idea that your domain model should be ignorant of the persistence layer of the application, and that got me thinking.
I have been doing my best to keep different parts of the application loosely coupled, wrapping things like the ORM in interfaces so that I could (relatively) easily swap them out if needed. However, I did find aspects of the ORM and, even more so, the underlying database leaking through into my domain model, forcing me to restructure my data model to fit into and within the limits of the database.
So I was thinking of adding a persistence data model that would be specifically for dealing with the ORM and would directly map to database tables and relationships. Then, when reading data, map from that data model to the domain model, and when writing data, map from the domain model back to the persistence data model. (Currently working in .NET so I can use the wonderful AutoMapper for converting from one type to the other).
Is something like this common practice? Is it worth the extra maintenance overhead when making changes to the domain model? Could this be considered an anti-pattern?