I`m implementing an external core service pattern, but it`s too costly to do a full sync of the client's database. The task is to list and search for Clients. What should I do?
a). Implement lazy load.
b). Sync only mostly used data. Use summary cache pattern.
c). Don`t sync data and make requests directly to the client`s database.
In this case I would think the answer is (b).
Keeping in mind that the task at hand is to List and Search for Clients. If we go by elimination:
(a) Lazy Load Pattern: This pattern is generally more oriented towards the details of individual records, so it doesn't necessarily address the core task at hand.
(c) Don`t sync data and make requests directly to the client`s database: This could be viable for certain databases or APIs that allow that functionality, but it's not something you can safely assume based on the generic wording of the question. Some (most?) APIs/SDKs/DB connections might not be flexible enough to support that functionality, so in general terms this is something you cannot take for granted. You also have to factor in NFRs that might be impacted by the latency of a direct query which might make this non-viable even if the API/SDK/DB connection supports it.
That leaves us with (b), and it makes sense if you think about it. With the summary cache pattern, you can expect to have enough data stored in the OutSystems DB for you to provide the user the flexibility to list and search, without relying on the external API/SDK/DB connection supporting that functionality, and without being subjected to potential latency issues of a direct query. The question only states that it's too costly to do a full sync of the database, but it doesn't say anything about a partial sync (only the most commonly used attributes/columns), so I think you can safely assume that this option is viable.
Hopefully that helps!
Yep, I agree with you!
Since the task is to list and search for clients, I would go with option C
That was a question from the Tech Lead exam. And I answered C, not sure if it`s correct or not. In the OutSystems prep video, they described a pretty similar situation and mentioned something close to "B". So now I don`t know what they treat as a correct answer to that test question.
Hi
Volodymyr Tkachenko,
Ans: b)
You can't do the full sync. So, we can use summary cache pattern. Cache only frequently used data. Search should happen first in cache data and if its not available then it can be searched directly in external systems. This is idea of summary cache pattern.
Hope this help
Thanks
true actionflagment orted tasksetup