Package: halo-bian
Halo Bian - Flask BIAN Python Reference Architecture LibraryTheHalo Bianlibrary is based on theHalolibrary which is a python based library utilizingServerlesstechnology andmicroservices architectureBIAN (Banking Industry Architecture Network) is a membership group committed to developing open standards around banking and financial services.  A key deliverable of this group is the BIAN Service Landscape model which defines a comprehensive services architecture for financial transactions and facilities.  This library is an implementation of the BIAN model leveraging the Flask framework and allows a developer torapidly create BIAN-compliant serviceswhile hiding much of the underlying BIAN model details.  Seewww.bian.orgfor more information on BIAN.This library leverages not only the Flask framework, but a number of the Flask Cloud Services components as well to facilitate building robust and resilient cloud-native BIAN microservices.
deploy your Service Domain to your local environment or useServerless Frameworkandzappato deploy your Service Domain to AWS.BIAN BasicsBefore diving into the library architecture, it helps to understand two key concepts within BIAN, service domains and control records.Service DomainThe BIAN Service Landscape defines discrete areas of responsibility known as service domains.  AService Domainis a combination of aFunctional Patternand anAsset Type.  For instance, using the functional pattern 'Registry' with the asset type 'Product' would yield a 'Product Registry' service domain, which could be used to manage a product catalog.  If we instead changed the asset type to 'Device', we would have a 'Device Registry' service domain that could be used to authorize services on a mobile device.Control RecordTheControl Recordis used to track the state of a service domain, and like the service domain is derived from the functional pattern and asset type.  However, in a control record, the functional pattern is represented by theGeneric Artifact Type.  There is a one-to-one correlation between functional patterns and generic artifact types.  The control record goes one step further in delineating between specific service domain operations by introducing an additional parameter called theBehavior Qualifier, which, like generic artifact types, have a one-to-one correlation with functional patterns.In AdditionThe commercial behaviors that are called Functional Patterns. Functional Patterns, Generic Artifacts and Behavior Qualifier Types are mapped and correlated:Image From Bian ManualA Service Domain applies one of the 18 functional patterns to instances of one type of asset:Image From Bian ManualThe standard set of â€˜action termsâ€™ that characterize the range of service operation calls :Image From Bian ManualThe Default Action Term By Functional Pattern matrix:Image From Bian ManualBIAN SummarySo to summarize the above:Functional Pattern==>Generic Artifact Type==>Behavior QualifierFunctional Pattern+Asset Type=Service DomainGeneric Artifact Type+Asset Type+ (optional)Behavior Qualifier=Control RecordFunctional Patternis correlated with a set ofAction Term=Service Domain OperationsKey Benefits of using BIAN API solutions:Support for Emerging Industry Approaches â€“ Two key technology approaches are considered: API development and the adoption of a Micro-service architectureSupport for Industry Standards â€“ The BIAN Service Domains and service operations present an Industry standard definition for the componentization and service enablement of BankingSupport for Incremental Adoption/Migration â€“ BIAN aligned solutions can be implemented and adopted incrementally enabling a prioritized migration from constraining legacy architecturesArchitectureThe Flask BIAN library implements a BIAN service domain wrapper that acts as an API and data translator while hiding much of the BIAN model complexity from the developer.Halo Bian provides the following features:Bian version 7 - API release competabilityOAS ver. 2 supportBianRequest object provides bian parameters supportServiceProperties object provides service statusAssetType, GenericArtifact, BehaviorQualifier support per service domainBianServiceInfo object privides Bian details per serviceSupport for all Bian Service OperationsSupport for all FunctionalPatternsHalo provides the following features:Flask development for AWS Lambda & Dynamodbcorrelation id across microservicesstructured json based loggingsample debug log in productionsupport for microservice transactions with the saga patternusing SSM Parameter Store over Lambda env variablesServerless Error Handling & trace id for end usersLambda timeoutmanagement forslow HTTP responsesootb support for Idempotent service invocations (md5)If you are building a Python web app running on AWS Lambda (Flask), use this library to manage api transactions:sagax = load_saga("test", jsonx, schema)
            payloads = {"BookHotel": {"abc": "def"}, "BookFlight": {"abc": "def"}, "BookRental": {"abc": "def"},
                        "CancelHotel": {"abc": "def"}, "CancelFlight": {"abc": "def"}, "CancelRental": {"abc": "def"}}
            apis = {"BookHotel": self.create_api1, "BookFlight": self.create_api2, "BookRental": self.create_api3,
                    "CancelHotel": self.create_api4, "CancelFlight": self.create_api5, "CancelRental": self.create_api6}
            try:
                self.context = Util.get_lambda_context(request)
                ret = sagax.execute(self.req_context, payloads, apis)
                return {"saga": "good"}, 200
            except SagaRollBack as e:
                return {"saga": "bad"}, 500LicenseThis project is licensed under the MIT LicenseAcknowledgmentsPivotal-Field-Engineering -https://github.com/Pivotal-Field-Engineering/spring-bianBian api -https://github.com/bianapisBian -http://bian.org