3 ms·
> trivially easy to scale Can you expand on this please? What exactly makes it easy to scale in which way? How will you deal with the wall you hit when you ou
by treadmill 3y ago
> trivially easy to scale
Can you expand on this please? What exactly makes it easy to scale in which way?
How will you deal with the wall you hit when you outgrow your one central database?
- gumballindie 3y agoIn a web environment each request is an invocation of a script - sort of, apache spawned a process, nginx used a socket, but generally speaking each request was it’s in own context. You maintain session states in an external storage (disk, db, in memory, etc). As such errors would be contained within the context of that request, while memory leaks if any would be a non issue since gc is done when the process literarily ends. So that covers that aspect of scaling. Then all of these external state maintenance dependencies each scale independently. For instance session data can be distributed against endless clusters of redis or nosql instance. Heck some people even used remote file systems for it. Databases would be clustered too - say a couple mysql percona write instances and endless read instances. If that’s not enough then use an intermediary localised storage and queue writes. Or use something like cassandra. Database connections can also be round robin’d since each script would be re executed and connection reopened anyway (can be reused if needed) so they can connect to any server in your cluster. You can also use a database load balancer and sharding, or nosql for fast writes than then get further processed into a relational database. All in all php webapps can be scaled infinitely. Not as efficiently per instance but fairly straight forward by even average devs with the right guidance. For some past clients i scaled apps to billions of unique monthly requests with a fairly low effort. Happy to answer any specific question.