News for hackers. Stuff that matters.
Re:Ask HN: Companies of one, what is your tech stack? by Fornax96 on Wednesday August 25, 2021 @12:44PM (#28303804)
Proxying the files has a number of benefits.

- The first is that I can have all my API endpoints under one domain. This simplifies downloading as you don't need to make a separate request to figure out where the file is stored.

- The storage servers that Hetzner sells only have 1 Gbps bandwidth. That runs out very quickly when a file goes viral. The 10 Gbps caching servers do a lot of heavy lifting here, this makes sure the disks in the storage nodes last longer.

- I can also decide to switch to a different storage system on my storage nodes when I want. I have been considering to deploy reed-solomon encoding for a while. That would make it impossible to link directly to a single storage server as a single file would also be distributed.

- Sending out this much data uses a lot of RAM for TCP send buffers. Installing this RAM on a single content delivery node is cheaper than installing it on every storage server.

To prevent the bandwidth load from affecting the UI speed I have a rate limiter on the download API which slows down when the uplink reaches 95% capacity. This way there is always some bandwidth left for the HTML and database communications.

With regards to content delivery: I want to use pixeldrain to serve static files. Nothing like the fancy site-wrapping tech that cloudflare uses. The idea is that users can have a file tree on pixeldrain somewhat like dropbox. They can copy the direct download link to that file and use it to embed videos, audio and pictures in their own websites. Because this is a lot simpler than other CDN services I can offer it at a very competitive price.

Re:Ask HN: Companies of one, what is your tech stack? by ddorian43 on Friday August 27, 2021 @06:27AM (#28326088)
> That would make it impossible to link directly to a single storage server as a single file would also be distributed.

Check out https://github.com/chrislusf/seaweedfs/ implementation of reed solomon. Small files can still be served from 1 server.

It's also efficient for small files, which a image store requires.

Re:Ask HN: Companies of one, what is your tech stack? by Fornax96 on Friday August 27, 2021 @06:39AM (#28326155)
I have been looking at seaweedfs for a while. I suffer from a pretty bad case of NIH Syndrome, so my gut feeling says I should implement it myself. But seaweed is such a good fit that I should probably just try it.

I especially want to know how well it deals with adding / removing servers, data loss and network instability. The beautiful thing with writing my own solution is that it takes at most 10 minutes to diagnose and fix a problem when it occurs.

Re:Ask HN: Companies of one, what is your tech stack? by chrislusf on Tuesday August 31, 2021 @01:30AM (#28364273)
I have the same syndrome. But I feel seaweedfs should be easy enough to be picked up. If you have any questions, just let me know.
Re:Ask HN: Companies of one, what is your tech stack? by Fornax96 on Wednesday September 01, 2021 @04:03AM (#28377410)
Hey, I was trying out Seaweed yesterday. I ran into an issue with HTTPS, it seems to be not very well supported at the moment.

I managed to get it running mostly secure, but replication didn't work because the volumes were calling eachother with HTTP instead of HTTPS. The HTTP request is hardcoded here: https://github.com/chrislusf/seaweedfs/blob/43fd11278ef81185... and probably in a lot of other places.

I even tried setting the address of the volume to https in the startup script, but then it makes a request to http://https://volume1.example.com and it still fails.

I also noticed that the master API is still available over HTTP even when HTTPS is enabled. I can make an issue for these things if you want.

These issues are currently the only showstopper for me. I need to have every endpoint on TLS with peer verification enabled. If you can get it fixed I will gladly continue testing seaweedfs and support you on Patreon :-)

Re:Ask HN: Companies of one, what is your tech stack? by ddorian43 on Friday August 27, 2021 @10:23AM (#28328157)
You can contribute to it and learn it along the way. Pretty flexible.