Table of Contents
LevelDB
Introducing LevelDB
00:00:00 - 00:05:45
Introducing LevelDB
James Halliday introduces and sets up LevelDB, a key-value storage library written at Google that provides an ordered mapping from string keys to string values.
Methods and Lexicographically
00:05:46 - 00:23:37
Methods and Lexicographically
After James reviews the methods that are available with LevelDB, he notes that LevelDB uses lexicographic sorting, which alphabetical order of string values based on the alphabetical order. J
Organizing Keys
00:23:38 - 00:29:25
Organizing Keys
With the LevelDB setup, James demonstrates how to organize keys for different situations such as a simple blog and creates queries against that data.
Secondary Indexes
00:29:26 - 00:35:42
Secondary Indexes
James introduces how to create multiple keys for each post to create a secondary index.
Inserting Data
00:35:43 - 00:45:52
Inserting Data
With the database set up, James reviews how to build a system to add new data into LevelDB. -
https://github.com/substack/lexicographic-integer
Adding and Querying Data
00:45:53 - 00:57:28
Adding and Querying Data
James adds new posts with timestamps to the database. Then James examines different ways to query that data from the LevelDB database.
Subleveldown
00:57:29 - 01:02:25
Subleveldown
James introduces Subleveldown, which a library for LevelDB that creates nested sub-databases with unique namespaces; -
https://github.com/mafintosh/subleveldown
Level-Livefeed
01:02:26 - 01:08:30
Level-Livefeed
James installs Level-Livefeed package that allows for one to subscribe to a live feed of changes to the database. -
https://github.com/Raynos/level-livefeed
Designing Modules
01:08:31 - 01:16:45
Designing Modules
To use LevelDB in the browser, James switches from level package to include level-browserify. This change allows the use of the LevelUP code to be portable making it work with node and in the browser. -
https://github.com/Level/level-browserify
Best Practices
01:16:46 - 01:31:31
Best Practices
After reviewing the best use cases for LevelDB, James creates a demo application with LevelDB, node, and IndexedDB.
Q&A: IndexedDB vs. LocalStorage
01:31:32 - 01:34:06
Q&A: IndexedDB vs. LocalStorage
James takes questions from the students about IndexedDB and LocalStorage, browser support, and more.
Cryptography
Hashes
01:34:07 - 01:38:14
Hashes
James introduces hashes. While encryption is a two-step process used first to encrypt and then decrypt a message, hashing condenses a message into an irreversible fixed-length value or hash. -
https://github.com/crypto-browserify/createHash
Approaches to Cryptography
01:38:15 - 01:45:15
Approaches to Cryptography
James discusses approaches to cryptography including random number generators, symmetric ciphers, and asymmetric crypto. Cipher is a shared algorithm for performing encryption or decryption whereas asymmetric crypto uses public and private keys to encrypt and decrypt data. James also notes that is an important tool with cryptography is picking a robust random number generator. Finally, James warns against creating your encryption process. -
https://en.wikipedia.org/wiki/Category:Cryptographic_attacks
Sodium and Chloride
01:45:16 - 01:50:54
Sodium and Chloride
James introduces Sodium, a library for encryption, decryption, signatures, and password hashing. Then James demonstrates how to setup Chloride, which is based on Sodium, and generate key pairs. -
https://github.com/dominictarr/chloride
Using Sodium
01:50:55 - 01:55:05
Using Sodium
James discusses how to use Sodium cryptography with or without a signature, using a symmetric cipher, and using public key encryption.
Secret-Handshake
01:55:06 - 01:59:06
Secret-Handshake
James reviews secret-handshake library, which is used to keep both parties unaware of each other with mutually authenticating key agreement handshake. James takes questions from students. -
https://github.com/auditdrivencrypto/secret-handshake
merkle DAGs
01:59:07 - 02:03:24
merkle DAGs
James reviews merkle DAGs, which is a directed acyclic graph whose objects are linked to each other (usually just by their hash), where the hash(object) includes all hash(linked_object).
Working with merkle DAGs
02:03:25 - 02:07:56
Working with merkle DAGs
James demonstrates how to use merkle DAGs with node using shasum, which checks for SHA checksums.
Kappa Architecture
Introducing Kappa Architecture
02:07:57 - 02:12:23
Introducing Kappa Architecture
James introduces Kappa Architecture, where an immutable and append-only logs are used as the source of truth. To create these append-only logs, James notes that they are built hashes that are then trivial to replicate with concatenation.
Using Hyperlog
02:12:24 - 02:19:57
Using Hyperlog
James reviews hyperlog, which creates append-only merkle DAG log store. Hyperlog also can link to other documents by cryptographic hash and provides hooks for cryptographic signing and verification. Then James shows how to set up hyperlog. -
https://github.com/mafintosh/hyperlog
Database Replication and Duplex Streams
02:19:58 - 02:27:45
Database Replication and Duplex Streams
James discusses how to synchronous two databases. James takes questions from students. -
https://github.com/substack/dupsh
Hyperlog-index
02:27:46 - 02:39:35
Hyperlog-index
James reviews hyperlog-index, which builds materialized views on top of a hyperlog. -
https://github.com/substack/hyperlog-index
Hyperkv and Hyperlog-sodium
02:39:36 - 02:42:49
Hyperkv and Hyperlog-sodium
James shows hyperkv, which provides a p2p key/value store as a materialized view over a hyperlog. Then James discusses hyperlog-sodium, which more easily configures hyperlog for cryptographic signing. - -
https://github.com/substack/hyperkv -
https://github.com/substack/hyperlog-sodium
Kappa Architecture Examples
02:42:50 - 02:45:05
Kappa Architecture Examples
James reviews several examples of kappa architecture: P2P social database; map database built on hyperlog, hyperkv, hyperlog-kdb-index; and P2P file sync over an append-only merkle DAG log.
WebRTC Swarm with Hyperlogs
02:45:06 - 03:11:56
WebRTC Swarm with Hyperlogs
Create a swarm of P2P connections using WebRTC and a signalhub. -
https://github.com/mafintosh/webrtc-swarm