※当サイトの記事には、広告・プロモーションが含まれます。

仮想ファイルシステム(Virtual File System)とは?

www.itmedia.co.jp

 米Amazon Web ServicesAWS)は、実験的な実装としてサーバレス環境のAWS Lambdaで使うことにフォーカスした軽量なJavaScriptランタイム「LLRT」(Low Latency Runtime)をオープンソースで公開しました。

AWS、高速起動にこだわった軽量なJavaScriptランタイム「LLRT」をオープンソースで公開 AWS Lambdaでの利用にフォーカス - ITmedia NEWS

 LLRTの最大の特徴は、現在のJavaScriptランタイムにおいて性能向上のために搭載されているJITコンパイラをあえて搭載せず、よりシンプルで軽量なランタイムとして実装することで高速に起動することにこだわっている点です。

AWS、高速起動にこだわった軽量なJavaScriptランタイム「LLRT」をオープンソースで公開 AWS Lambdaでの利用にフォーカス - ITmedia NEWS

 これにより(Node.jsやDenoやBunなどの)既存のJavaScriptランタイムと比較して起動速度が10倍高速で、AWS Lambdaでのコスト低減効果が最大で2倍になっていると説明されています。

AWS、高速起動にこだわった軽量なJavaScriptランタイム「LLRT」をオープンソースで公開 AWS Lambdaでの利用にフォーカス - ITmedia NEWS

⇧ Bunよりパフォーマンス良いとか驚愕なんですが...

と思ったら、「LLRT」は、あくまで起動時間に焦点を当てているようなので、サーバレスに特化してるってことみたいね。

語弊を招きやすい紹介だなぁ...

改善してくれるのは素晴らしいのだけど、

aws.amazon.com

Q: AWS Lambda 関数はどれくらいの時間実行できますか?

AWS Lambda 関数は、1 回あたりの実行時間を最長 15 分に設定することができます。タイムアウトは 1 秒から 15 分までの間で任意に設定できます。

https://aws.amazon.com/jp/lambda/faqs/

⇧ どちらかと言うと、実行時間の最長の制限を撤廃して欲しい気はしますな...

大量のデータを処理する月次処理とかのバッチなんかだと、15分じゃ終わらないものな...

日時処理なんかは、

tech.yappli.io

⇧ 上記サイト様によりますと、条件によっては、15分以内に収められそうではありますと。

参照系のSQLの結果をファイルに分割して保存しておいて、ファイルからレコードを読み込んで、更新系のSQLを実行していくようですが、参照系のSQLはRedshiftの機能で良しなにStream的に処理されてる感じになってるんかな?

だとすると、Redshiftありきのアーキテクチャになる感じですかね。

大量のデータを一括で取得してきて、そのまま変数に格納してからファイルに書き込みだと、変数に格納する時点でOutOfMemoryErrorが起こりそうだものね。

仮想ファイルシステム(Virtual File System)とは?

Windowsエクスプローラーのようなことをブラウザで実現したいなぁ、と。

イメージとしては、Google DriveやBox Incのサービスのようにブラウザでファイルシステムにアクセスできる感じ。

WinSCPのようなことをブラウザで実現したいってことですな。

で、Box Incのブログで、

Virtual Filesystem, and the origins of Box Drive

A virtual filesystem (VFS) is an abstraction layer on top of the actual filesystem implementations (such as the default filesystem for your OS) that allows client applications to interact with these filesystems in a uniform way, using the same APIs -- In other words, applications such as Finder, Microsoft Office, etc. can use the same filesystem APIs standardized by the VFS layer, which then routes these calls to the appropriate filesystem implementations. Filesystems, therefore, have great flexibility on how the data is accessed and presented, as long as they implement a standard VFS interface. While most filesystems interact with a hard disk, the VFS layer allows for filesystems that get data from some other source! Here are some interesting filesystems that have been developed over the years:

  • SSHFS: Presents files and folders in a user-specified directory just like a local 'Downloads' folder, except that these items are on a remote host.
  • Gmail FS: Your folders are the subject of your email and the files in the folder are the attachments.
  • Loopback FS: Mirrors some other user-specified directory, similar to creating a shortcut to another folder.

https://blog.box.com/box-drive-how-we-made-all-box-available-desktop

⇧ 「仮想ファイルシステム(Virtual File System)」なるものが出てきますと。

Wikipediaさんによると、

virtual file system (VFS) or virtual filesystem switch is an abstract layer on top of a more concrete file system. The purpose of a VFS is to allow client applications to access different types of concrete file systems in a uniform way. A VFS can, for example, be used to access local and network storage devices transparently without the client application noticing the difference. It can be used to bridge the differences in Windowsclassic Mac OS/macOS and Unix filesystems, so that applications can access files on local file systems of those types without having to know what type of file system they are accessing.

https://en.wikipedia.org/wiki/Virtual_file_system

⇧ 様々なファイルシステムを抽象化した存在ということで、

⇧ 上記サイト様のイメージ図が分かりやすいかと。

「OS(Operation System)」によってファイルシステムが異なると思うのですが、「仮想ファイルシステム(Virtual File System)」が違いを吸収するような感じなんかな?

仮想マシン(Virtual Machine)」のようなことを、ファイルシステムの領域で行っているような感じですかね。

Wikipediaさんの「List of file systems」の説明によると、

File system interfaces

These are not really file systems; they allow access to file systems from an operating system standpoint.

  • FUSE (file system in userspace, like LUFS but better maintained)
  • LUFS (Linux userland file system – seems to be abandoned in favour of FUSE)
  • PUFFS (Userspace filesystem for NetBSD, including a compatibility layer called librefuse for porting existing FUSE-based applications)
  • Secure Shell File System (SSHFS) – locally mount a remote directory on a server using only a secure shell login.
  • VFS Virtual Filesystem

https://en.wikipedia.org/wiki/List_of_file_systems

⇧「仮想ファイルシステム(Virtual File System )」は「File system interfaces」に分類されると。

何となくですが、「仮想ファイルシステム(Virtual File System )」の仕組みを利用すれば、ブラウザ上でWindowsエクスプローラーのようなことが実現できるってことなんかな?

実際には、サーバーなどに保存しているディレクトリやファイルの一覧をブラウザ越しに参照したり、編集したりしたいってことなんだけど。

要件で技術スタックを決めるのを可能な限り先延ばしにするのが良いとされてるのを聞くんだけど、そもそも、ある程度、技術スタックのことを把握していないと、要件定義が絵に描いた餅になるってこともありそうですな。

特定の技術スタックでしか要件を満たせないケースなど、技術スタックに依存する要件とかもありそうだものね...

毎度モヤモヤ感が半端ない...

今回はこのへんで。