I'm working in an architecture, it is going to offer a rest api for web client and mobile apps. I'm using Spring(spring mvc, spring data jpa, ...etc). The domain model is coded with JPA specification. I'm trying to apply some concepts of clean architecture (https://8thlight.com/blog/uncle-bob/2012/08/13/the-clean-architecture.html). Not all, because I'm going to keep the jpa domain model.The actual flow through the layers is this:Front end <--> API Service -> Service -> Repository -> DBFront end: web client, mobile appsAPI Service: Rest Controllers, here I use converters and dto's and call servicesService: Interfaces with implementations and they contain business logicRepository: Repository interfaces with automatically implementations(done by spring data jpa) which contatin CRUD operations and maybe some sql queriesMy doubt: Should I use an extra layer between service and repository?I'm planning this new flow:Front end <--> API Service -> Service -> Persistence -> Repository -> DBWhy to use this persistence layer? As it says in the clean architecture article I would like to have a service implementation(business logic or use case) that access an agnostic persistence layer. And not changes will be needed if I decide to use another data access pattern, for example if I decide to stop using repository.class ProductServiceImpl implements ProductService {    ProductRepository productRepository;    void save(Product product) {        // do business logic        productRepository.save(product)    }}So I'm thinking use a persistence layer like this:class ProductServiceImpl implements ProductService {    ProductPersistence productPersistence;    void save(Product product) {        // do business logic        productPersistence.save(product)    }}and implementation of the persistence layer like this:class ProductPersistenceImpl implements ProductPersistence {    ProductRepository productRepository;    void save(Product product) {        productRepository.save(product)    }}So I only need to change the implementations of persistence layer, left the service without changes.Coupled with the fact that the Repository is related with the framework.What do you think? Thanks.
Should I use a layer between service and repository for a clean architecture - Spring
architecture;persistence;services