Thanks @sur for reply.....
Yes you understood correctly my issue, and I even understood your 
solution....
let me cross check your solution and will update here.


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


On Sunday, November 3, 2013 1:46:20 AM UTC+5:30, Fahim Patel wrote:
>
> Hi All ,
>
> Can we validate request input data using memcache ? Actually I am facing 
> scenario in which user uploading CSV file which can have hundreds of rows 
> and to validate each row using ActiveRecord taking long time.
>
> I have below question:-
>
> 1. So can we cache our validation rule in memcache ?
> 2. If it is possible to store validation rules in memcache but can I able 
> to perform
> validation check ?
>

-- 
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/ca08152d-bd1d-4cc9-b647-4c7cc5d2e5aa%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to