Use of JPA in Persistence Example – Potential Anti-Pattern in Actor-Based Systems?
Hi,
First of all, thanks for the great work on spring-boot-starter-actor!
I was reviewing the persistence example provided in the documentation, and I noticed that it uses JPA for database access. Since JPA operations are typically blocking, I’m wondering if this might be considered an anti-pattern in the context of actor-based systems. Actors are designed to be lightweight and non-blocking, and blocking the actor thread (e.g., via a JPA repository call) could lead to performance issues or thread starvation under load. In contrast, libraries like Slick (which Pekko use) offer non-blocking, asynchronous database access, which seems more aligned with the actor model.
My question is:
Is the use of JPA in the example intentional for simplicity? Or is there a plan to add support for non-blocking persistence, such as using Slick or another reactive alternative? Would you consider updating the example or adding a note about the potential implications of using blocking persistence in actors?
Thanks again for your work and looking forward to hear your thoughts!