You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@samza.apache.org by José Barrueta <jo...@stormpath.com> on 2015/05/05 02:02:17 UTC

Questions regarding Samza in production

Hi guys,

We're getting ready to release our first Samza project into production
soon, and after the development phase we're having a few questions about
scalability, version upgrades, state management and recovering from
failures, hopefully what I'm asking here is something you already have
experienced with.

- We're using Key-Value Storage (backed by RockDB) to keep the track of
requests made by a user, the value is a Serialized bean with the
information needed to keep track of the user, for this scenario:

  - I assume caching will help a lot with serialization/deserialization of
the Value, but have you guys used the value to be of type other than
primitives?
  - In the event of stopping/starting a task what is the recommended way to
restore the "Key-Value" storage state from the changelog stream (kafka),
I'm seeing this issue in JIRA:
https://issues.apache.org/jira/browse/SAMZA-625, but not sure what is the
advised way to init a StreamTask to catch up with the changelog before
start processing new events.

In the "Containers and resource allocation" section (
http://samza.apache.org/learn/documentation/0.9/container/samza-container.html
)

If we scale up / down, how do we make sure that the stream tasks as they
are moved from one container to another, are init in the right state before
they start processing events (sort of related to secon question above)?

- When doing version upgrades of your tasks, what is the best way to change
the version that has the less impact in delaying the event consuming part,
this would include to recreate the old state in the new version of the task?

Please let me know if these questions are too general and I'll be glad to
add specifics in any of them.

By the way I'm going this Tuesday to the Meetup, hope I can meet many of
you there!

José L. Barrueta
Stormpath

Re: Questions regarding Samza in production

Posted by Yi Pan <ni...@gmail.com>.
Hi, Jose,

Good to know that you chose Samza! I will embed my answers inline below:

On Mon, May 4, 2015 at 5:02 PM, José Barrueta <jo...@stormpath.com> wrote:

>
>   - I assume caching will help a lot with serialization/deserialization of
> the Value, but have you guys used the value to be of type other than
> primitives?
>

Samza's KV-store engine supports a deserialized/serialized layer on top of
the RocksDB already. I don't have stats showing what are other
non-primitive data types people uses, but the use case is definitely
supported w/ pluggable Serde classes for key and value.


>   - In the event of stopping/starting a task what is the recommended way to
> restore the "Key-Value" storage state from the changelog stream (kafka),
> I'm seeing this issue in JIRA:
> https://issues.apache.org/jira/browse/SAMZA-625, but not sure what is the
> advised way to init a StreamTask to catch up with the changelog before
> start processing new events.
>
>
Samza will restore the KV-stores from changelog first, before any task
starts processing the incoming messages. This is already an embedded logic.


> In the "Containers and resource allocation" section (
>
> http://samza.apache.org/learn/documentation/0.9/container/samza-container.html
> )
>
> If we scale up / down, how do we make sure that the stream tasks as they
> are moved from one container to another, are init in the right state before
> they start processing events (sort of related to secon question above)?
>

Again, this is the embedded logic in Samza container initialization already.


>
> - When doing version upgrades of your tasks, what is the best way to change
> the version that has the less impact in delaying the event consuming part,
> this would include to recreate the old state in the new version of the
> task?
>
>
The question is not 100% clear to me. Samza as a platform guarantees that
the state you stored before the upgrade will be restored to the original
state. If your new task version can still read the state before the
upgrade, there should be no incompatibility problem.


> Please let me know if these questions are too general and I'll be glad to
> add specifics in any of them.
>
> By the way I'm going this Tuesday to the Meetup, hope I can meet many of
> you there!
>
> José L. Barrueta
> Stormpath
>