A typical AEM environment is made up of an Author Service, Publish Service and an optional Preview Service.
The Author service is where internal users create, manage, and preview content.
The Publish service is considered the “Live” environment and is typically what end users interact with. Content, after being edited and approved on the Author service, is distributed to the Publish service. The most common deployment pattern with AEM headless applications is to have the production version of the application connect to an AEM Publish service.
The Preview service is functionally the same as the Publish Service. However it is made available only to internal users. This makes it an ideal system for approvers to review upcoming content changes before being made live to end users.
The Dispatcher is a static web server augmented with the AEM dispatcher module. It provides caching capabilities and another layer of security. The Dispatcher sits in front of the Publish and Preview services.
Within an AEM as a Cloud Service Program you can have multiple environments, Dev, Stage and Prod. Each environment would have its own unique Author, Publish, and Preview services. You can learn more about managing environments here
The most common deployment pattern with AEM headless applications is to have the production version of the application connect to an AEM Publish service.
The diagram above depicts this common deployment pattern.
Another option for headless deployments is to incorporate an AEM Preview service. With this approach content can be published first to the Preview service and a preview version of the headless application can connect to it. The advantage with this approach is that the Preview service can be set up with the same authentication requirements and permissions as the Publish service, making it easier to simulate the production experience.