New Regions and Improved Performance ๐ŸŒŽ


#1

At Graphcool, we continuously invest in new features such as our powerful permission system or the integration of serverless functions. However, weโ€™re also committed to making sure that we are delivering the best possible performance for our customers!

We have a lot of performance improvements planned for the next couple of months. Today, we are happy to announce two recent changes to our infrastructure that will be a first step in that direction and significantly improve the response times for your apps.

https://www.graph.cool/docs/blog/introducing-regions-and-better-performance-she7yaab6l/


#2

How can I tell which region my project is in? Iโ€™m assuming that since it was created prior to the new regions, it is in the EU region, but I donโ€™t see that information anywhere in the console.

Is there any way to move an existing project to a different region?


#3

Right now there is no way in the UI to tell the region a project is hosted in, but I created this feature request, thanks for bringing this up! :slightly_smiling_face:

You cannot migrate the complete project from one region to another, however you can โ€œrecreateโ€ the project in another region. These are the required steps:

  • Create a new project in the Console and select the desired region:

  • If your original projects has enums, you need to manually create them first in the Console enum editor:

  • Then you can copy paste the schema from the original project to the schema-editor of the project in the new region:

  • If you want to migrate data between the two projects, thatโ€™s best done using a script. You can adapt the script from this article, for example.

Hope that helps :raised_hands:


#4

What about permissions and functions? Is there a simple way to migrate those?


#5

What about permissions and functions? Is there a simple way to migrate those?

Not yet, but weโ€™re already working on that :slightly_smiling_face:


#6

you can follow the following algorithm to import all data:

  • in your new type definition, add a field oldId for all types that have a relation
  • in your new type definition, add a string field old<RelationFieldName>Id and old<relationFieldName>Ids for every to-one and to-many relation fields in your old project
  • then, iterate over all types and import all nodes of that types as follows:
    • use the createType mutation and pass the old node id as oldId. pass all scalar values to the mutation, and also insert the old ids of related elements into the according field

at this point, all nodes exist in your new project. then, in a second iteration, you can setup the relations:

  • for all relations, query all nodes of one side, iterate over their relation field and call the addTo<RelationName> or set<RelationName> mutations

hope that helps :slightly_smiling_face: