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 Kopanas john-Iau1QiYlxLpBDgjK7y7TUQ@public.gmane.org Blog: http://www.kopanas.com Conference: http://www.cusec.net Twits: http://www.twitter.com/kopanas --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
John Kopanas 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 Kopanas > john-Iau1QiYlxLpBDgjK7y7TUQ@public.gmane.org > > Blog: http://www.kopanas.com > Conference: http://www.cusec.net > Twits: http://www.twitter.com/kopanasI 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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---