Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add horizontal scaling guide #940

Closed
maxpain opened this issue Oct 30, 2018 · 6 comments
Closed

add horizontal scaling guide #940

maxpain opened this issue Oct 30, 2018 · 6 comments
Labels
c/docs Related to docs k/production Related to production use-cases p/urgent Immediate action required

Comments

@maxpain
Copy link
Contributor

maxpain commented Oct 30, 2018

Hi. I've tried to scale Hasura GraphQL Engine deployed to Kubernetes and got various errors after creating tables:

"error":"table \"users\" does not exist","code":"not-exists"

It seems like Hasura is not stateless and caching data into memory. Maybe we need to use something like Redis for a cache.

@0x777
Copy link
Member

0x777 commented Oct 30, 2018

Hi @Maxpain177 currently modifying schema when you are running several instances of graphql-engine will result in errors like you have seen.

To change schema:

  1. Scale down graphql-engine to 1
  2. Apply all the schema changes
  3. Scale it back to any number

This practice works really well, in development you rarely need to run more than one instance of graphql-engine so you can make changes to the schema, and to deploy the changes to production (which is running many instances of graphql-engine), you'll just need to wrap the hasura migration apply between two kubectl commands.

We'll document this

@0x777 0x777 added the c/docs Related to docs label Oct 30, 2018
@shahidhk
Copy link
Member

We can also use the reload_metadata API call on other instances to sync up the metadata once schema is changed through one of the instances.

If there are 10 instances running, make schema changes through any one of the instance and then call reload metadata action on all other instances.

POST /v1/query

{
  "type": "reload_metadata",
  "args": {}
}

@dsandip
Copy link
Member

dsandip commented Jan 3, 2019

From @coco98 in #1078

Scaling Hasura is as simple as scaling up the number of instances. If the metadata or schema is updated, a rollout (or metadata refresh) should be triggered.
Let's document the process (2 commands basically, but still ;)) for various platforms:
Docker
Heroku
Kubernetes
Fargate
This is an urgent hole in our current docs.

@rikinsk-zz
Copy link

More suggestions at #1183

@rikinsk-zz rikinsk-zz changed the title Horizontal scaling? add horizontal scaling guide Jan 18, 2019
@shahidhk
Copy link
Member

shahidhk commented Feb 8, 2019

When #1574 (PR for #1182) is merged, schema can be updated on any one of the hasura instances and others will refresh the metadata automatically.

@dsandip dsandip added k/production Related to production use-cases p/urgent Immediate action required labels Feb 12, 2019
@dsandip
Copy link
Member

dsandip commented Mar 20, 2019

Closing this in favor of #1183.

@dsandip dsandip closed this as completed Mar 20, 2019
hasura-bot pushed a commit that referenced this issue Aug 7, 2024
Get ready for `v2024.08.07`, update changelog.

V3_GIT_ORIGIN_REV_ID: e79021814eaf65d4153ab4fbbe67572ae97edd14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/docs Related to docs k/production Related to production use-cases p/urgent Immediate action required
Projects
None yet
Development

No branches or pull requests

5 participants