Pipeline to Search 130k Records in Another App and Create if the Record Does Not Yet Exist
I'm trying to optimize my pipeline and I'm having trouble deciding on the best way.
I have 2 apps in the same realm. App "A" has approx. 30k records, and app "B" has approx. 130k records. When a new record is created in the Clients table of App A, I'm searching the Clients table in App B to make sure it doesn't already exist using the unique identifier of Login ID.
My problem is, the pipeline takes SO long searching through 130,000 records to see if the Login ID already exists in App B. If the Login ID does not already exist, I'm having the pipeline create a new client record, and if it does exist, do nothing.
I know this isn't best practice and I'm sure there is a Jinja reference that I can use to speed this up but I'm a rookie when it comes to jinja. Can anyone offer assistance? Thanks in advance!