[GTPS] Should the Server Fetch from Wikidata Again — or Reuse Data from the Client?

Should the Server Fetch from Wikidata Again — or Reuse Data from the Client?

When the client searches for a game using a keyword, and the game is not found in the internal database, a fallback search is made to Wikidata.
This search returns a list of potential matches with basic metadata like title, platforms, release date, genres, developers, and Wikidata code. Once the client displays these results, the user selects the correct game to add it into the internal database.

A dilemma with this structure

The data displayed from the search should be reused to add the game into the user's list. Then should the search be done again, or the initial data be kept in the client? Both contain some amount of redundancy.

Option 1: Minimal Client-to-Server Payload

  • The client sends back only the Wikidata entity code of the selected game.

  • The server uses that code to re-fetch the detailed data from Wikidata. 

  • The server filters and parses the data again before inserting it into the internal DB.

Option 2: Full Data Transfer from Client to Server

  • The initial Wikidata search already gathers all necessary data.

  • When the user selects a game, the client sends all the relevant metadata to the server.

  • The server directly saves the game without re-querying Wikidata.


The better option

My initial assumption was that Option 1 would be more efficient, since the client sends less data. But after reviewing and testing both approaches, I came to a clear conclusion:

Option 2: Full Data Transfer from Client to Server is better. 

The reasons are:

  1. Avoids Redundant API Calls
    The server avoids re-fetching and re-filtering data it already received from the client.

  2. Wikidata Is a Third-Party API
    Extra calls add latency, increase risk of rate-limiting or failures, and introduce external dependency.

  3. Game Metadata Is Small
    A game's JSON representation with title, genres, and platform is usually under a few KB.
    Sending this over the network is negligible compared to an external API call.

  4. Less Code Duplication
    No need to write or maintain two different sets of parsing logic (one for search results and another for insertion).


What If the Server Is Not Local?

Currently, for testing purpose, the backend and frontend are hosted locally. This gives an advantage to Option 2. So I needed to consider the case where they are hosted remotely.

Even if the client and server are in different environments (e.g., a mobile app talking to a remote AWS-hosted API), sending complete data is still optimal.

HTTP requests between the frontend and backend are:

  • Under my control

  • More reliable

  • Faster than external API requests (Wikidata)

The overhead of sending 2–5 KB of structured JSON is very low, even across the network.


Comments