menu
up-caret
down-caret

Apollo

A community of developers, designers and others who love Apollo and GraphQL. 馃殌

# General

General Apollo GraphQL discussions.

Trending conversations
馃憢 Welcome to the Apollo community!
@hwillson3d
What's up with the docs?
@boris-da-web-dev23d
How to use refresh tokens? Looking for a complete guide or repo for Apollo鈥
@stupid-sexy-jake8h
How do you guys handle authentication?
@lewix31d
We will be getting a new API for apollo-react using hooks soon?
@travers18d

Hi team, we are using apollo for our project and our main goal is to normalise the data from various REST APIs. Right now we are running a multi threaded application in a scheduled manner which will dump the data periodically into the database. Is there any way to achieve this using apollo ?

Apollo/General路 February 19, 2019 at 6:22am

Hi team, we are using apollo for our project and our main goal is to normalise the data from various REST APIs. Right now we are running a multi threaded application in a scheduled manner which will dump the data periodically into the database. Is there any way to achieve this using apollo ?

February 19, 2019 at 6:22am

February 19, 2019 at 6:29am

This is both a GraphQL question (how to bring together multiple data sources into single types) and an apollo question.

As for how to do this in Apollo. look at Apollo Server's datasources here: https://www.apollographql.com/docs/apollo-server/features/data-sources.html

  • reply
  • like

Yeah i was referring this doc. But the problem is we have our service running on multiple hosts as containers. We need to make sure that threads fetch unique data rather than every thread fetching the same. A communication needs to be setup for them to be syncronized.

  • reply
  • like

I'm a little bit confused. Are you migrating data to a new database? GraphQL is not concerned with how your data is stored. If you already have data available at various endpoints, just resolve those endpoints.

  • reply
  • like

The issue is that we have 5 servers. Each one of them runs the same application server and each has the multi thread node app running in a separate port. Now all the 5 updaters get the same data and dumps it into the database which is very inefficient right ? I wanted to know if the apollo rest datasource has a solution for this.

  • reply
  • like

Each updater should fetch some other data from the others which will solve my problem.

  • reply
  • like