Back to All Episodes
Season 3Episode 113

WeaveDB, a Decentralized NoSQL Database Solution

May 11, 2024
33m
1 Guest

Listen Now

About This Episode

In this episode of DevNTell Narb hosts Ahmad Mardeni, CEO and Co-founder of WeaveDB, to discuss a decentralized NoSQL database solution designed for Web3. Mardeni explains how WeaveDB eliminates the single point of failure in decentralized applications (dApps) by replacing centralized databases with a modular, blockchain-based storage layer. He demonstrates the platform's console, showcasing how to deploy databases, manage data collections, define schemas, and implement complex access control rules using Arweave's permanent storage and unique functional programming tools like FPJSON.

Key Takeaways

1

WeaveDB addresses the centralization gap in Web3 by providing a decentralized alternative to NoSQL databases like Firebase and MongoDB.

2

The platform leverages Arweave for permanent, cost-efficient data storage, separating storage from computation to ensure scalability.

3

WeaveDB introduces FPJSON, a functional programming language built on JSON, allowing developers to implement sophisticated on-chain logic like access control and cron jobs.

4

Developers can interact with WeaveDB through a no-code console or an SDK that mimics traditional APIs like Firestore, minimizing the learning curve for Web2 developers.

5

The roadmap includes Rollup-as-a-Service (RaaS) to deliver 1000x performance improvements for high-traffic decentralized applications.

Featured Guest

AM

Ahmad Mardeni

CEO @ WeaveDB

WeaveDB

Timestamps(click to jump)

Episode Transcript

Narb

Welcome to another great DevNTell. DevNTell is a 30-minute podcast for builders to showcase something they are passionate about or have been building in Web3. This could be an awesome project you've been working on, demonstrating testing best practices, automation goodies, or how to structure smart contracts. If you've got a passion for something, this is your platform to share it with the Web3 community. Today, I am ecstatic to have Ahmad Mardeni, the CEO of WeaveDB, on the show. He's going to be going over what WeaveDB is, how to use it, why it needs to exist, and how you can get started with it today.

Ahmad Mardeni

Thanks a lot for having me. I'm actually one of the first members of Developer DAO. I joined around two or two and a half years ago. I still have the NFT actually. I'm one of the early NFT holders and I'm really proud of where it is right now. My name is Ahmad Mardeni, I'm the CEO and co-founder of WeaveDB. I started with Web3 around four years ago. I was basically just trading on the side and then I saw a couple of coins that went 5x in a couple of weeks and I had to dive into the projects themselves.

Ahmad Mardeni

I contributed to many projects over the years, one of them was The Graph, an indexing solution, and we started WeaveDB a couple of years ago to solve the problem of having centralized databases. WeaveDB is currently based in Abu Dhabi, so we are a part of Hub71 and we are officially supported by the government of Abu Dhabi. They are trying to build a tech ecosystem in the region and they recently started accepting Web3 startups.

Ahmad Mardeni

Let me share my screen and dive into the problem and the solution. The main problem we are solving with WeaveDB is that most dApps are using centralized databases. If you are building any decentralized application, your first database of choice would be Firestore by Google, MongoDB, or others. We believe that this is a single point of failure. The database manager can shut down at any point in time, the service provider can change the prices, and if you want to give access to other developers, you need to give them specific permissions because it's not public.

Ahmad Mardeni

No one has built a fully decentralized database before because blockchains are not practical enough to build databases on top. You need to ensure one millisecond finality per transaction and you need to have ACID properties. Blockchains are really expensive and slow. We built WeaveDB as a modular database with four different layers: data sources, indexers, query parsers, and public APIs. We use Arweave for permanent storage. Our indexers are built within the smart contract itself, so you don't need an indexing solution on top.

Ahmad Mardeni

We recently announced a solution called zkJSON. It's basically a way of bringing off-chain data on-chain. You can generate a zero-knowledge proof of something that exists off-chain and then store it on WeaveDB to access it from any smart contract on any EVM chain. Each WeaveDB database is a smart contract itself and we separate computation from storage. Storage is happening on Arweave permanently and computation is happening off-chain on the client side.

Ahmad Mardeni

You can go to console.weavedb.dev to deploy your first ever database without writing a single line of code. We support any wallet, so you can use any EVM chain. I'm going to connect my MetaMask and click on deploy database instance. It took us one second to deploy. If you click on the transaction ID, you can find more info. You can see the address of the owner and the version of the database. Now I'm going to sign into the database using my EVM wallet. All future transactions will be using the same key.

Ahmad Mardeni

Next, I'm going to add a new collection called 'people'. I assign a collection ID and click add. Now I can add a new document. I'll use the 'add' query which assigns a random document ID. I'll add a string name and a number for age. If I refresh, you can see the new document ID with the data Bob, age 20. I can also use a 'set' query to choose the ID myself. I'll add 'Narb' with age 33 and assign the ID as 'Bob'. You can see we now have the ID we specified with Narb's data.

Ahmad Mardeni

I can also update a document within the smart contract. I'll update the age to 30. Even though data is permanently stored on Arweave, everything is stored as a state of a smart contract, so updates just create a new state. Next, I'll set up a data schema. If you have a database, you need a schema so people don't add random types of data. I'll specify that 'name' must be a string and 'age' must be a number. If someone tries to add data that doesn't follow this structure, the query will fail with an 'invalid schema' error.

Ahmad Mardeni

One of the reasons no one tried to build a database on existing blockchains before is access control. We built a programming language called FPJSON that allows you to execute JavaScript functions as JSON arrays. Using FPJSON, we built access control rules. I can specify who can interact with my database to a really detailed level. For example, I can make a rule that only the signer who created the document can update it. If someone else connects to my database and tries to edit a document, it will fail.

Ahmad Mardeni

We also have cron jobs, which are scheduled tasks on-chain. If you are building a social media dApp, you might want a like or follow to trigger an increment in a total count. You can do this fully on-chain with cron jobs without needing a server-side software. We also have relayers to bring off-chain data in. While using WeaveDB as a smart contract is good for low or mid-traffic, we are releasing RaaS (Rollup-as-a-Service) soon, which will give 1000x performance.

Narb

Can people assume their data is encrypted or is it all public? Also, are they paying from their wallet when they upload data?

Ahmad Mardeni

I don't recommend using WeaveDB for sensitive personal data yet because it's built for public-facing dApps like social media. However, you can use Lit Protocol to encrypt data before putting it on WeaveDB. Currently, everything is subsidized by the Arweave team, so users aren't paying gas fees. In the near future, there will be a very low fee per query, likely around seven zeros one per transaction, depending on data size.

Ahmad Mardeni

We've seen interesting projects built on WeaveDB, including a gambling platform, a music NFT marketplace, and Lens-based applications. One project, NFT Canvases, uses WeaveDB to index NFT collections and associate physical prints with their owners. This ensures that even if the company disappears, the database remains on-chain forever. If you want to get started, check our official documentation for the five-minute quick start tutorial to deploy your database and download the SDK.

Narb

Thank you so much Ahmad for sharing WeaveDB. All the information on how to contact Ahmad and the documentation will be in the YouTube description. Before people leave, I want to share a QR code for you to scan to claim your attendance NFT on the Base network. Happy Friday, happy weekend, and we will see you back here next week for another great episode of DevNTell.

Listen On

Share This Episode

Share on X

Watch Episodes Live!

Subscribe to our event calendar and never miss a live episode.

View Event Calendar