- Qual é o problema com a arquitetura das aplicações atuais?
- Um projeto, na maioria das vezes, é começado pequeno, por uma pessoa e sem saber como será a sua evolução.
- Pode acontecer de novas pessoas entrarem no projeto e não conhecerem as regras que guiam a aplicação.
- Um dos princípios de organização é o MVC ou Model View Controller.
- No MVC a regra de negócio fica na Model, os templates na View e a mediação é feita pelo Controller.
- O MVC não é suficiente para manter uma aplicação com código compreensível durante muito tempo.
- A ideia de utilizar MVC veio de frameworks e a maioria das aplicações estão acopladas de alguma maneira a frameworks.
- Um projeto é iniciado normalmente (1) escolhendo um framework, (2) instalando um esqueleto, (3) removendo códigos de demonstração, (
# clone repo | |
git clone https://github.com/imarc/laravel-echo-example | |
cd laravel-echo-example | |
# install php dependencies | |
composer install | |
composer run-script install-tasks | |
# install npm dependencies and build | |
npm install |
# This is a sample build configuration for PHP. | |
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples. | |
# Only use spaces to indent your .yml configuration. | |
# ----- | |
# You can specify a custom docker image from Docker Hub as your build environment. | |
image: php:7.2.1-fpm | |
pipelines: | |
default: | |
- step: |
<?php | |
use App\Channel; | |
use App\Http\Controllers\BotManController; | |
use BotMan\BotMan\Drivers\DriverManager; | |
use BotMan\Drivers\Slack\SlackDriver; | |
use BotMan\Drivers\Slack\SlackRTMDriver; | |
use BotMan\Drivers\Telegram\TelegramDriver; | |
use BotMan\Drivers\Web\WebDriver; | |
$botman = resolve('botman'); |
One of my clients is a big company that has a very variable but predictable database usage pattern.
In the weekdays morning they come up with a huge amount of INSERTs and UPDATEs while for the rest of the day, form noon on,
the usage is fairly limited to a decent amount of SELECTs with very low writing activity.
The smallest class type that can handle the morning's volume is db.r3.large
but having such an instance running all day long and in the weekends is just a big waste of resources money
(or a big favour we do to Amazon, from their point of view).
So I was wondering if there's some autoscaling mechanism for Aurora writers (there is, but only for replicas),
When setting these options consider the following:
- How long is your average request?
- What is the maximum number of simultaneous visitors the site(s) get?
- How much memory on average does each child process consume?
sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
- I advice you to buy SSL Certs from officially Comodo only , or some SSL reseller whose you trust.
These are the steps I went through to set up an SSL cert. Purchase the cert
Prior to purchasing a cert, you need to generate a private key, and a CSR file (Certificate Signing Request). You’ll be asked for the content of the CSR file when ordering the certificate:
openssl req -new -newkey rsa:2048 -nodes -keyout example_com.key -out example_com.csr
#!/bin/sh | |
# Use as "after.sh" on the homestead repo and redo `vagrant reload --provision`. | |
# If you would like to do some extra provisioning you may | |
# add any commands you wish to this file and they will | |
# be run after the Homestead machine is provisioned. | |
wget https://xdebug.org/files/xdebug-2.5.5.tgz | |
tar xvzf xdebug-2.5.5.tgz |
<?php | |
/** | |
* Benchmarks BulkInserter at various batch sizes. | |
* | |
* Before running this script, make sure to: | |
* | |
* - set your PDO parameters in this file | |
* - run composer install | |
* - import setup.sql into your database |