23
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[翻蚳] ②Web3DID゚ッゞコンピュヌティングBrooklyn Zelenka and The Exciting World of Edge Computing

23
Last updated at Posted at 2022-02-14

piacere です、ご芧いただいおありがずございたす :bow:
I'm piacere, the 4 Elixir communities founder/organizer, thank you for reading! :bow:

前回に続き、今回もElixir界の゚ッゞコンピュヌタず惑星間ファむルシステム、DIDの専門家、Brooklyn ZelenkaのElixir゚ッゞコンピュヌティングPodcast「Brooklyn Zelenka and The Exciting World of Edge Computing」の翻蚳をお届けしたす䞋図はElixirConf EU 2020でのお姿
image.png

このPodcast翻蚳シリヌズの目次は䞋蚘です

[翻蚳] ①Brooklyn Zelenka and The Exciting World of Edge Computing
|> [翻蚳] ②Brooklyn Zelenka and The Exciting World of Edge Computing
|> [翻蚳] ③Brooklyn Zelenka and The Exciting World of Edge Computing
|> [翻蚳] ④Brooklyn Zelenka and The Exciting World of Edge Computing

:xmas-tree::xmas-tree: There are 16 Elixir Advent Calendar, making for a hot winter! :xmas-tree::xmas-tree:

We are experiencing an unprecedented level of excitement ... Please support/subscribe :bow:

https://qiita.com/advent-calendar/2022/elixir
image.png

信頌はどこで機胜する

DI: The old style brain of mine is wondering about security and protecting from a malicious somebody malicious on the network, because we've talked about no centralized trust, so where does the trust play in, in that scenario?

BZ: Yeah. Absolutely, so when we were first exploring this space, we're looking at the tools that existed. That was the big glaring hole, right? That nobody had solved. We spent a bunch of time investing in exactly that. Users control all of their data or whoever originates the data that could also be to a company or whoever, right? Each bit of data gets encrypted directly. Now, in order to get into any particular file, you need it's key and this is the same level of security as you'd get with top secret clearance for US military, right? So very high security all baked into browsers these days, it turns out actually.

Some techniques, for example one called a crypt tree that lets you avoid having to manage thousands of these keys, right? You can only have one or two and then that will manage quite a few more for you. The upshot of this is, even today, when you have data sitting behind a server that has some check to say, okay you have the right bearer token to see this record in the database, there's data breaches all the time, right? You can have bad authorization logic, people can get into the server, you can have a disgruntled employee, download a copy and release it. This happens literally on a daily basis.

DI: There's a good chance, someone listening to this podcast right now, just got an email about a data breach.

BZ: Exactly, yeah. By breaking it up into this more granular system where every file, every directory has its own keys, it's a minimizing of trust, so that we're no longer saying it's this server that needs to do all of the heavy lifting. It's baked right into the data, even as it's moving around in the network. As a service provider, say Fission, or whoever down the road, it like Twitter were to do something like this, they could also hold private data without being able to see what's inside of it. If someone were to get, into to say, my account, they wouldn't get into your account. It really minimizes the blast radius of a data breach.

DI: Wow. Okay, so super interesting.

DI私の叀いタむプの脳は、セキュリティに぀いお、ネットワヌク䞊の悪意ある誰かから守るこずに぀いお疑問を抱いおいたす。䞭倮集暩的蚳泚「Centralized」、その反察はDIDにも䜿われるDecentralizedな信頌がないずいう話をしたしたが、このシナリオでは信頌はどのように働くのでしょうか

BZはい。たさに、私達がこの分野を最初に探求したずき、既存のツヌルに泚目したした。そこには倧きく明らかな穎がありたした。誰もそれを解決しおいなかったのです。私達は、たさにその点に時間をかけお投資しおきたした。ナヌザが自分のデヌタを党お管理するか、あるいはデヌタの発信元が誰であれ、䌁業であれ誰であれ、そのデヌタを管理したす、そうですよね デヌタの各ビットは盎接暗号化されたす。特定のファむルにアクセスするためには、そのファむルの鍵が必芁です。これは米軍の最高機密扱いず同じレベルのセキュリティです。だから最近のブラりザには、非垞に高いセキュリティが党お組み蟌たれおいるのです

たずえば、クリプトツリヌず呌ばれる技術では、䜕千もの鍵を管理する必芁がありたせんよね1぀か2぀だけ持っおいれば、あずはかなりの数の鍵を管理するこずができたす。この結果、今日でも、デヌタをサヌバに眮いお、そのサヌバがDB内のレコヌドを芋るための正しいBearerトヌクンを持っおいるかどうかをチェックする堎合、垞にデヌタ䟵害が発生しおいるこずになりたす。䞍正な認蚌ロゞックがあったり、サヌバに䟵入されたり、䞍満を持った埓業員がコピヌをダりンロヌドしお公開したりする可胜性がありたす。これは文字通り日垞茶飯事です

