title: Is a good idea do processing of a large amount of data directly on database?
body: <p>I have a database with a lot of web pages stored.</p>
  
  <p>I will need to process all the data I have so I have two options: recover the data to the program or process directly in database with some functions I will create.</p>
  
  <p>What I want to know is:</p>
  
  <ul>
  <li>do some processing in the database, and not in the application is a good
  idea?</li>
  <li>when this is  recommended and when not?  </li>
  <li>are there pros and cons?  </li>
  <li>is possible to extend the language to new features (external APIs/libraries)?  </li>
  </ul>
  
  <p>I tried retrieving the content to application (worked), but was to slow and dirty. My 
  preoccupation was that can't do in the database what can I do in Java, but I don't know if this is true.</p>
  
  <p><strong>ONLY a example:</strong> I have a table called <code>Token</code>. At the moment, it has 180,000 rows, but this will increase to over 10 million rows. I need to do some processing to know if a word between two token classified as `Proper Name´ is part of name or not.</p>
  
  <p>I will need to process all the data. In this case, doing directly on database is better than retrieving to application?</p>