Hacker Newsnew | past | comments | ask | show | jobs | submit | erickpintor's commentslogin

Great post!

Would you mind expanding on the correctness guarantees enforced by the atomic semantics used? Are they ensuring two threads can't push to the same slot nor pop the same value from the ring? These type of atomic coordination usually comes from CAS or atomic increment calls, which I'm not seeing, thus I'm interested in hearing your take on it.


I see you replied on comment below with:

> note that there are only one consumer and one producer

That clarify things as you don't need multi-thread coordination on reads or writes if assuming single producer and single consumer.


Exactly, that's right

Thanks! That's not ensured, optimizations are only valid due to the constraints

- One single producer thread

- One single consumer thread

- Fixed buffer capacity

So to answer

> Are they ensuring two threads can't push to the same slot nor pop the same value from the ring?

No need for this usecase :)


This is a SPSC queue -- there aren't multiple writers to coordinate, nor readers. It simplifies the design.

We use Sangria: https://github.com/sangria-graphql/sangria

Our usage of Sangria is unusual, though. We use it for parsing and serving GraphQL schemas. We take advantage of their builtin validation logic. Everything else between parsing and having a result to serve back is piped through custom code that translates Sangria's GraphQL AST into Fauna queries.


Hi,

I'm the lead developer of Fauna's GraphQL API. I just wanted to share how excited I am with our GA release. We've spent a lot of time working on this project and connecting with the developer community so we could build a GraphQL API that we hope everyone will enjoy using.

It was particularly fun to develop this on Fauna because we managed to take advantage of the multi-tenant data model so that the GraphQL API works seamlessly for all databases hosted in the cloud with no extra configuration needed. Fauna's query language focus on composability made it possible to dynamically compose a single database query per GraphQL query, therefore, naturally avoiding N+1 issues.

I hope you enjoy using our GraphQL API and I look forward to hear your feedback.


Fauna Web Dev here,

You can try it out virtually configuration-free in the database console: https://dashboard.fauna.com/

Here's a link to a sample gql file you can download and run: https://docs.fauna.com/fauna/current/_attachments/graphql/sc...


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: