If you were going to build a chat app with Node and GraphQL?
Caleb Adepitan

Caleb Adepitan @calebpitan

About: I'm a dev who rose from thin ice

Location:
Nigeria
Joined:
Jun 28, 2019

If you were going to build a chat app with Node and GraphQL?

Publish Date: Jul 5 '20
7 6

I've been wondering and now I'm tired of wandering. So I'm going to ask this here, openly.

If you were going to build a chat application with Javascript (server-side, client-side) and GraphQL, what other tech stack will you use?
What database?
How will you speak to your database from your resolvers (I mean, is it with drivers or ORM, and please name the ORM or ORM-like tech)?

Your opinions are appreciated 🙏

Comments 6 total

  • Duc Le
    Duc LeJul 5, 2020

    A chat app requires a real-time responding and I would bet in websocket.
    However, apollo graphql can cover this with its subscriptions and it's a right choice.

    If you're going to work with an independent mongoDB instance, let's start with mongoose.
    I can name another one is prisma.io
    Have a look!

    • Caleb Adepitan
      Caleb AdepitanJul 5, 2020

      Thanks very much.
      I currently use prisma.io and yes I know websocket is a vital tool for chat apps.

      I just got a feeling there may be some other tool better than prisma. Why I feel this way is because, I write my graphql schema to take input types that fits into the Prisma CRUD API.
      I feel this is a bad approach because, if anything changes in the future with Prisma's API, I will need to reflect it in my schema right away. This kind of dependency is what scares me.
      Navigating through Prisma's source to check type so I can reflect similar types in graphql schema—thank God there's Typescript

      • Martin Eboh
        Martin EbohJul 5, 2020

        MeteorJS fits everything these days. Scalable realtime features by default using Mongo collections and redis-oplog to scale to millions. Supports React, Vue, Blaze, Svelte, Angular and works with GraphQL.

        • Caleb Adepitan
          Caleb AdepitanJul 5, 2020

          Thanks so much.
          I should probably look at Meteor

  • Pieter Bergwerff
    Pieter BergwerffJul 6, 2020

    A option for real-time communication could be peer.js, it works with WebRTC peer-to-peer data without sending chat data through a server. In other words, you don't store the chat data, but only provide the connection between users.

    But if you want to store all chat data than I personally prefer mysql. I do not know for sure if, for example, chat data better be stored in a nosql database.

    Success!

    • Caleb Adepitan
      Caleb AdepitanJul 7, 2020

      Thanks so much, I will check peer.js.
      I never knew WebRTC never goes through the server, that makes it unlike Websocket.
      But for chat data I'm using PostgreSQL. I love to leverage upon "relational" in RDBMS. I prefer it to NoSQL/Document DB, too

Add comment