283 karma · joined March 21, 2011
simon@fet.io
meet.hn/city/se-Sundsvall
STUPS looks interesting. What scares me a bit about these suites that provide many abstractions on top of AWS is how they work in mixed environments where some resources have been set up and are managed out-of-band. I understand that the purpose of STUPS for example is to provide a higher-level interface to AWS, and that having many AWS accounts avoids these mixed environments.
Perhaps it's just me suffering from analysis paralysis. I kind of want there to be one or two leading suites of AWS PaaS tools to choose from, whereas the market today seems fragmented with new tools popping up all the time. For the moment I'm betting on HashiCorp. :)
Maybe I have missed some developments in AWS world, but in the screenshot of the AWS Console it says you are logged in as ops-admin @ segment. So you have one AWS account with alias set to segment, right?
Do you use an identity provider to be able to log in as calvin and is ops-account a user in your AWS account named segment? And is ops-account in the segment AWS account then allowed to assume roles in your three other AWS accounts for dev/stage/prod?
If you switch to ops-admin @ stage for example, and then go to the S3 page in the console, will you get a listing of all buckets in the stage AWS account even though your login session as calvin "belongs" to an other AWS account (segment)?
Sorry if my questions are confusing. I am very interested in knowing what the relationships among the identity provider, AWS accounts, and roles look like.
We also separated the main backend/API codebase from the frontend mostly because the frontend devs work prefer to work within the Node ecosystem instead of Python/Django and so that we don't have to think too much about synchronizing deployments. The tests for the backend code take quite long to run as well compared to the frontend tests, so having this separation is nice for the frontend devs that way too.
What I some times would like to have better infrastructure support for though is throwaway prototypes/projects that can live in their own codebases and have access to all the regular databases, blob storage and so on, as well as databases that are private to the prototype that I can do whatever with with no risk of doing something bad to the important databases/storage.
I would also like these prototypes to be able to register themselves with the load balancer to take care of everything under `/halloween-experiment/` for example and have the load balancer add headers like `X-UserEmail`, `X-UserID`, `X-IsEmployee`, and so on so that I don't have to implement authentication/authorization in every prototype.
Today these types of prototypes need to live next to the "important" code so that they can use the same CI pipeline and easily be made public or visible to employees and use real data.
I'm following projects like https://getkong.org/ with interest, and together with everything happening around Docker such as EC2 container service or Kubernetes, as well as projects for service discover/configuration like etcd or Consul, it feels like we're getting there. There are just so many projects to keep track of, and you need to figure out how to make them all part of your CI pipeline. :)
To serve different assets in dev and prod I let gulp generate a manifest and have a custom template tag in Django that expands to different paths depending on settings.DEBUG:
{% my_static 'css/all.css' %}
expands to either /static/css/all.css or something like /static/css/all.min.abcd1234.css.If nginx is serving a minified, hashed path it adds a Cache-Control: max-age=31556926 header to the response.
I often try out new new web dev platforms and frameworks but tend to rewrite projects that get too serious or large in Django, or when I'm starting to miss too many features.
If I know that I am building something that others are going to work on, or if I know that the project will need to be maintained for a considerable amount of time, I tend to go with Django and a few familiar libraries (Celery, Django REST framework, django-extensions) right off the bat, as I feel comfortable that we won't run into issues where some important dependency becomes unmaintained or introduces backwards-incompatible changes. Much thanks to Django's predictable and well thought out releases.
Further, when I pick Django, I know that there is good support in monitoring and crash report systems such as Sentry, New Relic, and others. So that's one less thing to worry about.
The only area where I have started to use other solutions is frontend dev, as I find that the momentum in the Node community is so much higher in this area. I only wish that the Node community wasn't as fragmented and had a more long-term view on releases.
I was intrigued reading about the plans for alert support. Any pointers on where to start looking for somebody that may want to help build it? :)
Would love to buy a coffee or beer some time in Stockholm.
We added it to the mix because it got increasingly difficult to tune SQL queries involved in building API responses, especially for endpoints that needed to pull data from many tables.
Our limited experience of MySQL operations was also a factor. We're on 5.5 and couldn't do some table operations that seemed promising without service disruptions. There were solutions to perform the actions we wanted without downtime but they scared us a bit. We also looked into upgrading to 5.6 or MariaDB but that seemed like it would take a long time and need much testing, while there were no guarantees that we would see performance gains.
We looked for alternative solutions and found RethinkDB. We reused the parts that serialize data for the API and put the resulting documents in RethinkDB. Then we had our API request handlers pull data from there instead of from MySQL and added indexes to support various kinds of filtering, pagination, and so on. We built this for our most problematic endpoint and got the two-server cluster up and running in about a week, tried it out on employees for another week, and then enabled it for everyone (with the option to quickly fall back to pulling data from MySQL).
This turned out to work well and we saw good response times, so we did the same thing for other endpoints.
There's some complexity involved in keeping RethinkDB docs up to date with MySQL (where writes still go) but nothing extreme and we haven't had many sync issues.
RethinkDB has been rock solid and it's a joy to operate.
Feature-wise it seems close to Flask. I suspect that Flask is more opinionated than Falcon: it requires the Jinja2 template library and your project may end up with a tight coupling with Flask if you use its blueprint system or don't think through how you use Flask's context variables flask.request and flask.g (Flask tries to be too clever here IMO).
Falcon looks more like a library than a framework to me and its design seems less likely to affect how you structure projects compared to Django in particular but also Flask.