CodeIgniter Forums
Best practice with Routes - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=31)
+--- Thread: Best practice with Routes (/showthread.php?tid=78306)



Best practice with Routes - lipphi - 12-31-2020

Hi everybody,

I'm new in development with CI4 and I have a little question...

I have made a Web site and for the gestion of it I have developed a Windows application and I'm working with a large REST WebServices.

For that, I have for now at least 30 routes.

I would like to know if that can be performance issue or not ?
Maybe that would be more interesting to separate the two applications ?

For now I haven't noticed any slowness on the website but that's a question I have looping in my head Smile

Thanks a lot for the answers.


Have a nice day,


RE: Best practice with Routes - gosocial2 - 12-31-2020

I'm not black belt on this, but one of my CI4-based web apps still under development has already more than 100 routes by now, and the app is still as fast as a website consisting of plain HTML files.

Grouping Routes is a best practice:
https://codeigniter.com/user_guide/incoming/routing.html#grouping-routes


RE: Best practice with Routes - lipphi - 01-01-2021

(12-31-2020, 04:01 PM)gosocial2 Wrote: I'm not black belt on this, but one of my CI4-based web apps still under development has already more than 100 routes by now, and the app is still as fast as a website consisting of plain HTML files.

Grouping Routes is a best practice:
https://codeigniter.com/user_guide/incoming/routing.html#grouping-routes

Hello,

Thank you for the feedback and the tip with grouping routes Smile


Have a nice day,


RE: Best practice with Routes - tgix - 01-01-2021

I am also pushing 100+ routes in my project and I cannot see any issues in production. Running in Docker and with OPcache.


RE: Best practice with Routes - lipphi - 01-02-2021

(01-01-2021, 03:02 AM)tgix Wrote: I am also pushing 100+ routes in my project and I cannot see any issues in production. Running in Docker and with OPcache.

Hello,

Thanks to for the answer too  Smile

Then I haven't a large WebService for now  Big Grin


Have a nice day,


RE: Best practice with Routes - schertt - 01-05-2021

Agreed. When it comes to routes, you will encounter issues with general maintainability long before you encounter any performance issues. After you get a couple hundred routes in there, the real issue becomes keeping track of them somehow. My advice would be to optimize as best as possible to keep that number as low as possible, simply so you don't go insane.


RE: Best practice with Routes - lipphi - 01-06-2021

(01-05-2021, 05:53 PM)schertt Wrote: Agreed. When it comes to routes, you will encounter issues with general maintainability long before you encounter any performance issues. After you get a couple hundred routes in there, the real issue becomes keeping track of them somehow. My advice would be to optimize as best as possible to keep that number as low as possible, simply so you don't go insane.

Ok, then that's not a problem excepted for my brain if I have a lot of route  Big Grin Big Grin Big Grin


Thanks all