Hi all, I am learning Data structures and Algorithms for sometime now. I work in a small web development company and we do all our data related operations directly in the database like searching, insertion, deletion etc. So when it comes to practically visualizing implementation of data structures I get confused. If you can clarify them for me I will be very thankful. I know data structures are ways to organize data so we can sort, insert or delete items faster than done otherwise. And they are abstract structures unlike databases.
But to organize data we need to get it first. So for instance, every time a web page need to display a list of employees, it fetches data from database, use a data structure to organize data and then displays it. But wouldn't it make system/server perform poorly as it will be doing the same thing for every client request?
Secondly, where is the data stored? Why it is being used in a data structures? Is it system memory? If Yes, then what if the data is huge like millions of records. How can we store so much data in memory when other applications also need resources.
If all the employee data is stored in the database and I need to find a single record, isn't searching in the database is better than loading all of it into a data structure and then trying to find it.
Thanks to all for their input.