mercredi 7 juin 2023

Dynamically changing schema of DB at runtime

We are onboarding Distributed tracing in our service. For that we want to add traceId column in Dynamo DBs for which streams are enabled. Other DBs which do not have DDB streams enabled should remain same as before. In future we might also get a usecase wherein we need to switch on the DDB streams in an existing DDB and that would require adding traceId in that DB as well.

I wanted suggestions on a design that would ease switching between DDB schema with trace and without trace dynamically at runtime without requiring us to add/remove obj.setTrace(someTrace) statements every time we switch

I tried the design but the problem is that DBOperations expects a generic class (Eg: method void save(T object)) and we cannot setTraceId() in a generic class

Aucun commentaire:

Enregistrer un commentaire