Last modified: May-29-2022, 02:40PM +08
Flutter Web and Microservices
If one ever needs to deploy neural-based services that can scale to zero, one of the best options include a client-server architecture that is based on microservices. This is not a comparison between software architecture design patterns, but rather an evaluation on the feasibility of flutter and microservices.
In most web applications, there is a common process which involves data aggregation and processing for downstream tasks. Some of those tasks include analytics, error reporting and threat monitoring. These tasks often come from different domains of data science, cybersecurity, cryptography, database, networking and distributed computing. It would be infeasible and impractical to expect any single programming language to cater to each and every domain. Not forgetting users of every level, ranging from novices to experts and public to enterprise.
The natural and intuitive solution to this hard requirement of cross-domain resources quickly points to a modularity of recomposing units with service granularity. Individual services can be improved incrementally, agnostic of language and platform. Communication can be independent or inter-dependent between separate components hosted on the same server. Seamless integration allows monolithic legacy and modern subsystems to be fully integrated.
Flexible integration with third-party resources such as autocomplete search engines, databases and object-stores are fully swappable for new frameworks and technologies in the future to prevent vendor lock-in.
Most managed backend solutions on the market today fully supports encrypted traffic with HTTPS. There is little reason not to secure and safeguard the user’s data and privacy against malicious actors looking to exploit zero-day vulnerabilities. There is a global community effort in developing and maintaining security standards and protocols which serve the needs of billions of users on the internet. These open-source cryptographic libraries form a critical part of the arsenal available to developers, without resource-stricken proprietary libraries exposing the attack surface.
The microservice developer also has access to open-source and efficient media codecs for both transmission and storage. Attributes of a microservice architecture are well suited for a rapid evolving technology that is seeking regional and global reach.
Development
Common message formats include HTTP, gRPC, GraphQL and WebSocket providing uni/bidirectional communication channel depending on the application. Maturity of these standards and protocols allow them to be widely implemented in languages popular with web development. With the advent of microservices in the early 2010s, Docker remains a popular tool for local development of containers.
There has been ongoing work on porting docker to Internet-of-Things(IoT), mobile and GPU platforms. The same codebase for any particular microservice can be easily adapted to target a diversity of platforms during expansion into surrounding markets. This is evident in the growing number of cross-platform web applications. The targeting platform can be expanded to include x86, ARM, RISC-V, NVPTX or AMD ISA, not excluding FPGAs and ASICs.
Service endpoints comprise of IoT, dedicated servers and public cloud for both internal and public facing APIs. To efficiently scale to millions of users, a container orchestration tool such as Kubernetes should be utilized to manage network traffic and computing resources.
Driven by open-source momentum, a healthy and growing ecosystem of developer tools is the end result of that collective effort. There is no lack of options targeting different niches of the technology stack required to bring a minimal viable product(MVP) to satisfy early adopters, which in turn provide valuable feedback for the next product iteration.
The adoption of continuous integration and continuous deployment(CI/CD) best practices simplifies testing and deployment of microservices. This strategy enables the timely delivery of new features on budget.
Deployment
Once a microservice is deployed, its API will accept authenticated requests for identity authentication and access-control of resources. Further restrictions on CPU, memory or GPU are enforced through configurations flags. Resource requirements can be forecasted based on usage patterns during off-peak and peak periods. Service granularity allows real time procurement of additional resources before spikes in traffic and also scaling to zero for deprecated services.
Containers by default have restricted access to host resources and they run in isolation with regards to other processes on the host system. A microservice being self-contained and coupled with its dependencies can be deployed in parallel with version control. As user base grows, vertical and horizontal scaling of these containers is what allow microservice to be scalable across different regions via cloud.
The high development cost is compensated by low cost of entry and low running costs with generous credits from public clouds. Network latency is offset with load-balancing proxies, CDNs and regional deployment with redundancies to ensure high availability to users.
Fine-grained handling and securing of network traffic is done using a service mesh such as Istio, Traefik or in-house solution. API security is enforced through threat and error monitoring with logging/tracing. To ensure high availability, periodic health checks are conducted on endpoints. In the event of a disruption, the operations team will be notified within seconds while an automated rollback or spinning of new instances during surges will take place simultaneously.
This composition of behaviors ensure the microservice stays fault-tolerant.
Security
- OAuth2
- SAML
- JWT
Future Applications
Self-driving vehicles and autopilot UI
Self-planning residential and industrial robots with remote human intervention
Self-organizing behavior in drone swarms at scale with mining and agriculture industries
Implementation of the first distributed superintelligence with a brain-computer interface
A bundle of artificial intelligence(AI) tools with the analogy of the Swiss army knife
What’s Next?
Experimentation of running neural-based eBPF programs as microservices with flutter.
Summary
Attributes of a microservice architecture are well suited for a rapid evolving technology that is seeking regional and global reach.
healthy, growing ecosystem of developer tools and CI/CD best practices ensures timely delivery of new features on budget.
composition of service granularity, identity and access control of resources ensures the microservice to remain fault-tolerant and highly available.
API security
future applications