What is Socratic's engineering stack?
What's a stack?
A lot of pieces of technology are required to deliver a website to you, and they perform a variety of functions, including:
- Creating pages in a browser or app, styling them (color, fonts), and making them interactive (e.g. turning the heart red and showing a comment box when you click on it). This is called the front end, or client-side
- Gathering the information needed for a page (e.g. the question, the answer, the user names and pictures, the number of hearts), and sending it to your computer or phone. This is called the backend, or server-side
- Storing this information so it's available any time it's needed, and allowing us to search for exactly the information we need. This is called the database, or datastore
- Computers connected to the Internet and always on so anyone can access the website at any time. The computers are called servers and they are hosted somewhere.
- Many other critical and minor functions
At each of these layers, a number of good options are available and the choices any one team makes are based on the experience and comfort of the team members, as well as practical matters like cost and specific performance requirements.
Our (almost) full stack
Some technologies are installed, updated, and managed by members of our team on our own servers and laptops. They include:
- Compass to reuse and organize our CSS
- Flask, a Python framework to serve the JSON+HTML API and to render full HTML pages
- pyres for our task queues (likely Celery soon)
- MongoDB to store our data (possibly Postgres soon)
- Redis to cache things like the feeds around the site, trending questions, and all kinds of usage stats
- ElasticSearch to power search
- Nginx to serve the site
- Capistrano to deploy our app and perform a few other helpful tasks
- Puppet to set up the software we need on new servers
Some technologies are services built and managed by other companies. It's often more efficient to let someone else focus on specific problems instead of doing everything ourselves. Some services we use are:
- AWS aka Amazon Web Services to host our servers, static assets, and as a CDN
- Cloudflare for DNS, caching, and some level of security
- Google Analytics and Mixpanel for analytics
- Papertrail for centralized logging
- Sentry for tracking client-side errors
- DataDog for monitoring our servers and services
- New Relic for monitoring the Flask app's performance
- Customer.io to send emails based on what you do or don't do in the app
- Github to for code collaboration and hosting
And probably many others.
It takes a lot of pieces to build and operate a website, but with the help of well built tools, it's not so hard!