> Thanks @tamouse for  reply.
> Actually my table consist more than 15 columns and each column have lots
> of validation like presence validation,format validation.
> Major issue is user will upload CSV file which can consist hundred's of
> rows.Through active record validating each row consuming lots of time.
>
> That's why I am thinking to move validation rule to cache level. It will
> fast process.
>
>
If I understood you correctly,

Validation rule resides inside a Ruby class i.e. a class inheriting
ActiveRecord::Base, which is already there in memory to even be functional.
It doesn't make any other sense to cache this class (or rules inside the
class). Further, Rails automatically caches all the classes in production
environment. Do you correctly understand this ?

In short, your say "I am thinking to move validation rule to cache level"
itself is incorrect because the validation is already in memory and is
already cached, you can not speed it up further by saying you want to cache
it.

And for processing millions of rows with 15 columns each row, by any chance
it surely is going to be a slow procedure even with memcached (unless you
want to put a super computer in place for this task)... and the practical
solution is to move this to background job.

or, I didn't understand you at all.


regards,
Sur
crimson9.com

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAL79NE6oidHcdk7QLxe0UVFPNN-DpL44oCuccJQvQXtRvUyuNw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to