DI今、このPodcastを聎いおいる人の䞭にも、デヌタ䟵害に関するメヌルを受け取った人がいるかもしれたせんね

BZその通りです。各ファむルやディレクトリがそれぞれ独自の鍵を持぀ような、より粒床の现かいシステムに分割するこずで、信頌を最小化し、もはやこのサヌバが党おの重荷を背負う必芁は無くなりたす。ネットワヌク䞊を移動するデヌタにも、その鍵が埋め蟌たれおいるのです。サヌビス・プロバむダずしお、たずえば Fission や、将来的には他の䌁業も、Twitterがしおいるように、䞭身を芋るこずなく個人デヌタを持おたす。誰かが私のアカりントを奪ったずしおも、あなたのアカりントにはアクセスできたせん。それは、デヌタ流出時の爆発半埄を最小限に抑えるこずを可胜ずしたす

DIワォ。オヌケヌ、ずおも興味深いですね

image.png

むミュヌタブルが分散コンピュヌティングに有利なElixir

DI: Pull us a little bit back towards Elixir. I know we talked about this is very much in the browser product. Probably not using Elixir for a lot of this implementation. Curious about functional programming styles, if that plays into how you think about this, if that has influenced the style of an edge app?

BZ: Yes, definitely. We're really focused on the browser, or at least have been, but there's nothing preventing you from being able to you've solved the really hard problems, right? So you can now walk this back into Edge PoPs, or all the way up to cloud, right? You can run this and say, it will be less. Really, the backbone of all this stuff is distributed systems, which Elixir is very good at. I would say, it even encourages you to think this way, right? The actual model, if you have process locally, or process remotely, they're not identical, but they're pretty similar, right?

A lot of people in the ecosystem, so not just the language and the tools itself, but actually the people working on projects are interested in these things, right? There's a lot of people who are doing CRDTs or Broadway as a project. Actually, doing things in high parallel or moving data around between machines, it's like the exact space where we're playing in functional programming broadly for this is a huge help, because you can't have some central resource when you're doing work. You can, but it becomes a bottleneck, right? When you're doing these distributed systems.

One of the major downsides of object oriented programming is that it hides state behind interfaces and they're locked there in space, right? You have to go over here to this machine at this address and find it. Functional programming exposes states and moves it around that way. Even in say, a gen server, right, we're always exposing, well, this is the current state that I'm going to update, and then I'll return the new one, right? We pass things around. Yes, sometimes there will be in an actor over here, there's a bit of say, and that's going to manage it, but we can also pull that out and move the data around and that's completely okay.

We can copy it, send versions somewhere else, receive more of it and that entire model works really, really well when you're thinking in factors and in immutable data structures, especially. Mutability is very difficult when doing distributed systems and having that baked in as, I would say really, that's the main core idea of functional programming is exposed state and immutable data, right? The rest of it is really nice hardware functions, all this stuff and we call it functional programming, because we to think of it as the thing doing the actions on it, but really at its core, it's about the immutability.

DI: Great

DIElixirの方に少し戻したしょう。ブラりザ補品に非垞に倚いずいう話をしたしたね。倚分その実装にElixirは䜿われおたせん。関数型プログラミングのスタむルが、゚ッゞアプリのスタむルに圱響を及がしおいるかに興味をそそられたす

BZはい、合っおたす。私達はブラりザにずおも泚力しおいたすし、少なくずも、これたではそうしおきたしたが、ブラりザで無ければ解決できないずいうこずも無いですね。そう、゚ッゞPoP蚳泚Point Of Presence 配信拠点にも、クラりドにも応甚できたすね。これを実行すれば、より少ないコストで枈むのですが、そのバックボヌンは、党おElixirが埗意ずする分散システムです。その考えを掚奚しおいるず蚀っおもいい䜍ですね。実際のモデルずしおは、ロヌカルで凊理するのず、リモヌトで凊理するのでは、同じではないですが、かなり䌌おいたすよね

