comment-anything / proposal

Comment Anything Browser Extension
MIT License
0 stars 0 forks source link

Server Backend #5

Open Bkrenz opened 1 year ago

Bkrenz commented 1 year ago

Any proposals for the implementation of the backend for the database, user management, and associated APIs?

Some potentials include:

I'm partial to anything not JavaScript, and prefer the Static languages myself. Our use case is pretty basic, so there's not much reason to pick any one framework over the other. Just whatever we have more experience in overall would be my recommendation, which based on coursework likely points towards Java.

klm127 commented 1 year ago

I've done a little research and I suggest we look at Golang. Go is highly performant due to its super lightweight threads. It also compiles super fast so it will be easy to iterate. The whole language is built with back-ends in mind, and it's modern.

ASP.NET Core vs Go data ingestion benchmark

Why we moved from Kotlin & Spring to Go

REST API Performance Comparison Python vs Golang

Golang vs. Python — Which One to Choose?

Here are some useful go libraries. It supports memcache and Cassandra (a NoSQL db that's faster than relational dbs), both part of the old reddit stack.

I've never coded in Go before, but my experience is low in all these frameworks. I'd rather learn Go because I think it's more streamlined and powerful, and we will have a better, more efficient product in the end. Despite an initial learning curve, I bet it will be faster to write useful code. I don't believe it will be very hard to learn and it does have strong typing, even if it skimps on classes. I also think we should use Cassandra for the database because it performs reads and writes much faster.

Bkrenz commented 1 year ago

I've created a minimum working prototype in each of Spring, Django, and ASP.NET(/Blazor) over time, and they're all fairly similar. I will pretty much always side with choosing a statically typed language such as C# or Java over a dynamically typed one such as Python.

On the topic of NoSQL vs Relational DBs (such as Postgres), our data is fairly relational. Comments are associated with users, website URLs, other comments, and any other metadata we need to store, which leads me to believe a NoSQL solution does not make sense. I think the database technology we take is a separate discussion itself, but all of the major frameworks will support the major technologies out there. This decision is unrelated to the backend implementation we decide on.

I would also like to say that we should likely be focused on a complete, working prototype of a product. I find it unlikely that we would scale to any degree that requires any kind of performance benchmarks to be hit. I would expect our ability to develop efficiently in a technology we're familiar with to take a much higher priority that any performance issues.

LBytes-32 commented 1 year ago

Out of those four, I'm definitely most familiar with Python. However, that's simply because I've had multiple classes with that language. I'd personally enjoy learning a new language or framework. I believe we should also look in to Ruby on Rails. I found an article describing a few powerful libraries it supports. One of them being reCAPTCHA. That could be extremely useful if we wanted to prevent spam accounts.

klm127 commented 1 year ago

@Bkrenz As discussed in Discord, you're definitely right about Cassandra. Old Reddit used it for caching. It is faster than relational dbs but it can't replace relational dbs like I thought at first glance.

Re: working prototype. We have two semesters to create this project. That's a lot of time to make a truly excellent portfolio project that stands out. I am sure we can get an A grade if we just make the tutorial project for and add a few bells and whistles. And maybe this sounds arrogant, but I believe I could do that for any one of these frameworks alone over winter break.

But I'd really like to have something at the end here that a future senior developer who is considering hiring me could look at and say "Hey, this kids got potential!"

So let's make it scalable. Why would we ever not want anything serious we build IRL to not be scalable? And why not make it performant? If this is actually deployed on the cloud, even if the user base is small, every kb of processing power saved is $ saved.

I think we should look at this like a small business venture. That's how I'm viewing this. Like I mentioned before, if we build this well, we can form an LLC and monetize this, sell some ads, and maybe all earn some passive income at the end of the day. Probably it won't happen. But isn't that the right attitude to have?

Re: Developing in a tech we are familiar with. I don't think any of us are very familiar with any of these technologies. You may have spun up some small scale stuff with a couple of these frameworks, and I've played with Spring, Flask, and Node, but I don't think my knowledge is so great in any of those, that I couldn't catch up with Go or Ruby on Rails just over winter break. I mean it's one thing if we have a legit expert in one of these frameworks on our team but I'm not sure that's the case.

At the end of the day, I think the tech stack for the back end deserves considerable investigation that should probably be done in the Analysis phase. I don't think we should limit ourselves to frameworks and languages that we have experience in.

LBytes-32 commented 1 year ago

I've found an interesting YouTube series discussing back-end development using Golang, Postgres, and Docker. I'm going to spend some time looking through the videos. I'd appreciate if anyone else could provide some more helpful resources for everyone to look into.

Bkrenz commented 1 year ago

If we're choosing an implementation technology based on looking good as a project, then I suggest we follow along with industry standards. Just looking at any list of most popular languages:

Definitely need to steer clear of C/C++ and other lower level systems languages (like Rust), as we are building a web application. Go and Ruby rank below those.

While I like the idea of using performance benchmarks for decisions, considering we aren't attached to any specific technologies to start with, I find that thinking about performance at that level to be very premature. We have exactly zero idea what our performance requirements would be.

As for selecting a backend database, I still believe utilizing a relational database is the best idea. For our basic use case, they are all interchangeable. I'm not sure if we want to layer learning Docker on top of this, or if our usage would necessarily benefit.

If anything, I think we should be looking at our hosting options to determine the technology stack. C# more easily leans toward the Azure ecosystem, while AWS has amazing support for Java projects. We're likely looking at needing hosting for the backend and a static homepage. I think we need to consider what a finished prototype looks like in terms of UI and usage mockups and what features we want to support, before we consider the technologies backing it.