5 ms·
In my mind, you shouldn't use Hasura when you can get away with Jamstack (ie static pre-compilation of your entire site, no backend at all). In those cases you
by dmitryminkovsky 5y ago
In my mind, you shouldn't use Hasura when you can get away with Jamstack (ie static pre-compilation of your entire site, no backend at all). In those cases you can use other backends with less cognitive/operational overhead. For example, you could get away with using Airtable as a backend, or something similar.
Hasura, on the other hand, is good for proper apps where you really want fine, control over a user-facing backend. Hasura makes that fine control easier to attain than ever, but you don't always need that.
- motleydev 5y agoEven in this context, Hasura could still be a great fit. If you have any form of existing database from the supported set in Hasura, then Hasura can still help by give you an instant read layer to that data. If you need to lock down parts of your data for the static site, or want to add a little bit of interactivity on top of the static site, or even if you just want to bring your own GraphQL layer to a tool like Gatsby - these are all great cases for Hasura still. It gives you super fast API access to existing data.
- dmitryminkovsky 5y ago> Even in this context, Hasura could still be a great fit. For sure, but might be too heavy depending on the specifics of the use-case. "If you can get away with" was my main point.
- bpicolo 5y agoMy sense of Hasura is that it's great for CRUD prototyping, but every usage ends up requiring a more fully fledged backend in the mix anyway? Hasura can't implement your business logic. If Hasura is my first-stage backend, that means I need to reinvent a lot of the controls it would provide anyway - auth, graphql APIs to integrate into it, etc - for the servers that can do that business logic. So it doesn't really feel like a choice between Hasura and a custom backend. You can have a custom backend, or both Hasura and also a custom backend. It's an excellent choice for killing off boilerplate CRUD, though.
- dmitryminkovsky 5y ago> Hasura can't implement your business logic. You can implement a ton of it in stored procedures and check constraints, which I realize some people don't like, but I really like a lot. But yes, there are limits to what you can do with this, and testing PL/pgSQL or whatever language you use for your procedures is prohibitively difficult. > but every usage ends up requiring a more fully fledged backend in the mix anyway? So yes, I agree, if you use Hasura, you will end up with a backend as well. This backend will run your auth (if you don't go a third party route) and your Hasura Actions[0][1], which I think is fine. > So it doesn't really feel like a choice between Hasura and a custom backend. You can have a custom backend, or both Hasura and also a custom backend. It's an excellent choice for killing off boilerplate CRUD, though. That's my take, too. Hasura totally kills boilerplate CRUD, adds the ability to do rich GraphQL querying, and my favorite feature—declarative role-based authorization/access control—puts the icing on the cake. [0] https://hasura.io/docs/latest/graphql/core/actions/index.html https://hasura.io/docs/latest/graphql/core/actions/index.htm... [1] https://stackoverflow.com/q/67053247/741970 https://stackoverflow.com/q/67053247/741970
- bpicolo 5y agoData transformations are a small subset of business logic. Talking to microservices, third party integrations, and email, for example, are other pieces.
- dmitryminkovsky 5y agoRight, you'd use your API backend and tie them into Hasura with actions if you wanted them tied to Hasura. Of course you can't have your whole app in Hasura, and I don't think they make that claim? Maybe they did before they added actions, but I think they knew that a bit bogus so they added actions and before that had remote schemas.
- devit 5y agoWhy would testing stored procedures be "prohibitely difficult"? Just create a new test database, populate it with test data, call the function with test inputs and assert that the return value and the SQL dump of the resulting state of the database are what you expect.