Welcome to the Real World

Gregor Hohpe

EnginEERS liKE pRECiSion, especially software engineers who live in the realm of ones and zeros. They are used to working with binary decisions, one or zero, true or false, yes or no. Everything is clear and consistent, guaranteed by foreign key constraints, atomic transactions, and checksums.

Unfortunately, the real world is not quite that binary. Customers place orders, only to cancel them a moment later. Checks bounce, letters are lost, payments delayed, and promises broken. Data entry errors are bound to happen every so often. Users prefer “shallow” user interfaces, which give them access to many functions at once without being boxed into a lengthy, one-dimensional “pro- cess,” which is easier to program and seems more “logical” to many developers. Instead of the call stack controlling the program flow, the user is in charge.

Worse yet, widely distributed systems introduce a whole new set of inconsis- tencies into the game. Services may not be reachable, change without prior notice, or do not provide transactional guarantees. When you run applica- tions on thousands of machine, failure is no longer a question of “if,” but of “when.” These systems are loosely coupled, asynchronous, concurrent, and do not adhere to traditional transaction semantics. You should have taken the blue pill!

As computer scientists’ brave new world is crumbling, what are we to do?

As is so often the case, awareness is a first important step toward a solution.



Say goodbye to the good old predictive call-stack architecture, where you get to define what happens when and in what order. Instead, be ready to respond to events at any time in any order, regaining your context as needed. Make asynchronous requests concurrently instead of calling methods one by one. Avoid complete chaos by modeling your application using event-driven pro- cess chains or state models. Reconcile errors through compensation, retry, or tentative operations.

Sounds scary and more than you bargained for? Luckily, the real world has to deal with the same issues for a long time: delayed letters, broken prom- ises, messages crossing in transit, payments posted to the wrong account—the examples are countless. Accordingly, people had to resend letters, write off bad orders, or tell you to ignore the payment reminder in case you already sent a payment. So don’t just blame the real world for your headaches, but also use it as a place to look for solutions. After all, Starbucks does not two-phase com- mit, either.1 Welcome to the real world.

Gregor Hohpe is a software architect with Google, Inc. Gregor is a widely rec- ognized thought leader on asynchronous messaging architectures and service- oriented architectures. He coauthored the seminal book Enterprise Integration Patterns (Addison-Wesley Professional) and speaks regularly at technical conferences around the world.

最新文章

  1. PS中的图像知识
  2. thinkphp 完整配置config.php
  3. WinAPI: ShellExecute - 打开外部程序或文件
  4. linux(centos )mongodb install
  5. Spark Streaming源码解读之流数据不断接收全生命周期彻底研究和思考
  6. SQL镜像资料
  7. hive 常见面试题
  8. [Java]获取图片高和宽
  9. jquery.validate.js校验select2解决方案,Jquery插件select2校验解决方案
  10. ICE学习第三步-----Slice语言
  11. 8051、ARM和DSP指令周期的测试与分析
  12. Mylyn
  13. ubuntu安装jdk eclipse mysql等
  14. css实现多行超出显示省略号?
  15. 随机生成并排序 C,去同,有序数组合并排序
  16. UIImageView动画制作
  17. Go-day01
  18. docker+gitlab的安装和迁移
  19. nodejs 学习四 处理回调地狱
  20. MyBatis sql语句使用总结

热门文章

  1. C Tricks(十六)—— 复制字符串
  2. Cosine Similarity of Two Vectors
  3. Rocky(模拟)
  4. spark作业运行过程之--DAGScheduler
  5. 利用windbg获取dump的dll文件
  6. 使用maven搭建SSH框架实现登陆、列表查询分页
  7. elasticsearch性能调优
  8. [转]浏览器缓存详解: expires, cache-control, last-modified, etag详细说明
  9. Python yield解析
  10. 使用 gradle 在编译时动态设置 Android resValue / BuildConfig / Manifes中<meta-data>变量的值