Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Which sorting is better, Code Level Vs Database level?

 
Bhairava Surya
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have one basic query, which sorting is better whether code level sorting or database(sql) level sorting?

Thanks & Regards,
 
fred rosenberger
lowercase baba
Bartender
Posts: 12198
35
Chrome Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
almost every 'what is better...' question in software is answered with "it depends". what do you mean by "better" - speed? memory usage? simplicity to code/develop? cost?

Is the data already IN a database?

There are too many variables to give a blanket answer that will ALWAYS be true.
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fred is right.

It also depends on your overall architecture. If you have a giant, fast, DBMS server and fairly lightweight applications talking to it, it may be faster to use the DBMS to do the sort.

And it depends on how many things you are sorting.

Other than a fun topic to argue over beers, you need a lot more specifics to get any useful information or guidance.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic