Efficiently Deleting An Account

The un-fun part of creating an app is making a way to delete a user’s
account. Are people using :dependent or do people find it inefficient
and
that it create way too many locks? I am using exclusively :dependent =>
:destroy and it could take up to a minute to delete a user and I get a
bunch
of DB lock problems. What are other people doing? Does it make sense
that
I am getting these problems? Deleting even sometimes takes down my
server… argh…
I appreciate everyone’s feedback.


John K.
[email protected]

Blog: http://www.kopanas.com
Conference: http://www.cusec.net
Twits: http://www.twitter.com/kopanas

John K. wrote:

The un-fun part of creating an app is making a way to delete a user’s
account. Are people using :dependent or do people find it inefficient
and
that it create way too many locks? I am using exclusively :dependent =>
:destroy and it could take up to a minute to delete a user and I get a
bunch
of DB lock problems. What are other people doing? Does it make sense
that
I am getting these problems? Deleting even sometimes takes down my
server… argh…
I appreciate everyone’s feedback.


John K.
[email protected]

Blog: http://www.kopanas.com
Conference: http://www.cusec.net
Twits: http://www.twitter.com/kopanas

I am also using dependent => :destroy to delete a user and all their
corresponding stuff, but I have never gotten a lock or crashed the
server. My guess is that there might be other issues? Wish I could help
more, but for me I have had no problems in terms of locks etc. How many
hits are you getting on your app per day. The reason that I ask is that
my app is just going into large scale use this past month and I am
wondering if this might be a problem that I might encounter down the
road? Good luck,

-S

In most cases we avoid deleting at all.
We just set a flag like “active” to false.

It’s just too dangerous to get inconsistent data.
You would have to make sure, all data related to
the user gets deleted. That’s not so difficult, depending
on you project you can make this with :dependent => :destroy
or manually. (If it takes down the server I guess you have
defined something wrong)

But in most cases you don’t want to destroy this data.
You can’t destroy old orders for example, since this
would kill all statistics you may want to create.
And you would end up with having money (paid for those orders)
without knowing where it comes from.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs