Why Is Memcache/redis Needed When Having An "onOneServer" Schedule?
When faced with an architecture that involves several webservers running the same laravel application, the problem of availability arises.
When two servers are involved, only one of them should run a scheduled job. In that scenario, you would obviously use the onOneServer
attribute.
For details, see the laravel documentation on that matter.
Now here's the actual question: the documentation says
{note} To utilize this feature, your application must be using the memcached or redis cache driver as your application's default cache driver. In addition, all servers must be communicating with the same central cache server.
I just don't get why this should not be possible using the database backend. I'd appreciate any hint you can provide.
Cheers, Thomas
Answer
When Taylor introduced the onOneServer()
feature, he explained it in this way:
Note: When using this feature, you will need to use the Redis or Memcached cache drivers. These drivers provide the atomicity needed to secure the locks that power this feature.
You can read more about distributed locking in redis. I am aware that some of the database drivers, such as MySQL also provides lock-features, so I would assume this feature would potentially also work on those. However, as of right now, they aren't implemented.
Related Questions
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS - Conditionally Load a Different Page
- → Make a Laravel collection into angular array (octobercms)
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?
- → Validating fileupload(image Dimensions) in Backend Octobercms
- → OctoberCMS Fileupload completely destroys my backend
- → How do I call the value from another backed page form and use it on a component in OctoberCms