piesell
TTCTheo's Typesafe Cult
•Created by piesell on 12/30/2022 in #questions
t3 + express or migrate to tRPC?
OK so I think I have decided to use tRPC routes to replace most of the express data getting and setting, and then use cloud functions for interacting with my remote api to populate the db. I have been checking out create-t3-turbo, and it looks pretty good, so i think I will get started with that. I think I will need to do the backend stuff first though.
I have seen that firestore is not recommended, and I didn't really use it properly anyway (just allowed me to not think too hard about schema) so I am happy to migrate to a relational database. If I am started again like this, is there any advice for properly hashing out the schema and organising things properly? (and whether to use postgres or mysql)
45 replies
TTCTheo's Typesafe Cult
•Created by piesell on 12/30/2022 in #questions
t3 + express or migrate to tRPC?
Alright, well I have some thinking to do, I am leaning towards ditching express, using nextjs and trpc for routing and emitting events via pubsub and reacting to those with cloud functions to populate the db/interact with external api
45 replies
TTCTheo's Typesafe Cult
•Created by piesell on 12/30/2022 in #questions
t3 + express or migrate to tRPC?
Riiiight i see
45 replies
TTCTheo's Typesafe Cult
•Created by piesell on 12/30/2022 in #questions
t3 + express or migrate to tRPC?
or fastify
45 replies
TTCTheo's Typesafe Cult
•Created by piesell on 12/30/2022 in #questions
t3 + express or migrate to tRPC?
right gotcha, makes sense. So use trpc on serverside to define the express routes, and on the clientside to interact with the server (and import types from server)
45 replies
TTCTheo's Typesafe Cult
•Created by piesell on 12/30/2022 in #questions
t3 + express or migrate to tRPC?
So in terms of the frontend stuff, using t3 app, my understanding is it (and next) is aimed at a serverless architecture, if I kept my backend is it still worth using t3 or something else?
45 replies
TTCTheo's Typesafe Cult
•Created by piesell on 12/30/2022 in #questions
t3 + express or migrate to tRPC?
Oh sorry yes
45 replies
TTCTheo's Typesafe Cult
•Created by piesell on 12/30/2022 in #questions
t3 + express or migrate to tRPC?
So you use BullMQ on a node server to schedule functions?
45 replies
TTCTheo's Typesafe Cult
•Created by piesell on 12/30/2022 in #questions
t3 + express or migrate to tRPC?
I will have a think on it, I was generally quite happy with the serverside when i last worked on it, but it is definitely more complicated than I think it needs to be, and elegantly enabling/disabling different functionality on the server was a limitation in how i implemented it
45 replies
TTCTheo's Typesafe Cult
•Created by piesell on 12/30/2022 in #questions
t3 + express or migrate to tRPC?
Gotcha, that makes sense, perhaps a configuration document which can be set by the user to enable/disable different parts
45 replies
TTCTheo's Typesafe Cult
•Created by piesell on 12/30/2022 in #questions
t3 + express or migrate to tRPC?
Lets say I move to a serverless architecture, and I take input from the user to monitor a new device with id: 20... do you reckon I should store this in a database and react to that with functions, or publish a message and handle it that way?
45 replies
TTCTheo's Typesafe Cult
•Created by piesell on 12/30/2022 in #questions
t3 + express or migrate to tRPC?
Not heard of kafka, will check that out
45 replies
TTCTheo's Typesafe Cult
•Created by piesell on 12/30/2022 in #questions
t3 + express or migrate to tRPC?
My company does use RabbitMQ elsewhere
45 replies
TTCTheo's Typesafe Cult
•Created by piesell on 12/30/2022 in #questions
t3 + express or migrate to tRPC?
Using pub/sub might work nicely too, use topics to queue jobs
45 replies
TTCTheo's Typesafe Cult
•Created by piesell on 12/30/2022 in #questions
t3 + express or migrate to tRPC?
I will check out BullMQ
45 replies
TTCTheo's Typesafe Cult
•Created by piesell on 12/30/2022 in #questions
t3 + express or migrate to tRPC?
as that is moreso database management
45 replies
TTCTheo's Typesafe Cult
•Created by piesell on 12/30/2022 in #questions
t3 + express or migrate to tRPC?
But thinking about it, I do like the idea of separating the concerns here and having orchestration logic away from the rest api
45 replies
TTCTheo's Typesafe Cult
•Created by piesell on 12/30/2022 in #questions
t3 + express or migrate to tRPC?
yeah I implemented a fairly hacky (but working!) scheduler in js just by calculating waits and executing the specific call when nextcheck < currenttime
45 replies
TTCTheo's Typesafe Cult
•Created by piesell on 12/30/2022 in #questions
t3 + express or migrate to tRPC?
Thanks for that repo, I will give it a look over. I think because I will be using Firebase Auth anyway, I should be able to replace the nextauth with firebase auth direct in the mobile app
45 replies
TTCTheo's Typesafe Cult
•Created by piesell on 12/30/2022 in #questions
t3 + express or migrate to tRPC?
Thats a very good point regarding orchestration, it looks like I could make use of the GCP Cloud scheduler. I am unsure right now whether it is best using that or sticking with deploying an express server and handling it myself, I don't suppose you have an opinion on the matter?
45 replies