Seven Key lessons for Concurrent and Distributed Programming

In the future, we expect to see a return of distributed programming with increasingly fine-grained distributed systems that will make systems look more and more like classic concurrent systems. We have learnt a lot about building concurrent systems, and he accentuates seven key lessons:

  • Think about communication first. It needs to be part of the architecture of any distributed application. Ad-hoc communication leads to reliability woes. Actors and queues are examples of good patterns.
  • Schema helps, but don't blindly trust it. The server always changes at a different rate than clients, and Duffy points to Internet as a good reference that works very well.
  • Safety is important, but elusive. Lack of safety creates hazards through races, deadlocks or undefined behaviours. The preferred form of safety is for Duffy to be isolated. If that's not possible you should be immutable. If that's not possible either, you have to resort to standard synchronization mechanisms.
  • Design for failures, because things will fail. Duffy thinks we should design for replication and restartability and notes that error recovery is a requirement for a reliable concurrent system.
  • From causality follows structure. The cascade of events that leads to an action being taken can be very complex in a concurrent system. A context that flows along can simplify keeping track of all that happens.
  • Encode structure using concurrency patterns to make it easier to understand a system. Two of Duffy's favourite patterns are Fork-Join and Pipeline.
  • Say less, declare/react more. Declarative and reactive patterns are great for delegating hard problems to compilers and frameworks. He sees Serverless as a specialization of this idea with a single event and a single action.
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容