https://discord.cloudflare.com logo
Join Discord
Powered by
# workers-discussions
  • g

    Gary Somerhalder

    11/24/2020, 1:30 PM
    We are using GraphQL for everything and are using AWS AppSync
  • c

    catgirl

    11/24/2020, 1:32 PM
    Not your API but an API for Workers to talk to the database. There are limits and Workers is not a full node.js environment it’s a Node Isolates environment so you have to develop differently and many features are limited.
  • g

    Gary Somerhalder

    11/24/2020, 1:33 PM
    We don't call our AWS RDS Postgres databases directly and GraphQL handles everything including database calls
  • g

    Gary Somerhalder

    11/24/2020, 1:33 PM
    Everything goes through GraphQL first
  • g

    Gary Somerhalder

    11/24/2020, 1:39 PM
    Would this work?
  • g

    Gary Somerhalder

    11/24/2020, 1:39 PM
    @catgirl
  • i

    itsmatteomanf

    11/24/2020, 1:50 PM
    If you are querying a GraphQL API endpoint from Workers it will work just fine. Basically you can't easily connect directly to a "traditional" database.
  • g

    Gary Somerhalder

    11/24/2020, 1:50 PM
    This makes a lot of sense
  • i

    itsmatteomanf

    11/24/2020, 1:51 PM
    Basically everything that is HTTP(S) works without issues unless you bump into the subrequest limit (which I'm not sure if it increases in Unbound, @User).
  • g

    Gary Somerhalder

    11/24/2020, 1:52 PM
    Okay so that solves that. Now what about running our Node code?
  • a

    albert-zhao

    11/24/2020, 1:53 PM
    Yeah there aren’t any plans to bump the subrequest limit that I’m aware of. Part of the reason that’s there is so no one can use Workers to DDoS
  • i

    itsmatteomanf

    11/24/2020, 1:53 PM
    That depends on what you are doing and if that is supported in a Service Worker type of environment. There are certain limitations... https://developers.cloudflare.com/workers/runtime-apis
  • i

    itsmatteomanf

    11/24/2020, 1:54 PM
    Yeah, gotcha. I can understand that...
  • d

    dangilkerson

    11/24/2020, 1:57 PM
    Would be cool if subrequests to endpoints served with a domain specific CF cert could have a higher limit. That way I can't DDoS any random endpoint
  • g

    Gary Somerhalder

    11/24/2020, 1:58 PM
    @albert-zhao Whats the request limit?
  • a

    albert-zhao

    11/24/2020, 1:59 PM
    The subrequest limit is 50 per request
  • g

    Gary Somerhalder

    11/24/2020, 1:59 PM
    I would imagine we would hit that very quickly
  • a

    albert-zhao

    11/24/2020, 2:01 PM
    Ah interesting, how come that would be the case?
  • c

    catgirl

    11/24/2020, 2:04 PM
    I don’t know if Workers supports GraphQL. I’ll look into this for you. If you’re calling an external API the answer is probably yes.
  • c

    catgirl

    11/24/2020, 2:05 PM
    Depends on what features of node you use.
  • g

    Gary Somerhalder

    11/24/2020, 2:05 PM
    I believe it does because I saw an article from @kristian
  • c

    catgirl

    11/24/2020, 2:06 PM
    Ah cool, I’ve only worked with REST not GraphQL, for my APIs but I’ve heard good things about it and want to learn it soon.
  • g

    Gary Somerhalder

    11/24/2020, 2:07 PM
    AWS AppSync makes it super easy!
  • a

    albert-zhao

    11/24/2020, 2:07 PM
    We're looking into early next year at Node module support - will probably start with a subset of common Node APIs, such as HTTP, Crypto, and Buffer. Historically our engineers focused on Browser APIs because of their long-term compatibility. For Node, we may need to ask users what version they need us to be compatible with. For database support, like Postgres, it's a longer project with no timeline because we'll need to work with other teams to enable Workers for TCP.
  • g

    Gary Somerhalder

    11/24/2020, 2:08 PM
    It sounds like database support won't be an issue for us as we go through GraphQL and don't call the database directly
  • c

    catgirl

    11/24/2020, 2:08 PM
    @Gary Somerhalder Check out this article which explains how Workers and Node Isolates works if you find time https://developers.cloudflare.com/workers/learning/how-workers-works
  • a

    albert-zhao

    11/24/2020, 2:09 PM
    In the meantime, we're working on tutorials for connecting to databases that we can do today, like Google Firestore, AWS Aurora Serverless, and others that connect via HTTP. 🙂
  • g

    Gary Somerhalder

    11/24/2020, 2:09 PM
    I would be very interested in this as we have 5 companies that could all use Workers then
  • g

    Gary Somerhalder

    11/24/2020, 2:10 PM
    This is very cool!
  • g

    Gary Somerhalder

    11/24/2020, 2:10 PM
    We have been looking into AWS Aurora Serverless running Postgres
1...456...2509Latest