Hacker News new | past | comments | ask | show | jobs | submit login

cgh, I've hit the reply limit, but I wanted to ask how you'd implement the cascade deletes thing over services? Would the People service have to emit events describing that a person was deleted that the Address and Billing services would be expected to subscribe to in order to handle that the person was deleted?



Sorry, I should have been more clear. I'm assuming a shared database. So cascading deletes would be defined in the table's schema. Let's pretend we're using Postgresql:

\d Person

[A bunch of table schema stuff]

Referenced by:

TABLE "Billing" CONSTRAINT "billing_id_fk" FOREIGN KEY (id) REFERENCES Person(id) ON DELETE CASCADE

(I typed that off the type of my head so it might not be quite correct.)


The original position being argued though was "... where all services talk to the same database... You need to split the database up and denormalize it.".

So the basic premise is that there is no shared database, and thus having the database enforce cascading deletes is not an option.


Right, thanks for the clarification. Sorry for the slight derailment.


Yeah, events. Which are message queues for most things, api calls if it really needs to be done synchronously




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: