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.
Mcleodganj Call Girls 𼰠8617370543 Service Offer VIP Hot Model
Â
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 trafďŹc
⢠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
30. Extend the Doctrine ORM
⢠Use the appropriate connection
⢠Doctrine_Query
⢠Doctrine_Record
⢠Doctrine_Collection
Wednesday, February 17, 2010
34. ConďŹgure Doctrine
⢠Set custom query and collection class
attributes in manager
⢠Set custom record class in builder
options
Wednesday, February 17, 2010
69. View Layer
⢠Nothing magic
⢠Custom helper function that uses the
conďŹgured upload read path
⢠Search and replaceâŚ
Wednesday, February 17, 2010
81. Local Development
⢠One database
⢠Save uploads to the local ďŹlesystem
⢠Present correct upload path in view layer
Wednesday, February 17, 2010
84. Deploy with svn update
1. Disable
2. Update the working copy
3. Rebuild model ďŹles
4. Migrate the database
5. Enable
Wednesday, February 17, 2010
85. Deploy with svn checkout
1. Checkout a fresh working copy
2. Setup ďŹles not in the repository
3. Build model ďŹles
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 ďŹles
4. Migrate the database
5. Enable
Wednesday, February 17, 2010
87. Deploy with svn checkout
1. Checkout a fresh working copy
2. Setup ďŹles not in the repository
3. Build model ďŹles
4. Disable current working copy
5. Migrate the database
6. Symlink the new working copy
Wednesday, February 17, 2010