Live data from Hacker News

Using logs to build a solid data infrastructure

blog.confluent.io

1–10 of 34 posts

Re: Using logs to build a solid data infrastructure

#2
Martin's talks and blog posts are aways awesome. I'm really excited to see how this plays out for real applications.

The one thing I'm always somewhat confused by though is how a "totally ordered log" intersects with the reality of a partitioned log. The simplicity of a log seems to break down a bit when you partition.

For instance, imagine I want to implement multi-key transactions on top of a distributed datastore. With a totally ordered log this is easy. But with a partitioned log, it becomes much harder.

Alternatively, imagine I want to implement a collaborative editing app like Google Docks or something like Slack. A natural design would be to to have millions of independent logs. I can then replay logs to get current state and watch logs to keep it updated. But as far as I'm aware, partitioned logs like Kafka do not actually support millions of topics. So there's no way to replay a log for something like a channel or document.

Re: Using logs to build a solid data infrastructure

#4
post #2

Martin's talks and blog posts are aways awesome. I'm really excited to see how this plays out for real applications. The one thing I'm always somewhat confused by though is how a "totally ordered log" intersects with the reality of a partitioned log. The simplicity of a log seems to break down a bit when you partition. For instance, imagine I want to implement multi-key transactions on top of a distributed datastore.…

One thing to realize is that a partitioned log is a generalization of an unpartitioned log (i.e. if you set # partitions = 1 in a partitioned log you have an unpartitioned log).

In Kafka the purpose of partitions is to provide computational parallelism not model entities in the world. So if you have 100m users you would map that into a number of partitions based on your computational parallelism (maybe 10-100 machines/processes/threads). In other words you would have a single topic partitioned by user id, not a topic per user.

If you have a centralized relational database that maps reasonably well to a single partition log (both in terms of scalability and guarantees).

For distributed databases you generally don't have a total order over all operations. What you usually have is (at best) a per partition ordering, which maps well to a partitioned log as well.

For applications that record events (logging or whatever) it is natural to think of each application thread or process as a kind of actor with a total order.

Re: Using logs to build a solid data infrastructure

#5
That talk was great. We introduced Kafka at my work probably 3-4 months ago, at first only to track events from our webservices, but eventually it became the backbone of communication between our services.

The Java library for the consumer part, still based on the Scala code, is not that great though. They're rewriting a Java-only library, which is much nicer to use, but I'm not sure when it'll be stable.

Re: Using logs to build a solid data infrastructure

#6

  if you want to build a new derived datastore, you can just start a new consumer
  at the beginning of the log, and churn through the history of the log, applying
  all the writes to your datastore.
For high-throughput environments with lots of appends to the log, how do you get around the ever-increasing size of your log file? I know the traditional answer is to take a periodic snapshot and compact the previous data, but is that built in to tools like Kafka?

Re: Using logs to build a solid data infrastructure

#7
post #2

Martin's talks and blog posts are aways awesome. I'm really excited to see how this plays out for real applications. The one thing I'm always somewhat confused by though is how a "totally ordered log" intersects with the reality of a partitioned log. The simplicity of a log seems to break down a bit when you partition. For instance, imagine I want to implement multi-key transactions on top of a distributed datastore.…

You could always map the document id or channel id to be always the same partition, then that particular document or channel log would be ordered. Seems like it would work.

Re: Using logs to build a solid data infrastructure

#10

What is used to create those images? They look like whiteboard pictures but not quite.

I'm pretty sure it's Paper by 53, more information is available here: https://www.fiftythree.com/paper.

If you look at some of the screenshots on the site, you might notice some similarities.

Post reply on HN