Just a thought. I have wondered what would the best approach in making Dolphin truly scale to handle 1M users easily. Let's be honest, when we first made ideas to scale our social networks we didn't think that some of us would strike it big and then have to handle a large load. Well, I didn't at least. needless to say I strongly have to consider moving away from using dolphin (though I really like it) to move into a refactoring process.
What I am asking is if you were a team and had to move your dolphin instance from a monolithic app to a more Service Oriented Architecture (SOA), where would you start? What if you need to move more toward Microservices, where would you start?
So far, I have thought out the following and please help me understand if I am wrong.
Step 1: First make sure that your dolphin instance is Scale-able. This meant ditching the LAMP Stack :(
To do this we had to moved all our stack from the traditional LAMP (of course) to a newer stack. Everyone is talking about MEAN stacks but I started with something close to the Dolphin systems.
Where we landing was a stack that moved away from Apache as a primary webserver. There's a good book by Steve Corona call "Scaling PHP" ... he said the following:
After lots of trial and error, I’ve found what I think is a generic, scalable stack. Let’s call it LHNMPRR… nothing is going to be as catchy as LAMP!
This stands for:
Linux, HA Proxy (or NGINX LB), NGINX Web Server, MySQL (Percona), PHP-FPM, Resque (or RabbitMQ, NSQ)
Step 2: I needed to make dolphin more Distributed: API Work, and Data Files
EVERYONE DON'T HAVE TO DO THIS - Since we made a gang of custom modules in dolphin, we wanted to make sure that we can have a faster site. So we split the frontend of the site and made some changes in a custom template (will spare the details here) and we made EVERYTHING speak through and API. Basically we turned all our modules into API's. This help with our mobile apps as well.
Data Files: We moved away from the RTMP and FFMPEG and Local uploading of media files and used a Third party service for all video converting and storing (Like AWS CDN or Rackspace CDN) Also we pulled out all the Unstructured data (avatar images, photos, video, etc) and used Blocked storage. This was and is still a pain.
Step 3: Queue & Cache, Cache Cache
I can't say it enough. We had to master the queue & caching process of all the little items like commenting, likes, etc. This is done by using a message queue system and redis (or memcache)
I know this is a lot and i wanted to be brief. But my question is this. to truly move into the next generation of application development can someone like me form an exit strategy and move toward decoupling my dolphin core? What should be my approach if I need my site to move more into a microservice platform so that we can go big? Will dolphin ever move into this new future on the horizon?