RuBaRu — a fully on-chain creator-consumer economy

RuBaRu embraces microservices and amplifies performance with DFX 0.15.0 composite queries to build an decentralized creator-consumer economy.

RuBaRu
The Internet Computer Review
4 min readNov 29, 2023

--

RuBaRu aims to create a vibrant mobile-first 100% on-chain DAO-based tokenized economy owned and governed by the community, where creators, influencers, consumers, and brands coexist harmoniously. By doing so, we unlock new opportunities, reshape digital creativity, drive economic growth, and foster a thriving ecosystem of shared prosperity.

Phase#1: POC for the hypothesis that a fully on-chain creator-consumer economy can be constructed atop the ICP blockchain infrastructure. We initiated the development process and constructed a monolithic backend consisting of 2 canisters. This backend functions as a server application that comprehensively stores and streams everything in a Full-Stack On-Chain manner, encompassing Code, Database, and assets such as images and videos.

Phase 1: POC with Monolithic Architecture

We introduced a pre-beta release to an exclusive group of users within the ICP community, gathering invaluable feedback on our creation. The response was nothing short of phenomenal, leaving the community awe-inspired. Many expressed that the user experience surpassed anything they had encountered in other Web3 DApps. Our community even Branded us as the ‘Web3 Instagram,’ yet our ambitions go beyond the label.

Phase#2: Time to evolve into a DApp that will onboard the world of Social media users

Looking at the potential of building a fully decentralized creator-consumer ecosystem, RuBaRu, found itself at a critical juncture, poised to redefine its system architecture for optimal scalability, adaptability, and unwavering availability. The transition from a monolithic framework to the auto-scalable microservices model was not just an obvious choice but a strategic imperative to onboard the full spectrum of Social media users worldwide to challenge centralization and maximize impact.

Embracing the essence of microservices — a modular approach that divides the monolithic system into smaller, independent services(canisters) — was a logical move for RuBaRu. This decentralized structure empowered the system with unparalleled agility, adaptability, and fault tolerance, enabling it to effortlessly scale to meet the burgeoning demands of an ever-expanding user base. The system underwent a transformation, splitting into smaller services, each tailored to specific business functions and possessing well-defined, limited-scope responsibilities:
1. User Service
2. Video Post Service
3. Image Post Service
4. Comment Services
5. Audio Service
6. Search Service

Phase 2 - RuBaRu — Micro Services Architecture

However, a significant challenge emerged in the form of inter-canister calls, where query calls were often transformed into update calls, leading to a drastic reduction in API response time.

Issues with Inter-canister calls pre-Composite Queries

Recognizing that the average attention span of a mobile app user is approximately 5–8 seconds, it becomes crucial to deliver content within just a few seconds. Failing to do so makes it exceedingly difficult to engage traditional social media users effectively. The engineering team at RuBaRu worked to optimize these inter-service(inter-canister) communications(including data structures and algo optimization), ensuring efficient orchestration while preserving system integrity and performance.

Phase#3: Embracing Composite Queries

Amidst this transformation, a pivotal moment arrived with the introduction of DFX 0.15.0 composite queries — a milestone that would redefine RuBaRu’s trajectory. Recognizing the roadmap set forth by the Dfinity team regarding the implementation & release of composite queries, RuBaRu seized the opportunity and strategically aligned its migration to microservices architecture.

Inter-service(canister) communication powered by Composite Queries

With composite queries, the paradigm shifted dramatically. Data access and processing became exponentially efficient, catapulting RuBaRu’s responsiveness to user requests to unprecedented levels. The conversion of inter-canister query calls to update calls was eliminated, significantly enhancing the overall API response time.

This strategic move, migrating to a microservices architecture in sync with the roadmap for implementing composite queries, marked a watershed moment for RuBaRu. RuBaRu’s ambition is to emerge as a potent force in the digital realm, setting a new standard for decentralized, microservices-driven platforms that could rival and surpass the efficiency of centralized Web 2.0 applications.

Benchmarking the improved API latency

Presented here is a graphical illustration showcasing a monumental accomplishment — RuBaRu’s API endpoint latency enhancement, a result of integrating one of the Dfinity team’s groundbreaking innovations: Composite Queries. In this data-packed chart, we proudly present the significant improvements in API latency, a true testament to the ICP ecosystem’s path toward replacing traditional cloud services. Remarkable progress indeed!

RuBaRu — API response time in seconds — 3rd(orange) bar showcases the improved latency after using Composite Queries

Conclusion

RuBaRu’s voyage from a monolithic structure to microservices was indeed an inevitable choice. Still, it was the strategic timing and integration of DFX 0.15.0 composite queries that elevated this transition to a whole new level. The fusion of microservices and composite queries unlocked the true potential of RuBaRu, propelling it to the forefront of the digital landscape and setting the stage for a future where decentralized platforms reign supreme in efficiency and performance.

Know more about RuBaRu:

--

--

RuBaRu
The Internet Computer Review

RuBaRu - Fully OnChain Content Creator-Consumer Economy! Helping Creators & Consumers build Decentralized Autonomous Ecosystem powered by #DeAI!