Traditionally, SaaS managers might trigger server-side actions (like creating a database, configuring Nginx, or restarting services) by executing raw shell commands over SSH directly from the application code. While this seems straightforward, it introduces significant technical debt and operational risks:
🚫 Lack of Idempotency: Running a raw command twice may cause errors or duplicate configurations. If a script fails halfway, there is no automatic rollback or state correction.
🔒 Security Vulnerabilities: Managing SSH private keys directly within the application database or code is a security risk. It often requires broad root access for simple tasks, violating the principle of least privilege.
📉 Poor Maintainability: Shell scripts embedded in code are hard to read, version control, and debug. As infrastructure grows, "spaghetti code" for server management becomes unmanageable.
🌑 No State Tracking: Direct commands are "fire and forget." It is difficult to track the history of changes, audit who did what, or verify the actual state of the server against the desired configuration.