Win a copy of Microservices in Action this week in the Web Services forum!

Amin Saberi

Greenhorn
+ Follow
since Nov 21, 2018
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Amin Saberi

Daniel Demesmaecker wrote:

Amin Saberi wrote:
My question is what is the best practice to design these kind of custom APIs? I need to implement it as efficient & fast as possible


lol... My guess is that efficient & fast and this design shouldn't be in the same sentence, it makes no sence to me why you would want to create something like this.
It will give you tons of records you don't need. Let's say you want everyone who's firstname is george and you search for like %george% in all your columns.
In you're db you have 10.000 people who live in Georgetown. Do you really wan't your db to return thoose values?



This is the requirement by the management. In fact the number of employees is 250,000. Eventually I pushed the target table to oracle in memory. So right now we are in a good shape. we get the result set in less 400 milliseconds.
1 week ago
I need to design a rest API for looking up employees. The input would be a single string for multiple values (firstName, LastName, locations, etc.). The tricky part is we are not gonna create individual search field for each search criteria like one for field for FirstName, one for lastName and so on. All 7 search criteria will be entered in a single String.

For example, if the enter George, we should get all the employees whose first name is George. Basically we should spontaneously look up each word entered by user in database in all 7 columns(first name, last name, location, role, etc) and return the result set to UI. So If enter George Virginia, we should look up George in all 7 columns and also Virginia in all 7 columns in database and return the result set. It's exactly like the way that Google search box works! Again we have 7 search criteria and I need to apply the same logic for all search criteria.

The stack of technologies is Spring 5, JDBCTemplate and oracle.

My question is what is the best practice to design these kind of custom APIs? I need to implement it as efficient & fast as possible
3 weeks ago