by kaplandj on April 27, 2017
ISDB.IO Infrastructure.
The site is hosted on AWS. M4 Large in US East running everything. I decided to start to make my life easy. So Postgres and Laravel PHP pieces are on same machine. No reason to scale early and the machine is big enough to make early going perform fine. The API and Web Application are deployed together for now, but are easy to split apart.
So I also used Laravel Forge in an effort to save time. I’m a big fan of one click deploys. But here is where it failed me miserably. One thing I wish Taylor would enhance is the EC2 instance choices. They are very limited currently. So the instance I picked was not in the list, which led me to use Matt Stauffer’s tutorial for custom VPS’s.
The other gotcha was the SSL Cert. This just didn’t work out for me in Forge. I seem to be going round and round chasing my tail. I wanted to put the main server behind a load balancer and use letsencrpyt.org. That was not a good option under Forge. Putting the SSL cert on the load balancer seemed like a smart thing to do. A quick email to Forge support and Taylor suggested I use the AWS Load Balancer directly. Outside of Forge. That was a good idea and on top of it Amazon gives you free SSL certs.
Note: you do need to setup Laravel App to play nice (cookies) behind the load balancer. Use this Truster Proxy Package and you are good to go.
So in the future scaling this app by breaking putting more instances in front of db will be easy. I could use AWS and let it spin up snapshots automatically. Now all we need is more traffic.
by kaplandj on April 26, 2017
So I used the following tools to develop http://isdb.io.
Algolia
Had a need to index tons of data and provide a great user experience for searching this data. Algolia really is a great product. My only complaint is that it’s pricey. I’ve used Elastic Search in the past. This is a much better product from top to bottom. Integrates well with Laravel, although I ran into some issues that forced me to use their PHP lib.
Postgresql
The DB. I knew this existed back when, but came on my radar when I listened to the Three Devs and a Maybe Podcast. I was struggling using Graph Dbs. (More on this in a future podcast: Why I hate Graph Dbs?) . The ISDB.IO Graph is for the most part one or two levels deep. Who played for what team, events for a team, who wrote about that player, and so on. Graph db’s were so hard to use so I finally raised the red flag of surrender. Back to the fundamentals. Good old SQL relational dbs.
The kicker here is the JSON columns types that were introduced into Postgresql a while back. What makes Graph Db’s so great is the ability to assign non-structured Properties (data) to any vertex or edge. Basically you get free key pairs or a Mongo in any table with the JSON column types. After that the schema for the graph is pretty simple. Performance is good so far and more things can be done in future to help that.
Laravel
The brain child of the wizard Taylor Otwell this is the best framework I’ve ever used. Clean design, all facets of development covered, and a great community to boot. I also developed a full API using Laravel for ISDB.IO, as well as the front end. I’m a real fan of this and look forward to doing more projects with it.
Throw in tons of PHP code written with the Sublime Editor and there you go. The Stack is simple when you look at it, but the site is deep and ambitious. Granted ISDB.IO has a long way to go since its’ only a beta currently. I’m working to deploy more updates and will keep you posted on our progress.
Cheers!