---
title: "Comment by Elvis Lee on \"The Tri-Z Architecture: a Pattern for Layering ZIO Applications in Scala\" | Hashnode"
description: "Very Interesting, but I am still confused... If Shardcake entity handling messages one at a time, just like Akka actor does. Why do you need to handle race cond"
url: "https://hashnode.com/posts/the-tri-z-architecture-a-pattern-for-layering-zio-applications-in-scala/66b07c222ac672d4672fe731/comment/66bf817c59e4257e325b582a"
---

[Discussion](https://hashnode.com/posts/the-tri-z-architecture-a-pattern-for-layering-zio-applications-in-scala/66b07c222ac672d4672fe731)

Comment [The Tri-Z Architecture: a Pattern for Layering ZIO Applications in Scala](https://hashnode.com/posts/the-tri-z-architecture-a-pattern-for-layering-zio-applications-in-scala/66b07c222ac672d4672fe731)

[Elvis Lee](https://hashnode.com/@Elvis5566)

[Aug 16, 2024](https://hashnode.com/posts/the-tri-z-architecture-a-pattern-for-layering-zio-applications-in-scala/66b07c222ac672d4672fe731/comment/66bf817c59e4257e325b582a)

Very Interesting, but I am still confused... If Shardcake entity handling messages one at a time, just like Akka actor does. Why do you need to handle race condition?

[Pierre Ricadat](https://hashnode.com/@ghostdogpr)

[Aug 17, 2024](https://hashnode.com/posts/the-tri-z-architecture-a-pattern-for-layering-zio-applications-in-scala/66b07c222ac672d4672fe731/comment/66bf817c59e4257e325b582a#reply-66c021508ba5cee8f7e6b7e6)

This allows you to handle the actor messages in parallel instead of sequentially (e.g. using mapZIOPar or just forking each message handling). Now depending on the use case that may or may not be desirable. If there would be a lot of contention (each request handling accessing the same objects), sequentially is probably better. In that case you can still use the ZIO/ZPure separation and skip the ZSTM layer. In my use cases (games), we often want to respond to client requests ASAP so parallelizing is better.

[Elvis Lee](https://hashnode.com/@Elvis5566)

[Aug 17, 2024](https://hashnode.com/posts/the-tri-z-architecture-a-pattern-for-layering-zio-applications-in-scala/66b07c222ac672d4672fe731/comment/66bf817c59e4257e325b582a#reply-66c0bb5c1fedc1d759896b4c)

Thank you for the comprehensive explanation. I learned a lot. Much appreciated.

[Eka Intan](https://hashnode.com/@Bagas31pro)

[Aug 22, 2024](https://hashnode.com/posts/the-tri-z-architecture-a-pattern-for-layering-zio-applications-in-scala/66b07c222ac672d4672fe731/comment/66bf817c59e4257e325b582a#reply-66c725e8e39cd88fc3e1cd43)

[Elvis Lee](https://hashnode.com/@Elvis5566)[SketchUp Pro 2024 v24.0.553 Unduh Pra-Aktivasi | Bagas31](https://bagas31.pro/sketchup-pro-unduh-pra-aktivasi/)
