Welcome Guest, Not a member yet? Register   Sign In
Scalable Design of Codeigniter 4


Can you guys share your experience about scalable designs? While there is a lot out there & anyone can research using google but an advice from experienced users who have already used certain techniques will surely help without wasting a lot of time or research. I am aware that one should not worry unless he really needs but keeping basic structure scalable while starting a new project will greatly help on later stages. 

There is no one-size-fits-all solution & each project needs a different approach but an advice will help in getting started in a right direction for many newbies.

Please share your suggestions, links to curated resources, tips & techniques for following questions that come to mind:

1- How to design the CI 4, any specific ideas you can share, links to github?
2- Should we split app in different modules & replicate each module on independent servers or replicate whole app?
3DB: MySQL, MongoDB, PostgreSQL, MariaDB, Cassandra?
4- DB Replication suggestions?
5- Load Balancer: nginx, haproxy
6- Caching: redis, memcached, varnish
7- CDN: cloudflare, cloudflare, akamai, aws, google cdn, microsoft cdn
8- Hosting (Cost Effective): AWS, Google, Azure, Digitalocean, Vultr, etc
9- Anything else you want to add



I'm afraid I can not provide any links to resources, as I don't know where I got everything from...

1. I'm afraid not. Your PHP-code should be coded as a "dum" project. Meaning sessions should be stored off site (in DB or other solution). Nothing on the server should depend on the specific server.

2. We have a complete copy of the application across our servers. And point it to a specific "run" file to start that specific functionally. It really depends if this are an API-type of design. Then you can have a backend code and frontend, so then two different code bases could be a better solution.

3. Personally MariaDB, but whatever you are comfortable with.

4. Master and slave, so everything are copied in real time. CodeIgniter support failover, but as it needs to be timed out, you will get some slowdowns. So if you can implement a "load balancer" / monitor solution for your database outside of CodeIgniter. It would be better. I don't know exactly how the failover works, if it's cached or not.

5. nginx, personally preference. So you just need to learn one tool and stick with it. As it used as a server for the PHP-application as well.

6. Redis for in-memory caching. And it supports multiple servers (master / slave), so you can have a failover if you want.

If I could do it all again, Nginx for static content. And toss out Varnish. As it's faster and you don't need a reverse-proxy (if varnish and nginx are on the same server). Depending on how big of a project we are talking about. If you host multiple services on the same server or not.

7. We have our own, on our hosting provider. Just take GDPR into account when outsourcing.

8. No comment, we are using a local ISP.

Docker or containers are popular, so you can just spin up an exact copy again. Haven't used them myself. And the website aren't that big to even consider using it.

Theme © iAndrew 2016 - Forum software by © MyBB