AWS Cloudfront and Dynamo DB

Is it possible to use Phalcon with AWS CloudFront and with AWS Dynamo DB as the database?

Hi) My opinion is Use can include Amazon SDK and write Db Adapter Class Docs here http://docs.phalcon.io/en/latest/api/Phalcon_Db_Adapter.html And then set it in di like

use App\Db\Adapter\AmazonDB as DbAdapter;
$di->set('initDb', function() use ($config) {
        $connection = new DbAdapter($config['database']);
        return $connection;
});

And then u can use Models insteand of \Phalcon\Mvc\Model Good luck in the implementation

Thank you very much, will try this.



17

Does anyone have an update on this?



647

Has anyone had any luck with this?

I would like to develop an DB adapter for DynamoDB as well but am not able to find a lot of documentation on creating custom adapters.

What you guys are asking is pretty much 99% not feasible. The reason being is that Phalcon is an extension not pure PHP code.

In PHP applications I can install composer and with it I can pull composer related packages such as the AWS SDK. Composer's autoloader will allow me to use any namespaces that AWS offers.

Phalcon has everything compiled and is written in Zephir. So for us to offer functionality to replace the model class allowing you to use say DynamoDB, we have to make Phalcon aware of the AWS related classes. This requires us to write all those classes in Zephir and then compile them in Phalcon. Alternatively if we just add the reference, for a particular AWS class/namespace, Phalcon will require that class in every single request. This is how Zend Engine was written. Doing so will force all users to install the AWS SDK even if they do not use it.

The best way to go about this is to register your own database adapter pointing to Dynamo DB and create model classes that work with that store. They will not be Phalcon models but that will make it work.