Live data from Hacker News

Hasura raises $9.9M to simplify GraphQL

techcrunch.com

81–90 of 199 posts

Re: Hasura raises $9.9M to simplify GraphQL

#81
I settled for Hasura in a prod app after trying Postgrest, Postgraphile and Strapi. I believe its a permanent addition to my stack.

The main reason for me was RBAC. Converting db-to-api is not that hard but providing access control almost always requires some form of middlewares. Hasura does RBAC very well.

Another feature that I haven't deployed but find useful is webhooks. You can trigger webhooks as your data changes.

I do need a server to handle object storage, email and cron so it's not a 100% there, but I can see the appeal of rapid APIs at low cost.

Also subscriptions are All the best to the Hasura team.

Re: Hasura raises $9.9M to simplify GraphQL

#82
post #70

Is it a good idea to base your GraphQL schema on your database schema? Isn't the point of GraphQL to decouple your interface (who should not break) from your backend implementation details?

> Is it a good idea to base your GraphQL schema on your database schema?

You don't. Hasura (and Postgraphile and PostgREST) employ in-database modeling tools called views. Views provide the same modeling abstractions that ORMs provide.

https://www.postgresql.org/docs/12/sql-createview.html

A view is a canned query with a name, and when you get down to it, all an ORM is doing is producing, usually poorly, a query from a named abstraction. Same thing. So why have two pieces in two languages when you can have one?

> Isn't the point of GraphQL to decouple your interface (who should not break) from your backend implementation details?

Views provide the same or better decoupling. They database is aware of them, they are type checked, you can't even make a view that references an unknown column, for example.

Re: Hasura raises $9.9M to simplify GraphQL

#83
post #37

If GraphQL needs $9.9M to be simple enough for developers to actually use it, why was it invented?

GraphQL is mediocre. It's luke-warm mashed potatoes from a chain diner.

Having used it for a number of years now, I still don't know why people recommend it beyond other people recommending it. Out of the box, it comes with no batteries included. Which explains the cottage industry that popped up to support it (Apollo, Hasura, etc.). Simply making GraphQL as efficient as bog-standard REST without involving the use of half a dozen 3rd party libraries is a fool's errand.

Silicon Valley suffers great amnesia and NIH. We've had RPC forever now. XML RPC, SOAP, thousands of others that don't deserve mention. There is a reason people moved from SOAP to REST: you didn't need that complexity. (On a side note, it makes me incredibly depressed to be in this industry knowing how much time and effort died trying to make XML a thing. When was the last time you heard "XML" on Hacker News? Probably been awhile. Maybe 5-10 years now. As a piece of news that is, and not some random comment from an asshole like me.)

Requesting arbitrary pieces of data on the client side (GraphQL's seemingly raison d'etre) is quite easy with REST. So easy that it makes me curious how much brain damage the industry has to think otherwise. Creating new endpoints even? Not a big deal. Not nearly as big of a deal as writing the mountains of boilerplate to get a new GraphQL query up and running. And considering we're talking about GraphQL, it's most likely going to be the same team members working on both sides. Why would that not be the case for REST as well? The mind boggles. All the arguments against REST that GraphQL camp makes are disingenuous at best.

Re: Hasura raises $9.9M to simplify GraphQL

#84

I settled for Hasura in a prod app after trying Postgrest, Postgraphile and Strapi. I believe its a permanent addition to my stack. The main reason for me was RBAC. Converting db-to-api is not that hard but providing access control almost always requires some form of middlewares. Hasura does RBAC very well. Another feature that I haven't deployed but find useful is webhooks. You can trigger webhooks as your data chan…

What made you choose Hasura over Postgraphile? RBAC is a postgres feature, not sure if that would affect the decision?

Re: Hasura raises $9.9M to simplify GraphQL

#85
post #73

Earlier quoted context omitted.

GraphQL definitely has its warts, but it provides more flexibility on the API response than you'd get with ReST, so you're neither sending the whole world to keep your API space small nor adding new endpoints to handle each new client use case. But, GraphQL doesn't fundamentally change the fact that something needs to be responsible for enforcing access restrictions and talking to a database. Hasura is working to sim…

>GraphQL doesn't fundamentally change the fact that something needs to be responsible for enforcing access restrictions and talking to a database. This is what I'm struggling with when it comes to weighing the pros and cons of GraphQL. I like the SQL model, ie pushing selects and joins and such to the DB, so why not from client to host too? But when you still need to enforce access restriction and such per user per a…

While doable, you probably don't really want a web client talking directly to your RDBMS, if for no other reason than connection management would be a nightmare. The calculus there might be different if using something like DynamoDB, but I suspect you'd still find it challenging to be littering your code with DynamoDB calls. So, at some point you'd build your own little utility classes to abstract away the DB interaction, much like an ORM, and eventually it'll evolve into something with overlapping functionality of GraphQL.

