I’m thinking about using FaunaDB as a base for a new project. But I’m a bit struggling with the application architecture.
I want to use Next.JS for the frontend and Strapi for the static content, and FaunaDB for the active part.
For the backend, I’m in doubt between .NET Core with HotChocolate or Node.JS. The last one would make the most sense as Next.JS supports functions, Netlify functions run on Node.JS, so everything would be streamlined using the same language (I would only need one extra developer instead of two).
I’m unsure about the identity provider. I would love one that supports passwordless authentication using the Android/IOS fingerprint reader to prevent account sharing but didn’t found one yet.
Lots of documentation talk about talking to FaunaDB directly from the frontend, but:
I have some additional server-side requirements like creating objects from ZIP-files and XML, in-depth mathematical calculations, and AI functionality.
I want to restrict the queries an authenticated user can execute, so I was thinking about adding persisted queries.
I need to comply with the GDPR. So all queries should be logged to, for example, Seq.
Does this mean I need to decorate each database query with a NodeJS Apollo server layer on top?
So I presume this is the best architecture?
Client-side React code -> Apollo Server on Netlify functions (AWS lambda) with persistent queries + logging to Seq -> FaunaDB.
This added middleware proxy will introduce some complexity, especially when using the subscriptions (if FaunaDB adds support for them) and code redundancy, but I think it’s currently the only way to restrict queries and add external logging to FaunaDB?