How do you delete an entity in lagom?

Hi,

How do you delete an entity in lagom? and by delete, i mean for the purpose of freeing up disk space by deleting events, snapshots, and all other data associated to that entity within that microservice?

Thanks,
Franz

@franz you need to delete it from the database. Message and snapshot table delete by entiity id. Make sure that entity with that entity id is passivated in Lagom.

Thanks @aklikic. Is it a safe operation that the microservice itself can do? Or does the microservice need to be down first before manually deleting the entry in the database?

@franz if you can afford stopping it then this is, for sure, the most reliable. But again if you delete it in runtime and entity is not passivated you can always restart the service.

1 Like