Elixir゚コシステムには、倚くの人がいるので、蚀語やツヌルそのものだけでなく、実際にプロゞェクトに取り組んでいる人達もこれらに興味を持っおいたすね。CRDT蚳泚Conflict free Replicated Data Type コンフリクトしない耇補可胜デヌタ型 や Broadway蚳泚Elixirでデヌタ凊理パむプラむンを効率化するラむブラリ をプロゞェクトずしお物事を進めおいる人はたくさんいたす。実際、高䞊列を扱ったり、マシン間でデヌタを移動させたりは、たさに関数型プログラミングで遊んでいる空間ず同じなのですが、これは倧きな助けになっおいお、それは䜕かをするずき、䞭倮のリ゜ヌスを持぀こずができないからです。でも、それがボトルネックになるんですね。分散システムでは、それがボトルネックになりたす。

オブゞェクト指向プログラミングの倧きな欠点の1぀は、状態をむンタフェヌスの埌ろに隠しおしたい、空間に閉じ蟌めおしたうこずですね。あるアドレスのあるマシンに移動しお、それを探さなければなりたせん。関数型プログラミングでは、状態を公開しお、それを移動させたす。たずえば GenServer蚳泚Elixirで状態を保持するフレヌムワヌク は、珟圚の状態を曎新しお、新しい状態を返すこずを垞に公開しおいたすよね 察象を受け枡すのです。そうですね、ここに アクタヌ蚳泚メッセヌゞをやり取りするプロセスのこず がいお、アクタヌはメッセヌゞを発し、それで状態を管理したすが、メッセヌゞを取り出しお、デヌタずしお移動させおも党く問題が無いのです。

メッセヌゞをコピヌしお、別の堎所にそのメッセヌゞのバヌゞョンを送信し、より倚くのメッセヌゞを受信するこずができるのですが、このモデル党䜓はずおも䞊手く機胜し、特に「芁玠」や「むミュヌタブルデヌタ構造」で考えるずきは実に䞊手く機胜したす。分散システムを構築する䞊で、ミュヌタビリティを組み蟌むこずは非垞に難しいのですが、関数型プログラミングの栞ずなる考え方は、公開された「状態」ず「むミュヌタブルのデヌタ」ですよね あずはナむスなハヌドりェア機胜によるもので、そういうものを党郚ひっくるめお、私達は「関数型プログラミング」ず呌んでいたすが、それはハヌドりェアの䞊でアクションを起こすものずしお考えおいたすが、実はその栞心は「むミュヌタブル」にあるのです

DI玠晎らしい

蚳泚䞋蚘URLから䞊蚘で説明しおいるCRDTに぀いおの解説が芋れたす
https://www.youtube.com/watch?v=ogOEEKWxevo
image.png

ElixirConfで発衚したネットワヌク技術

DI: You gave a talk at ElixirConf is year. Could you tell us a little bit about what that was? What the concepts were? With a few following questions.

BZ: Sure. I gave one of the keynotes at ElixirConf in Austin, which was actually the first time I'd been out of Canada in two years, that was exciting. The talk was called "The Jump to Hyperspace", which is about all the things we've just been talking about. Edge computing, the speed of lights, and how that's a barrier, how that in effect becomes a network partition not just latency. Some of the changes that are already happening with things like Low Earth Orbit satellites, things like Starlink, how that's changing the network and the responses that's the industry moving all the way out to software to take advantage of these changes to the network and changes to some of the newer techniques that we have now.

That means, that we don't have to rely on the same, I really don't have to rely on the same ways of doing things as we've done for the last 30 years, but that we've taken that style, really, as probably as about as far as it can go without having to make some fundamental changes. You said you had some follow on questions that might be a good jumping off point.

AH: I've got one. The full title was "The Jump to Hyperspace Lightspeed, antientropy, and moving past the cloud", did I pronounce antientropy correctly? I actually don't know.

BZ: Antientropy. Yes.

AH: Antientropy. Sure. Could you give a brief layman's terms definition, if you will, for our listeners?

BZ: Sure. Absolutely. I touched on, not all of this, but some of this earlier. Entropy as a concept is the tendency of information to become disordered over time or really any systems become disordered over time. Antientropy is a class of techniques to resist or reverse disorder. Make them more ordered again. The one that we're most familiar with as developers is Git, right? You have your main branch and then you forking off of that or branching off of that, and that is a less ordered state, right? There's more versions of that file now. Then you need to go and merge it back in and that's making it less disorder, we have fewer branches and those are coming back together.

The main technique that uses this, or the most famous one these days is a conflict free replicated data type CRDT, which is essentially doing Git merges on data structures, without needing somebody to intervene. Instead of having a PR and then you have to hope that the Git merge will work. Then you have to manually handle anything, this will just do it for you automatically and get everyone into a consistent state.

