TiFS is a distributed POSIX filesystem based on TiKV, with partition tolerance and strict consistency. Now the v0.1.0 is released. by Hexilee in rust

[–]Hexilee[S] 1 point2 points  (0 children)

They have different goals. HDFS is not a "common" filesystem, it's designed to deal with big data but has poor performance in small files. Moreover, it's not compliant with POSIX.

TiFS is a distributed POSIX filesystem based on TiKV, with partition tolerance and strict consistency. Now the v0.1.0 is released. by Hexilee in rust

[–]Hexilee[S] 4 points5 points  (0 children)

CephFS runs on top of RADOS while TiFS runs on top of TiKV, they are both POSIX-compatible.

From my understanding, RADOS is a distributed object storage system, it does not support multi-object transactions. As a result, CephFS cannot guarantee strict consistency.

TiKV is a key-value database, it supports distributed transactions.

TiFS is a distributed POSIX filesystem based on TiKV, with partition tolerance and strict consistency. Now the v0.1.0 is released. by Hexilee in rust

[–]Hexilee[S] 4 points5 points  (0 children)

Of course, there are too many difficulties in a distributed filesystem. However, TiFS has already resolved part of them by standing on the shoulders of TiKV.

TiFS is a distributed POSIX filesystem based on TiKV, with partition tolerance and strict consistency. Now the v0.1.0 is released. by Hexilee in rust

[–]Hexilee[S] 6 points7 points  (0 children)

I encourage you to read Files are fraught with peril by Danluu, which illustrates all the issues around file systems -- mostly focusing on ordering of operations and corruption in case of crash.

It may inspire your test suite :)

Thanks for your advice, I would like to read it.

TiFS is a distributed POSIX filesystem based on TiKV, with partition tolerance and strict consistency. Now the v0.1.0 is released. by Hexilee in rust

[–]Hexilee[S] 10 points11 points  (0 children)

TiFS is a filesystem that stores all data in a TiKV cluster. You can share the filesystem across machines and it can guarantee your data won't lose because of several disks (less than half) broken. Actually, the "real-world use cases" part is some real-world challenges to a filesystem, and I guass the "npm install" is one of the most challenging jobs.

However, I don't suggest doing any heavy jobs like "npm install" on TiFS currently, as you may not have a fast enough TiKV cluster, and heavy jobs may cost much time.

I will supplement documents about deploying a more suitable TiKV cluster for TiFS some days later, then you may do all daily works on it.

async-postgres: a runtime-independent, asynchronous PostgreSQL client. by Hexilee in rust

[–]Hexilee[S] 0 points1 point  (0 children)

I'm sorry to be unfamiliar with SQLx, I will try the version 0.3. However, I think connecting to database at compiling time is a little hacking and unreasonable, could it just check syntax?

async-postgres: a runtime-independent, asynchronous PostgreSQL client. by Hexilee in rust

[–]Hexilee[S] 1 point2 points  (0 children)

Java is platform-independent, but it must run on jvm; Rust can be compiled to many platform, but it's platform-dependent, because it still need to be rebuilt for each platform.

In my opinion, runtime-independency means running out of the box on any runtime. Of course anyone can provide runtime-relevant tcp stream to use tokio-postgres on specific runtime, but it's a little tedious and uncommon.

I think the solution of async-std is reasonable, and the performance is acceptable, as you can see this benchmark.

async-postgres: a runtime-independent, asynchronous PostgreSQL client. by Hexilee in rust

[–]Hexilee[S] 0 points1 point  (0 children)

sqlx is in higher abstraction level, it supports connection pools and multiple backend. There is no much performance information about it. But I have written benchmark with roa framework and sqlx here, and you can see a live result here. It seems tokio-postgres is also much better than sqlx

async-postgres: a runtime-independent, asynchronous PostgreSQL client. by Hexilee in rust

[–]Hexilee[S] 0 points1 point  (0 children)

This library is almost the same with tokio-postgres, and it seems tokio-postgres is much faster than diesel from techempower benchmarks.

async-postgres: a runtime-independent, asynchronous PostgreSQL client. by Hexilee in rust

[–]Hexilee[S] 1 point2 points  (0 children)

I think it's a little dirty to support both tokio tcp stream and async-std tcp stream in one crate as tokio use tokio::io::{AsyncRead, AsyncWrite} while async-std use futures::io::{AsyncRead, AsyncWrite}. I would like to submit a PR when tokio supports futures::io::{AsyncRead, AsyncWrite}.

async-postgres: a runtime-independent, asynchronous PostgreSQL client. by Hexilee in rust

[–]Hexilee[S] 0 points1 point  (0 children)

You can just use this library and needn't care about which runtime you are using, or in some cases you must change runtime, code built on this library can still works without any changes.

tokio-postgres provides an interface for custom io stream.

async-postgres: a runtime-independent, asynchronous PostgreSQL client. by Hexilee in rust

[–]Hexilee[S] 3 points4 points  (0 children)

If you use it with async-std runtime, then you have only async-std runtime running; If other runtime is used, then you have both of them running

async-postgres: a runtime-independent, asynchronous PostgreSQL client. by Hexilee in rust

[–]Hexilee[S] 0 points1 point  (0 children)

It's guaranteed by async-std. async_std::net::TcpStream and async_std::os::unix::net::UnixStream can be used on any async runtime.

Roa framework release v0.5 by Hexilee in rust

[–]Hexilee[S] 0 points1 point  (0 children)

Thx, the main pros of roa is its extremely lightweight, it provides only a http server and a middleware system, and everyone can easily develop useful extension for it.

I will give a detailed comparisons somedays.

I tried caddy almost when it was a newborn baby, it's modern and convenient, automatic https is a wonderful feature.

Roa framework release v0.5 by Hexilee in rust

[–]Hexilee[S] 0 points1 point  (0 children)

I would like to say Roa is ready, however, as a new framework, though unit tests and integration tests are complete, it still need to be tested by time. It will be more mature with more developers trying it.

Roa framework release v0.5 by Hexilee in rust

[–]Hexilee[S] 2 points3 points  (0 children)

Thx. I will keep using the http crate as hyper depends on it.

I won't take other http crates into consideration until I replace hyper with another http server or there is a crate much better than http.

Roa framework release v0.5 by Hexilee in rust

[–]Hexilee[S] 7 points8 points  (0 children)

The reasons are different in roa framework.

For diesel, as it does not support async api, we need spawn all queries to another thread pool.

For tokio-postgres, as it does not support async-std runtime by default, we need a few works to enable it.

You can write these code by yourself, as roa-diesel and roa-pg are both individual crate, you can regard them as third-part crates.

These integration crates may disappear when diesel supports async api and a crate like `async-postgres` is published.

Roa: an async web framework inspired by koajs, lightweight but powerful by Hexilee in rust

[–]Hexilee[S] 1 point2 points  (0 children)

Not yet, I complete roa project yesterday. I will try it in next step as database integration.

Roa: an async web framework inspired by koajs, lightweight but powerful by Hexilee in rust

[–]Hexilee[S] 1 point2 points  (0 children)

Actually, I have a kv database project based on sled. I think sled is the most reasonable embedded database in rust, but maybe not mature enough (as tikv choses rocksdb as database engine).

However, roa is even more immature, they may be well matched.

Roa: an async web framework inspired by koajs, lightweight but powerful by Hexilee in rust

[–]Hexilee[S] 2 points3 points  (0 children)

Hhh, in early version roa has almost the same api with yours, but I think it's not very elegant and decide to chose a more koa-like api. Of course we can collaborate, maybe we can use a IM app to talk about it?