The document discusses how to write a scalable Symfony application in the cloud. It covers upgrading points like database connections, file uploads, session storage, local development, and deploying. Database connections should use a master-slave configuration. File uploads can use Amazon S3 for storage. Sessions can be stored in a database. Local development differs from production. Deploying can use SVN update or checkout with symlinking. Automation helps deployment.
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Symfony in the Cloud
1. Symfony in the Cloud
Kris Wallsmith
February 17, 2010
Wednesday, February 17, 2010
2. Kris Wallsmith
• Freelance web developer, • JavaScript (moo)
consultant, training, audits...
• @kriswallsmith
• 10 years using PHP
• CTO of Nebul.us
• 3 years using symfony
• Author of (too) many plugins
• 1 year on symfony core team
Wednesday, February 17, 2010
4. What is Nebul.us ?
• Nebul.us is a vibrant and visual life aggregator. In real time you can see
what your friends and the public are sharing and discovering online!
• Passively share what you’re doing online
• Show don’t tell
Wednesday, February 17, 2010
7. What is Nebul.us really?
• Symfony Framework
• Doctrine ORM
• Zend Framework
• Swift mailer
• and more…
Wednesday, February 17, 2010
8. What is Nebul.us really?
• Web site
• XML services (Flash and Atom)
• JSON services (browser plugins)
• Up to 12 requests per minute when browsing
Wednesday, February 17, 2010
13. What is “The Cloud”?
• Adds a (big) black box to your stack
• Several virtualized resources
• Scale based on the level of traffic
• Pay only for what you use
• Elastic!
Wednesday, February 17, 2010
14. It’s cloudy out there
• Amazon
• Rackspace
• Microsoft
• Rightscale
Wednesday, February 17, 2010
26. Database Connections
• One writable “master” connection
• One or more read-only “slave”
connections
Wednesday, February 17, 2010
27. Managing Connections
• Organize read and write connections
using a naming convention
• Choose a random read connection
Wednesday, February 17, 2010
34. Configure Doctrine
• Set custom query and collection class
attributes in manager
• Set custom record class in builder
options
Wednesday, February 17, 2010
84. Deploy with svn update
1. Disable
2. Update the working copy
3. Rebuild model files
4. Migrate the database
5. Enable
Wednesday, February 17, 2010
85. Deploy with svn checkout
1. Checkout a fresh working copy
2. Setup files not in the repository
3. Build model files
4. Disable current working copy
5. Migrate the database
6. Update symlink
Wednesday, February 17, 2010
86. Deploy with svn update
1. Disable
2. Update the working copy
3. Build model files
4. Migrate the database
5. Enable
Wednesday, February 17, 2010
87. Deploy with svn checkout
1. Checkout a fresh working copy
2. Setup files not in the repository
3. Build model files
4. Disable current working copy
5. Migrate the database
6. Symlink the new working copy
Wednesday, February 17, 2010