Facebook uses a LAMP stack with additional services and customizations for its architecture. PHP and MySQL are used for the main web and data tiers but have limitations for large scale. Services are implemented using Thrift for cross-language communication and Scribe for distributed logging. Services allow storing code closer to data and using optimized languages. The News Feed and Search architectures distribute work across tiers with Thrift calls and aggregate data using services.