If you accept that you don't want your web client talking directly to the database, then you need something that will interface with the database. That problem has been around for a while with many different solutions: SOAP, ReST, PouchDB/CouchDB, interface with various cloud services, something completely custom, and many others. GraphQL is just one of the latest solutions to that problem and with it, brings some advantages around flexibility in the API requests and responses. It also makes it easy to stitch together multiple GraphQL APIs. So, by being standardized* you don't need to develop the client code yourself and you gain the ability to pull together APIs from multiple sources to present as a single end-point. The most popular clients also provide caching mechanisms so you don't have to keep whacking the back-end for the same data repeatedly. There's also graphiql [1], which gives you a really nice way to query or modify your data on any GraphQL API, which I've found to be very helpful when learning new APIs.

So far, I've found GraphQL most useful for single page applications where the back-end really doesn't have to do much more than handle DB interactions. If you already have an application up and running with little churn in the API, adopting GraphQL probably wouldn't gain you much. In a greenfield application, I was able to use Hasura to replace a simple Rails CRUD application and that was handy. Hasura also takes care of JWT handling, so I could do my auth with Auth0 and not handle that in Rails either. I think GraphQL solves an interesting part of the serverless puzzle.

Don't get me wrong, GraphQL can be downright frustrating at times. Or at least the popular implementations of it can be. We use Relay at work and while it solves a lot of problems, it introduces many of its own that have cost me hours of frustration. I tried using AWS Amplify on a side project, and having to write new AppSync resolvers with Velocity templates is just not pretty. It really took using Hasura for me to finally be sold on what the GraphQL promise could be (side note: Hasura doesn't support the Relay protocol, so if that's important to you, you'll need to find a different tool).

* -- Standardized is a loose term. There is a GraphQL spec, but it leaves a lot available to implementation details. So, then there are other specs, such as Relay, built on top of that. Or de facto standards based on what the popular clients provide.

[1] -- https://github.com/graphql/graphiql

Re: Hasura raises $9.9M to simplify GraphQL

#87
A huge benefit that tools like Hasura, Postgraphile and PostgREST provide is using the native in-database row level security model.

Consider Django. Your django app logs into the database typically as a user with elevated permission that is a superset of all permissions required by your users. Postgres has no idea that django is acting on behalf of many users, all it sees is this django super-like user. If an attacker roots your Django instance, they have the same privileges. If your PHB decides to "help" and log in with creds found in the source code, the damage could be catastrophic.

Products like Hasura, Postgraphile and PostgREST switch databse roles on the fly per-request. The user that these tools logs in as typically has almost no privileges. You must be the bearer of a valid JWT token to elevate privileges, and then you only get to the level of the user you stole the token from. There is NO super-like user.

Re: Hasura raises $9.9M to simplify GraphQL

#88
post #36

Earlier quoted context omitted.

If you love hasura and want something like firebase, please check out the tutorial with hasura + RxDB. It is like having a firebase with better offline-first and more features and of course without vendor lock-in. https://hasura.io/blog/building-an-offline-first-web-app-wit...

What I liked with Firebase was how easy and fast everything was. One-click create a new project and everything was ready to use. It's this developer experience I want to mimic with Nhost. By providing a managed backend with simple to use js-sdk ( https://github.com/nhost/nhost-js-sdk ).

I'm a web entrepreneur and for my project i've been using Parse server project (1) implementation by Back4app (2). For the non initiated, Parse server is a API server module for Node/Express + mongo + websocket and stuff you need to run a commercial app like auth, role management et all.

We chose this because :

1.Open source (no vendor locking although now i'm sure if i had to move from b4a it would be a small PITA 2. Ready to use 3. actively maintained (graphQL have been implemented although we have not used it yet) (3)

My question is : should i invest time on discovering nhost for my next POC ?

(1) : https://github.com/parse-community (2) : https://www.back4app.com/ (3) : https://docs.parseplatform.org/graphql/guide/

Re: Hasura raises $9.9M to simplify GraphQL

#89
post #37

If GraphQL needs $9.9M to be simple enough for developers to actually use it, why was it invented?

GraphQL is mediocre. It's luke-warm mashed potatoes from a chain diner. Having used it for a number of years now, I still don't know why people recommend it beyond other people recommending it. Out of the box, it comes with no batteries included. Which explains the cottage industry that popped up to support it (Apollo, Hasura, etc.). Simply making GraphQL as efficient as bog-standard REST without involving the use of…

After using GraphQL with code-generated Typescript types on the response, I can't imagine going back to REST and it's "hope and pray" the JSON looks how you expect it to look

Re: Hasura raises $9.9M to simplify GraphQL

#90
post #52
post #44

Earlier quoted context omitted.

PostGraphile is free, try it!

The point made was, software is supposed to solve a problem. Not create a new problem and provide a paid solution. Kinda speaks the truth that something is fundamental isn't made simple yet.

See Ruby on Rails and why Heroku was invented.
Post reply on HN