does it makes sense to use rocket with PostgRest ? #2028
Replies: 2 comments 7 replies
-
Hi @commandline-be, I will respond technically, Yes, you can use Rocket to communicate with a micro-service like PostGRest.
But, I can't say if it is what you need. B. r |
Beta Was this translation helpful? Give feedback.
-
Using a dedicated application server on top of something like PostgREST (or PostGraphile) is definitely possible and I'm sure is used somewhere. As a trivial example I have an Express (Node) and PostGraphile app here that does exactly that though with different frameworks. If PostgREST is doing all the interesting work, it may not be a great project to learn Rocket - echoing data from a separate web service is not the typical use case, so you might have some trouble finding supporting documentation/best practices/etc. Then again, if you're just mucking around, why not? On the one hand, it seems inevitable to add a "real" application server just to get a sane programming language instead of having to write all your business logic in stored procedures and and custom views. If you have very strong SQL skills, maybe this is not a barrier. On the other hand, it really makes you question "why bother having two web services?". Have you looked at non-ORM solutions like SQLx? If your main goal is to avoid ORMs, it's well worth considering when compared to adding a whole extra web service. |
Beta Was this translation helpful? Give feedback.
-
Reading https://postgrest.org/en/v9.0/tutorials/tut0.html it feels like comming home to sane design again. I'd glanced at ORM but it felt totally alien.
Yet, i still have rocket on my list to learn more about by coding. Does it makes sense to combine both to deliver a performant and robust website ?
Thinking here of how PostgRest responds with JSON i assume i can simply have Rocket such results into a web page template etc. ?
Br,
JL
Beta Was this translation helpful? Give feedback.
All reactions