So doing updates on say, two databases or two devices, running the same software even could even be different software will keep it simple, running the same software and they're both offline, you're both editing a document and you come back online, and they sync up again, you should get a consistent view of that documents at the end without needing a central server. Antientropy is that merging back and resisting having many different possible views of some data, it's getting it back into one consistent state.

AH: I love Git, as the high level example. Earlier, when you mentioned reference systems and books, I thought also, that is an excellent real world example like makes it paints a very clear picture, which I appreciate.

BZ: Oh, thank you.

AH: You're welcome.

DI今幎はElixirConfで講挔をされたしたね。その内容を少し教えおください。コンセプトは䜕だったのでしょう 幟぀か質問がありたす

BZもちろんです。オヌスティンで開催されたElixirConfで基調講挔をしたのですが、実は2幎ぶりにカナダを離れたので、ずおも刺激的でした。「The Jump to Hyperspace」ずいうタむトルで、今お話したような内容に぀いお登壇したした。゚ッゞコンピュヌティング、光の速さ、それがどのように障壁ずなり、遅延だけでなく実質的にネットワヌクを隔おるのか。Starlinkのような䜎軌道衛星ですでに起きおいる倉化が、ネットワヌクをどのように倉えおおり、ネットワヌクの倉化ず新技術の倉化に察応するために、ネットワヌク業界は゜フトりェアぞず移行しおいるのが珟状です

぀たり私達は、同じものに頌らなくおいい 
 過去30幎間ず同じやり方に頌る必芁は本圓に無く、䞀方で、そのスタむルを恐らく根本的に倉えるこずも無く、できる限り同じやり方を続けるでしょう。あなたは、質問したいこずがあるず蚀っおいたので、その質問を出発点にしたしょうか

https://2021.elixirconf.com/
image.png

AH1぀ありたす。タむトル党䜓は「The Jump to Hyperspace Lightspeed, antientropy, and moving past the cloud」でしたが、「antientropy蚳泚反゚ントロピヌ」の発音は正しかったでしょうか実は知らないんです

BZAntientropy。合っおたすよ

AHAntientropyですね。では、リスナヌ向けに分かりやすく説明しおいただけたすか

BZもちろんです。党郚ではありたせんが、先ほどその䞀郚に぀いお觊れたした。抂念ずしおの゚ントロピヌは、情報が時間ず共に無秩序になる傟向、あるいはどんなシステムも時間ず共に無秩序になる傟向のこずです。反゚ントロピヌずは、無秩序に抵抗する、あるいは無秩序を逆転させるための技術の䞀皮です。より秩序立った状態に戻すのです。開発者ずしお最も銎染みがあるのは、Gitですかね mainブランチがあっお、そこからフォヌクしたり、ブランチしたりするわけですが、これは秩序を欠いた状態ですよね そのファむルには、さらに倚くのバヌゞョンが存圚したす。そしお、それをマヌゞしお戻す必芁がありたす。そうするず少し無秩序は解消されたす。ブランチの数が枛っお、それらが䞀緒になっお戻っおくるのです

これを䜿った䞻なテクニックで、最近最も有名なものはCRDTです。これは基本的に誰かが介入するこずなく、デヌタ構造䞊でGitマヌゞを行うものです。プルリク゚ストを行う代わりに、Gitマヌゞが機胜するこずを期埅するようにしたす。するず、手動で䜕かを凊理しなければならないずきでも、自動的に凊理し、党員を敎合性のある状態にしおくれたす

たずえば、2぀のDBや2぀のデバむスで曎新を行う堎合、同じ゜フトりェアでも、異なる゜フトりェアでもシンプルにでき、䞡方ずも同じ゜フトりェアによりオフラむンでドキュメント線集しおいる堎合、オンラむンに戻っおくるず、再び同期され、最終的には䞭倮サヌバを必芁ずせずにドキュメントの敎合性あるビュヌが埗られるはずです。反゚ントロピヌずは、あるデヌタに察しお倚くの異なるビュヌを持぀こずに抵抗し、マヌゞし盎し、それを1぀の敎合性のある状態に戻すこずです

AH私はGitが奜きなのですが、ハむレベルな䟋に䜿われたしたね。先ほど参考にしたシステムや曞籍の話をされたずきにも思ったのですが、実䞖界での優れた䟋は非垞に分かりやすくむメヌゞできるのでありがたいです

BZそうですか、ありがずうございたす

AHどういたしたしお

蚳泚䞋蚘URLから䞊蚘で玹介しおいるElixirConfの基調講挔が芋れたす
https://www.youtube.com/watch?v=ogOEEKWxevo
image.png

顧客や普通の人ぞの説明ず、自分達が重芁ず思うこず

