Search⌘ K

Responsibilities of a Persistence Adapter

Explore the responsibilities of a persistence adapter, including receiving input through a port, mapping data formats for the database, and returning results in application core format. Understand how this role supports isolation and flexibility in Hexagonal Architecture.

Persistence adapter

This is what a persistence adapter usually does:

  1. Takes input
  2. Maps input into database format
  3. Sends input to the database
  4. Maps database output into application format
  5. Returns output

Take input

The persistence adapter takes input through a port interface. The input model may be a domain entity or an object dedicated to a specific database operation, as specified by the interface.

Map input into database format, and send input to the database

...