1. what is Distributed System?
A collection of independent computers that appear to its users as one computer. ---Andrew tannebaum
Three characteristics:
Operate concurrently/fail independently/Do not share a global clock.
Three Topics: Storage/Computation/Messaging
Storage:
Single - Master storage
Read/Write
Replication.
Sharding
Consistent hashing
Distributed Computation
MapReduce
map: count words, word: number
shuffle: move similar word together
Reduce: add up the numbers
Hadoop:
MapReduce API
MapReduce job management
Distributed FileSystem(HDFS)
Enormous ecosystem
Spark:
Scatter/gather paradigm(similar to MapReduce)
More general data model(RDDs, Datasets)
More general programming model(transform/action)
Storage agnostic
Kakfa:
Focuses on real-time analysis, not batch jobs
Streams and streams only
Except streams are also tables(sometimes)
No cluster required
Messaging
*Means of loosely coupling subsystems
*Messages consumed by subscribers
*Created by one or more producers
*Organized into topics
*Processed by brokers
*Usually persistent over the short term
Messaging Problems
*What if a topic gets too big for one computer?
*not reliable enough
*guarantee delivery?
Apache kafka
Definitions:
Message: an immutable array of bytes
Topic: a feed of messages
Producer: a process that publishes messages to a topic
Consumer: A single-threaded process that subscribe to a topic
Broker: one of the servers that comprises a cluster.
Kafka(Trivial version)
Topic partitioning.
Kafka(Interesting version)
* Message bus
* Turned events into rows-in-place
* compute events
Without streams.