Better HN
topnewbestaskshowjobs
Log inSign up

xyheme

76 karma · joined Jun 21, 2020 (6y ago) · 66 submissions

https://xieyuheng.com
Submissions

1.

Ask HN: Node v.s. Deno v.s. bun which will win in the end?

1 points · by xyheme · 3y ago · 1 comment

2.

Yantrajs: Another Competitor with Node.js(github.com ↗)

1 points · by xyheme · 3y ago · discuss

3.

Ask HN: Is it ok to use CamelCase naming convention in C code base?

1 points · by xyheme · 3y ago · 4 comments

4.

Show HN: Using File System as Database(readonly.link ↗)

4 points · by xyheme · 3y ago · 1 comment

comment 3y ago · link · parent

directory tree is not as easy to view and edit as JSON.

One big JSON file is harder.

I am not fancy, and the aim is to simply use file system as database.

Not fancy stuff like "database as file system as database".

comment 3y ago · link · parent

Me and a lot of linux user friends are using btrfs.

comment 3y ago · link · parent

I should thought about that.

comment 3y ago · link · parent

Isn't WinFS the reverse of "file system as database"?

Which is "database as file system".

comment 3y ago · link · parent

That all can be achieved by using file system as database.

Not even complicated to implement.

See couchDB for how to handle "what if two people are editing a file at once".

comment 3y ago · link · parent

JSON is there for human to read a record of data by group.

I think it is only good to use directory as data table to store JSON data files, but not for JSON data properties.

comment 3y ago · link · parent

Inode limits depends on the file system you use.

I am using Btrfs.

Btrfs inode limits is in a whole different league (whereas ext4's inodes are allocated at filesystem creation time and cannot be resized after creation, typically at 1-2 million, with a hard limit of 4 billion, btrfs's inodes are dynamically allocated as needed, and the hard limit is 2^64, around 18.4 quintillion.

> -- https://unix.stackexchange.com/questions/18388/what-are-the-...

comment 3y ago · link · parent

> The main reason is that I can use a variety of tools to view and manipulate files.

This is also the reason I am researching this old "What if" problem.

Because I think comparing to some version of MySQL or PostgreSQL, files are stable, open and timeless.

comment 3y ago · link · parent

Thanks for the reminder about meaningful pathnames :)

comment 3y ago · link · parent

Thanks for the link.

I read it, and I think it describes bad ways of using file system, but there are also good ways.

Just like there are bad ways of using SQL databases, and there are also NoSQL, and bad ways of using NoSQL databases.

comment 3y ago · link · parent

So that I can use subdirectory to model "has many" relationship, like "a user has many projects".

comment 3y ago · link · parent

I think, unless column-oriented database is used, "one file per row" is similar to normal row-oriented database.

Maybe there are some benchmarks in the past.

comment 3y ago · link · parent

Why not use one JSON file as one record of data, and use pathname as primary ID?

comment 3y ago · link · parent

@jqpabc123

I agree.

We (developers) should also design tools to address the need of small scale web apps.

Maybe, we do not even need some general tools to use file system as database, just speak this method more often.

19.

Ash HN: What if we use file system as database?

11 points · by xyheme · 3y ago · 39 comments

comment 3y ago · link · parent

Thanks, I now learn double content s have this effect on SEO :)

comment 3y ago · link · parent

Hi, it's you again :)

My aim is to build a open-source mini vercel and netlify alternative.

`x-server` is just a starting point.

I have even more "evil" projects, like "using file system as database", I will leave that for another Show HN :) :) :)

comment 3y ago · link · parent

I enjoy the criticism, I think I can learn things from them.

So far, feedback here are helpful to me.

Sorry about the mis-deleting.

comment 3y ago · link · parent

Sorry about that, I was migrating my websites and repo out of vercel (to use this tool), during which I deleted a lot of outdated github repos.

I thinks I accidently deleted this repo.

Now it is back: https://github.com/xieyuheng/x-server

24.

Show HN: Deploying subdomain-based routing like github.io(github.com ↗)

55 points · by xyheme · 3y ago · 52 comments

comment 3y ago · link · parent

> ... when it comes to node rearranges, which, frankly, I didn't quite get.

I removed the syntax of rearrange, and added a new builtin `@spread`, I hope it is less confusing now :)

comment 3y ago · link · parent

Caddy looks very complicated.
123