AH: Do you feel being at a research and development company and being the CTO you have to be able to come up with really good, very clear examples that are non-tech related for potential clients?

BZ: Oh, yeah. Very much. Nevermind the potential clients for just literally anyone, right? My CEO, Boris has a technical background, right? He has a CS degree. He's worked as an engineer and come in on Monday morning, having read a couple papers on the weekend. I was like, okay, how can I put this in normal people terms for anyone else to explain why this is important for us to work on? It's from, everyone from my, mom doesn't know what I do, so I have to explain it to her, all the way up to literally my co-founder. So yeah, absolutely.

AH: Yeah. The meme of like what my parents think I do. What my boss thinks I do. What I really do. Yeah. Absolutely.

BZ: Yeah.

AH研究開発䌁業にいおCTOになるず、朜圚顧客に察し、技術ずは関係のない、実にいい感じの明確な䟋を思い付く必芁があるず感じたすか

BZそうですね。かなり。朜圚顧客が䜕者であるかは気にしたせんよね CEOのボリスは、技術的なバックグラりンドがありたす。圌はコンピュヌタサむ゚ンスの孊䜍を持っおいたす。圌ぱンゞニアずしお働いおいお、週末に論文をいく぀か読んで、月曜日の朝に出瀟しおきたす。私はこう考えるのです 
 「オヌケヌ、これがなぜ私達が取り組むべき重芁なこずなのか誰かに説明するには、普通の人の蚀葉でどう蚀えばいいのだろう」ず。私の母は、私の仕事を知りたせんから、私の共同創蚭者に぀いおたで、圌女に説明しなければなりたせん。そう、絶察に。

AHえぇ。「䞡芪が私がしおいるず思うこず」ずいうようなミヌム。䞊叞が私がしおいるず思っおいるこず。私が実際にやっおいるこず。うん、党くもっお

BZえぇ

- Translator's impression : 蚳者の感想 -

(English version)

We have seen the true potential of "functional programming" and "immutable data" in the content of this article, haven't we?

It is widely known that the key to successfully constructing a distributed system is to manage the "state" and "immutable data" without incorporating mutability, which is typical of OOP, but a new idea was introduced that if this condition is met, all the processing can be "hardwared".

This is an example of how a different programming paradigm can result in a completely different system architecture and an order of magnitude improvement in performance at the same time.

It's an amazing paradigm shift, right?

I would love to incorporate this into my "Programming Theory" course for college students.

The rest of this column will be published on February 15! :information_desk_person:

日本語バヌゞョン

今回の内容に、「関数型プログラミング」ず「むミュヌタブルデヌタ」の真の可胜性が芋えたのでは無いでしょうか

分散システムを䞊手く構成するコツは、OOPの兞型であるミュヌタビリティを組み蟌たず、「状態」ず「むミュヌタブルのデヌタ」の管理に培するこずであるのは広く知られおいたすが、この条件を満たしおいれば、凊理は党お「ハヌドりェア化できる」ずいう新たな着想が玹介されおいたした

プログラミングパラダむムの違いにより、埓来の抂念ず党く異なるシステム構成ず、別次元の性胜向䞊を同時にもたらすこずがあるずいう䟋です

驚くべきパラダむムシフトですね

私達が提䟛しおいる倧孊生向けの講矩である「プログラミング論」にぜひ取り入れたいず思いたす

さお、この続きのコラムは、2/15に公開予定です :information_desk_person:

このPodcast翻蚳シリヌズ党䜓は、以䞋の通りです

[翻蚳] ①Brooklyn Zelenka and The Exciting World of Edge Computing
|> [翻蚳] ②Brooklyn Zelenka and The Exciting World of Edge Computing
|> [翻蚳] ③Brooklyn Zelenka and The Exciting World of Edge Computing
|> [翻蚳] ④Brooklyn Zelenka and The Exciting World of Edge Computing

Elixirコミュニティのご玹介

1. ElixirImp : A place to LOVE the buds in Elixir (Elixir実装の芜を愛でる堎)
2. fukuoka.ex : Fukuoka local Elixir Community (犏岡Elixirコミュニティ)
3. kokura.ex : Kokura local Elixir Community (小倉Elixirコミュニティ)

4. LiveView JP : A place to mob-program in LiveView, LiveBook+Nx+Axon, and elixir-desktop

5. Neos.ex : A place to connecting Elixir and NeosVR to create a new world

p.s.このコラムが、面癜かったり、圹に立ったら 

image.png や image.png にお、どうぞ応揎よろしくお願いしたす:bow

23
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
23
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?