# Realms for microservice application

**URL:** <https://forum.keycloak.org/t/realms-for-microservice-application/8212>\
**Category:** Securing applications\
**Created:** [March 30, 2021, 1:55pm UTC](https://forum.keycloak.org/t/realms-for-microservice-application/8212 "2021-03-30T13:55:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![swordfish](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@swordfish](https://forum.keycloak.org/u/swordfish)\
**Post date:** [March 30, 2021, 1:55pm UTC](https://forum.keycloak.org/t/realms-for-microservice-application/8212/1 "2021-03-30T13:55:08Z")

</div>

Hi all,

I am building a new microservice based application and migrating from Spring Auth Server to Keycloak.

We have a series of backend microservices which can communicate with other using OAuth2. Some of the microservices methods are exposed on the frontend through a single page web application.

My question is regarding best practice with realm security. Should we have two realms, one for frontend access (this would have all signed up users etc) and one for backend. Or should we just use one realm for all application access?

Any advice or recommendation would be much appreciated.
