[{"data":1,"prerenderedAt":76},["ShallowReactive",2],{"\u002Fbin-service-pattern":3},{"id":4,"title":5,"body":6,"createdAt":64,"description":65,"draft":66,"extension":67,"image":68,"mastodonThread":68,"meta":69,"navigation":70,"path":71,"seo":72,"stem":73,"tags":68,"updatedAt":74,"__hash__":75},"content\u002Fbin-service-pattern.md","A DX\u002FDevOps Pattern: bin\u002Fservice",{"type":7,"value":8,"toc":61},"minimark",[9,29,32,45,48,58],[10,11,12,13,17,18,23,24,28],"p",{},"One pattern I like a lot is a ",[14,15,16],"code",{},"bin\u002Fservice"," wrapper. In each of your services (I like to call them ",[19,20,22],"a",{"href":21},"\u002Fmacro-service","Macro Service"," instead of ",[19,25,27],{"href":26},"\u002Fmicroservice","Microservice",").",[10,30,31],{},"The idea is to provide a few key things:",[33,34,35,39,42],"ul",{},[36,37,38],"li",{},"Simple tools for developers to manage the service",[36,40,41],{},"Lifecycle hooks for deployment",[36,43,44],{},"All wrapped up in code, providing executable self-documentation",[10,46,47],{},"Imagine this:",[49,50,55],"pre",{"className":51,"code":53,"language":54},[52],"language-text","Usage: bin\u002Fservice \u003Ccommand>\n\nCommands:\n    system-setup          # Install machine dependencies (may require sudo)\n    init                  # Initialize config files and the DB\n    build                 # Build (rebuild) the image to get new deps\n    start [service]       # Start up the app or a specific sub-service\n    run [cmd] [args]      # Run a command in the 'web' sub-service\n    stop                  # Stop the app\n    status                # Get the app status\n\nDeployment Commands:\n    deploy \u003Cenv>          # Deploys an environment using CI\n    force-deploy \u003Cenv>    # Deploys an environment using your machine\n\nDatabase Commands:\n    reset-db-from-staging # Download\u002Frestore from staging database\n    reset-test-db         # Reset local test database (load schema\u002Fseed)\n    db-snapshot \u003Cfile>    # Use local psql to snapshot a DB dump to a local file\n    db-restore \u003Cfile>     # Use local psql to load a DB dump into the running db\n\nLifecycle Commands, used by Kubernetes\u002FHelm:\n    boostrap-job          # Entrypoint for bootstrap job\n    start-web-pod         # Entrypoint for web pod\n    start-worker-pod      # Entrypoint for starting the worker pod\n    stop-worker-pod       # Entrypoint for stopping the worker pod\n    upgrade-job           # Entrypoint for upgrade job\n    build-assets          # Build step to compile assets prior to container build\n    shell                 # Entrypoint for bash process (for a debugging pod)\n","text",[14,56,53],{"__ignoreMap":57},"",[10,59,60],{},"These service-oriented commands don't really care what your internal-app tech stack is. But by standardizing the commands you can depend on them in a bunch of contexts. The most important is that you can run them both in your dev env, and then the lifecycle hooks can be part of a helm chart setup. You can have one generic chart that can manage any service that conforms to this general shape.",{"title":57,"searchDepth":62,"depth":62,"links":63},2,[],"2025-10-0","One pattern I like a lot is a bin\u002Fservice wrapper. In each of your services (I like to call them Macro Service instead of Microservice).",false,"md",null,{},true,"\u002Fbin-service-pattern",{"title":5,"description":65},"bin-service-pattern","2025-09-30","qSRa8e_YZmxB4DI1ciTgJ7sHU7GG_EZ1oN8aNYZRnZ4",1778988315608]