Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ozdemiru's avatar

User Service or keep users in Gateway service

Should I create a microservice just for users Or should I just keep user actions at the gateway microservice?

0 likes
5 replies
martinbean's avatar
Level 80

@ozdemiru What good would a user microservice be? Would it be completely separate from the rest of your application? Or are other “microservices” going to depend on this, in which case it’s not a self-contained service and you’re just creating more codebases for the sake of it.

Only create microservices if it can run in complete isolation. If the service actually has dependencies on other services or other services depend on it, then it’s not suitable candidate for a microservice. All you’ll be doing is moving your joins from the database to HTTP instead, and network calls are far slower than a database query.

ozdemiru's avatar

@martinbean Hi martin! thank you so much for your answer. Honestly, I'm trying to understand how can I build a non-monolith web app with the lumen. Do you know any kind of source that I can learn ?

martinbean's avatar

Honestly, I'm trying to understand how can I build a non-monolith web app with the lumen.

@ozdemiru Why? What exactly is wrong with a “monolith”?

90% of microservice-based projects don’t need microservices. If you can’t carve a clear boundary between a service, then it shouldn’t be made a standalone service. Something like a user service is clearly going to have dependencies—and be dependent on—many other services in your project. You don’t just have a pool of users doing nothing.

Use architectures if they’re actually going to solve a problem for you. Don‘t try and make up problems as an excuse to use something just because you think it looks shiny or because someone wrote a blog post saying you “should” be building microservices.

Please or to participate in this conversation.