简体   繁体   中英

Best way to organise multiple endpoints within a single app

I am new to Heroku and I have a question on how to best organise my JAVA app to run on the platform.

The app I am developing will expose 3 REST endpoints. In order to properly scale the app I am thinking about running each endpoint on a dedicated dyno. The logic behind each endpoint isn't very complex and I am planning to keep it within the web dynos that run the endpoints.

At the moment I have a single app with all 3 endpoints running on the same web dyno. What's the best way to split my app so that I can have a process type per endpoint? Should I create 3 different apps (one per process type) or can I define multiple process types (JAVA commands?) within a single application? What would my procfile look like?

I think most people would have a single application and scale dynos appropriately as the load increases. That is the benefit of Heroku, you just add more dynos in order to scale up if your app is designed correctly.

I don't think this is a Heroku question as such, but more a question of your application architecture, which is going to be hard to comment on without more information (and Java knowledge, which I don't have ;)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM