I am helping thousands of dev bloggers attain creative freedom with Hashnode. I am Sandeep Panda, ask me anything!

View other answers to this thread
Vishu Vish's photo

Hi, I have some questions regarding technology...

  • Which Image Processing library used by Hashnode for uploaded images ?

  • You guys MongoDB before there was cross collection transaction feature, so how you assure consistency for fields like: followersCount, followingCount, commentsCount etc. ? You perform these operation just one after another without transaction ? What if your process crashed between operation ? So how you will deal with inconsistency ?

  • You guys provide GraphQL library for users, but not using in application, so two separate API ? will you guys migrate to GraphQL in future ?

  • Do you see GraphQL as a replacement for REST API ?

  • Do you guys use any ORM for MongoDB ? (Mongoose), If not then what your model class look like ?

  • You directly call Models in Controllers or there is a Layer (aka Service Layer) between them ?

Thanks :)

Sandeep Panda's photo

Hey Vishu How are you doing?

Which Image Processing library used by Hashnode for uploaded images ?

IMGIX

You guys MongoDB before there was cross collection transaction feature, so how you assure consistency for fields like: followersCount, followingCount, commentsCount etc. ? You perform these operation just one after another without transaction ? What if your process crashed between operation ? So how you will deal with inconsistency ?

Right now we try to mimic transactions as much as possible. But MongoDB 4.0 supports cross document transactions and it's in our planned upgrades. :)

You guys provide GraphQL library for users, but not using in application, so two separate API ? will you guys migrate to GraphQL in future ?

We might move, but as of now there is no pressing need to switch. GraphQL API was introduced to make our data easily consumable. We still need to support a lot more endpoints and document it properly. So, we might switch in future, but not within next 6 months.

Do you see GraphQL as a replacement for REST API ?

GraphQL is certainly powerful, but might not replace REST entirely. There are cases where REST is a more sensible choice. See this: moesif.com/blog/technical/graphql/REST-vs-G..

Do you guys use any ORM for MongoDB ? (Mongoose), If not then what your model class look like ?

Yes, we use Mongoose.

You directly call Models in Controllers or there is a Layer (aka Service Layer) between them ?

We initially called model methods directly from controllers. But newer code is moving towards service layer.

Hope it helps. :)