#Database Transactions & API Calls: Exploring Options
1 messages · Page 1 of 1 (latest)
Hello @lament nexus , I understand your concern about potential database contention when integrating external API calls within transactions. To address this, we can explore alternative strategies like background jobs, or even Kafka for asynchronous processing. However, it's crucial to gauge the level of importance you place on real-time consistency between your database and Permify to choose the best-fit solution for your specific needs.
IIUC you would advise going for this implementation
db.Create(docs) // could be a transaction without call to permify
permify.WriteRelationships(...)
Then the background jobs would consolidate permify DB in case the program crashed between db.Create and permify.WriteRelationships(...)
Am I understanding it correctly?