Removing business logic from transaction processing

Removing business logic from transaction processing

If you are a fan of uncle Bob, you will not be strange to his idea of clean architecture, which basically says business logic is the core of any architecture design rather than frameworks or external systems such as database.

In the Agile world, one should maximise the decisions not made in terms of what database to use and even whether to use a database or not. Instead focus on prioritizing the business logic as much as possible. Because the rates of change of business logics is much less than technologies.

From this perspective, it makes little sense to encode business logic in stored procedures.

Another consideration one should take is the fact that normal programming languages are much more powerful than stored procedures. Considering modern languages such as Scala, it's much more concise, expressive and maintainable to put complex business logics in it rather than in stored procedure.

Lastly, perhaps most people omit is the concern of scalability. Transactional database is one of the most difficult components in your system to scale. The database is usually built with expensive special hardware tuned for transaction processing. Scaling such kind of system is going to be very difficult comparing to adding more Linux app server or web server or using cloud computing.

Are you convinced by now?

要查看或添加评论,请登录

Tony Zhou的更多文章

  • Micro services Shared Database Pattern

    Micro services Shared Database Pattern

    Database should almost never be shared among services. The disadvantages are obvious: We decline ourselves the…

  • The Yin and Yang of Scala: Any and Nothing

    The Yin and Yang of Scala: Any and Nothing

    There are Yin and Yang in Scala. The Yin: Nothing: The sub type of all types, but have no instance.

  • Distribute your work to improve scalability

    Distribute your work to improve scalability

    Scalability comes from the ability to distribute the work that needs to be done to the proportionally growing software…

  • How to achieve simplicity in software engineering?

    How to achieve simplicity in software engineering?

    Focus only on "not being complex" does not address the issues created in requirements, design and development. To…

  • How to plan scalability

    How to plan scalability

    Use the D-I-D (Design, Implement and Deploy) guide line to plan scalability. That is, in the design phase, you want to…

  • Prefer simplicity to complexity

    Prefer simplicity to complexity

    Complex solutions cost more to build, harm user experience and hinder scalability. 80% of the software engineers and…

    2 条评论
  • Design your program to be monitored

    Design your program to be monitored

    Putting hocks in your program so that it can be easily monitored can greatly increase your confidence of the health of…

  • The advantage of "feature flag"

    The advantage of "feature flag"

    Many times we deploy new code to the production environment over the weekend to release a new feature and only find…

  • Storage analysis with marketing rules

    Storage analysis with marketing rules

    Storage may be cheaper and cheaper today. But whenever you are in a business that needs scaling, storage utilisation…

社区洞察

其他会员也浏览了