yaseenkadir / etchedjournal

An encrypted journal where entries are etched in stone.
Apache License 2.0
0 stars 0 forks source link

Select production architecture #21

Open yaseenkadir opened 6 years ago

yaseenkadir commented 6 years ago

Various choices can be made regarding the architecture of the chosen system. Below is a list of ideal features/requirements. These requirements are likely at odds with each other and we will likely only be able to achieve a few of them.

  1. Developers must be able to easily test the app locally
  2. Not super expensive
  3. Users can self host
  4. Deployment is automated
  5. Automated scaling

Developers must be able to easily test the app locally

As a developer I want to be able to click a run button e.g. in IntelliJ and run the app with minimal dev configuration. There MUST NOT be much more than that.

Not super expensive

As a Yaseen I don't want to spend thousands of dollars a year on a side project so that I still have money in the future.

Users can self host

As somebody who values privacy I want to be able to self host my own version of Etched Journal so that I can reduce the chances of an attacker gaining access to my private journals.

As I typed this I realised how important it is. If somebody else developed an encrypted journal there's no way I could trust it.

Deployment is automated

As an operator I want deployment to be automated so that I don't have to manually perform complicated and risky steps.

Deployment should basically be ./deploy.sh.

Automated scaling

As an operator I want Etched Journal to automatically scale so that it can handle small to medium workloads e.g. 10s of requests per second.

Thousands of requests per second is out of scope. At that point we can revisit architecture.

As a buzzword enthusiast I want Etched Journal to scale so that I can say that Etched Journal is scalable, elastic, highly available, fully encrypted, blockchain (there are no blockchain features but buzzwords are cool)

yaseenkadir commented 6 years ago

I'm most familiar with AWS so I'll be using AWS terminology in the examples below.

Classic

The classic architecture. N-tier (but web and app are together). We'll have application servers running on EC2 instances which communicate with a relational database e.g. RDS.

Pros

Cons

Going this way we'd either bake AMIs that have the application preinstalled and run them automatically or store the application in S3 or something and download them on boot and run.

Classic/Docker

Same as above but instead of using AMIs or application zips or whatever, we pull in a docker image and start running.

Pros

Cons

PaaS

Using a PaaS where we upload the source/build files directly and have the cloud provider take control of infrastructure.

Pros

Cons

(I'm also unfamiliar with Elastic Beanstalk)

Serverless

Going serverless. This definitely requires more investigation and would likely require a backend rewrite. But I've been using it at work and I'm really happy with how its been working out.

Pros

Cons

(WIP)

yaseenkadir commented 5 years ago

Strongly leaning towards a fargate deployment model. I don't want to manage ec2. I've played around with it and it's quite nice.

Don't really want to deal with building AMIs and what not.