Live data from Hacker News

Hasura GraphQL Engine and SQL Server

github.com

61–70 of 85 posts

Re: Hasura GraphQL Engine and SQL Server

#61
post #51

Earlier quoted context omitted.

Why not use UUID as primary keys?

Can't speak for all dbs, but many use a clustered index on the primary key. In this case, the physical rows are stored in the order of the index, rather than just pointers to the rows. If you are inserting non-sequential data into a clustered index, every insert results in a non-trivial rearrangement of the rows. UUIDs are not sequential, so at scale you will experience performance issues if you are using UUID primar…

> Can't speak for all dbs, but many use a clustered index on the primary key.

AFAIK, only MySQL (with InnoDB engine) and SQL Server, AFAIK, do it by default (always for MySQL/InnoDB, and by default unless you create a different clustered index before adding the PK constraint for SQL Server, but even then you can specify a nonclustered PK index.)

PG doesn't have clustered indexes at all, DB2 has a thing called clustered indexes which aren’t quite the same thing, Oracle calls having a clustered index on the PK an “index organized table” and its an non-default table option, and SQLite has what seems equivalent to a clustered index ONLY for INTEGER PRIMARY KEY tables not declared as WITHOUT ROWID.

> You can still use a unique identifier alongside an incrementing primary key, and you could choose to use a more compact format than the UUID.

A key point of using a UUID is distributed generation avoiding lock contention on a sequence generator, which is defeated by using both. Just “don’t use a clustered index where distributed key generation is important” seems a better rule, even if it precludes MySQL/InnoDB use.

Also, most DB’s that explicitly handle UUIDs store them compactly as 128-bit values. If you want to transform them to something other than the standard format for UI reasons [0], that doesn’t preclude using UUIDs in the DB.

[0] seems like bikeshedding, but, whatever.

Re: Hasura GraphQL Engine and SQL Server

#62

Earlier quoted context omitted.

With integer keys as an alternative? UUID v4 keys don't give away information about the number of rows in a relation. You can directly use them in api responses. In recent events, iirc, parler was so easy to scrape precisely because they were using int keys exposed in their api get endpoints.

Security through obscurity is only sweeping the problem under the rug instead of addressing it IMPO. I don't know what Parler is or was, but I don't think sequential int IDs would be the major factor that would lead to a website being scraped. There are generally two types of information in applications, "public" and "privileged". The former has the IDs and such discoverable by an index or explore page, the latter re…

> Security through obscurity

This _should_ be part of a multi-layer security plan though. You don't depend on it as a primary source of security, but why would you expose more internal information than needed? If something does go wrong with another layer that obscurity _helps mitigate the damage_.

Re: Hasura GraphQL Engine and SQL Server

#63
post #33

Earlier quoted context omitted.

Both these projects support Postgres, have open source cores, and feature 'pro' options. https://github.com/hasura/graphql-engine/ https://www.graphile.org/postgraphile/pricing/ https://hasura.io/pricing/ (see: self-hosted) https://hasura.io/docs/2.0/graphql/core/databases/postgres/i...

That's technically true, though Hasura is a well-funded startup with a $99+/mo cloud offering and Enterprise features while postgraphile is one main open-source developer who has support contracts available and accepts donations (the "pro" package is pretty minimal and costs just ~$25/mo). You can get started with Hasura for free which is great, and you can run it on your own servers (if you want to manage a Haskell…

> (if you want to manage a Haskell service)

Nowadays most of these self-hosted apps run on Docker containers as a wonderful abstraction.

For example, in my company we have self hosted Metabase on App Engine Flex. It is written with Clojure and runs on the JVM. I know nothing about these things, yet I was able to make it run with high availability.

You could also run it on Kubernetes or other similar options elsewhere.

Re: Hasura GraphQL Engine and SQL Server

#64

I'm overall very impressed with Hasura, but have found it cumbersome to work with if using UUID primary keys because it won't map them as the GraphQL ID type [0]. There are plenty of people using Hasura successfully in production environments, so I'm curious how others handle it. I'm hoping the answer isn't "just use int PKs", but it'd be helpful to know if it is. [0] -- https://github.com/hasura/graphql-engine/issue…

not really sure what the issue here is

we use UUID's exclusively and it maps to a scalar uuid type without any issues

do you mind explaining a bit more?

Re: Hasura GraphQL Engine and SQL Server

#65
post #59

We've built and launched our community platform on Hasura + PG RDS. Row-level permission has been a time-saver to launch a product quickly. Stability has been great - our Hasura container hasn't crashed / restarted in the last 9 months. Their are downsides (it has proven frustrating for us to implement the authentication part for a role that is not user or admin) but I would definitely recommend Hasura to experienced…

Do you mind explaining your role issue?

We've been building out a pretty complex RBAC system and i might be able to help.

Re: Hasura GraphQL Engine and SQL Server

#66
post #2

(Vamshi from Hasura) We've been working on SQL server native support and we're happy to announce support for read-only GraphQL cases with new or existing SQL Servers. Next up is adding support for stored procedures, mutations, Hasura event triggers [1] and more! [1]: https://hasura.io/docs/latest/graphql/core/event-triggers/in...

I know this may not be exactly on topic, but do you know when version 2 will be released? My team has been waiting on a single feature from that release for what seems like months (slack in jwt verification time, right now the clocks on our hasura and keycloak servers are off and it is creating issues).

How are you liking keycloak?

Was evaluating it against cognito and auth0 last week.

Re: Hasura GraphQL Engine and SQL Server

#67
We literally had to rebuild an app because this support was so bad and they sold us on it being ready. Yikes.

It also needs its own PG db to function in order to support SQL Server.

PG usage was pretty good. Auth sucked.

Usage in CI pipelines is hot garbage. Command line tooling does not work well with it at all.

I'd probably take the risk again for a toy...maybe.

Re: Hasura GraphQL Engine and SQL Server

#70

I am now building on Hasura. Love the experience overall, but some aspects are frustrating. For example, setting up authentication for a React Native (Expo) app with Auth0 is quite cumbersome, and the docs are a bit out of date.

you should take a look at https://create-full-stack.com/

the mobile app it generates is react-native with auth0 already included. It uses hasura as a backend, the pulumi config will deploy it to ECS for you if want.

tbh though I don't see how this is a problem with hasura and just a auth0/RN issue.

Post reply on HN