I have built a few stacks in my time as a self-taught full-stack developer, but I think there may be a hole in my knowledge that you can hopefully fill in for me. I have built a few stacks that all have a core architecture like this:
- Backend in Go, interfacing with a Postgres database or doing some core logic
- RESTful API server (also written in Go) serving over HTTPS that triggers database methods/backend logic
- Frontend in JavaScript using ReactJS or some other framework. The front end makes calls to the API server (using
fetch()
) whenever data is needed/logic should be executed (on the backend).
I find that this is a pretty good, common architecture that can work in many different use cases. However, I am wondering if there is any other type of core architecture that differs from this. I have heard of GraphQL and I see how that is different than this traditional REST-like architecture, but I am wondering if there is some other type of architecture used to build web apps that does not revolve around a REST/SOAP/GraphQL API. I've heard of WebSockets, and I think that they fit into what I am asking about here, so how are they different from just calling JavaScript's fetch()
to make calls to my REST API (or using a third-party library like axios
.)?