from Hacker News

Show HN: Generate System Design diagrams from design spec

by jayaprabhakar on 9/4/24, 4:57 PM with 2 comments

When designing a distributed system, creating and maintaining design documents with diagrams is time-consuming. FizzBee, our formal methods system, simplifies this process by generating a variety of essential diagrams from a concise, Python-like specification.

FizzBee automatically checks your design for correctness and generates:

- Communication/Block Diagrams: Visualize the components and their interactions.

- State Diagrams: Show all possible system states and transitions.

- Sequence Diagrams: Explore how the system works interactively.

- System Trace Diagrams: Visualize detailed algorithm traces.

All this with less than 100 lines of code.

Here’s a snippet of how simple it is to model a two-phase commit:

```

  action Write:
    if self.state != "init":
      return
    self.state = "working"
    for rm in self.PARTICIPANTS:
      vote = rm.Prepare()

      if vote == 'aborted':
        self.Abort()
        return

      self.prepared.add(rm.ID)
    
    self.Commit()
```

Try it out and see more examples at https://fizzbee.io/tutorials/visualizations/.

Appreciate your feedback.

  • by jackdaniels4me on 9/4/24, 5:51 PM

    This is neat! How does this compare with tools like draw.io or mermaidjs