A Compilation of Free and High-Quality Serverless Databases

A Compilation of Free and High-Quality Serverless Databases

Daily short news for you
  • Here! A question that I've been wondering about for ages, and until yesterday, everything was finally clarified.

    Normally, people use height: 100vh to set the height equal to the viewport of the screen. On computers, there's no issue, and even simulating the size of a smartphone works fine. But when opened on a phone, height: 100vh always exceeds the viewport. Huh!? What's going on???

    The explanation for this is that mobile devices have a different way of calculating the viewport compared to computers. It is often interfered with or affected by the address bar and navigation bar of the platform you are using. Therefore, if you want 100vh on mobile to truly equal the viewport, you need to take an additional step to reset the viewport.

    It's easy, first, you need to create a CSS variable --vh right in the script tag at the top of the page.

    function updateViewportHeight() { const viewportHeight = globalThis.innerHeight; document.documentElement.style.setProperty('--vh', `${viewportHeight * 0.01}px`); } updateViewportHeight(); window.addEventListener('resize', updateViewportHeight);

    Then instead of using height: 100vh, change it to height: calc(var(--vh, 1vh) * 100). And that's it.

    » Read more
  • Nowadays, how much memory will 1 million (1M) concurrent tasks consume? That is the question posed by hez2010, and he decided to find the answer by experimenting with a simple program in various programming languages: How Much Memory Do You Need in 2024 to Run 1 Million Concurrent Tasks?

    To summarize, Rust remains unbeatable, but the second position surprised me 😳

    » Read more
  • Is something coming? 😱🥶

    » Read more

The Problem

I'm sure there are many people here who are familiar with the name MongoDB, a No-SQL database that was once very popular. A few years ago, anyone who didn't know or work with Mongo might have been considered "outdated". Ha! I'm just joking, of course, but I want to emphasize its widespread use.

There are many ways to set up a Mongo server, from configuring it through the source code to installing it through the package manager integrated in the operating system, such as apt on Ubuntu or brew on MacOS. Just type a few commands and the software is installed in a few minutes. These software are usually converted into services, making it easy for the operating system to manage and monitor the status of the running application. Later, Docker became popular and people started using it to deploy everything from development to production environments. However, all these methods have one thing in common - they require management resources. Any software-related issues can bring down the system at any time. If an error occurs, you have to find the cause and fix it yourself.

One day, Mongo Atlas appeared. I was curious, so I signed up to try it out. As it turned out, it was just a Mongo server. Instead of setting it up on my own server, they - Mongo Atlas set it up on a cluster of servers that they managed. "Strange, why did they do that? Isn't setting it up on their own server much cheaper?" I looked at the price list and wondered.

After using it, I realized that Atlas provides system monitoring features, which are like a dashboard that summarizes system parameters, and many functions that previously required commands to execute. Many of these features are very intuitive and convenient to use. No need to remember and type long commands anymore. Just log in to the management page to see the current system status.

So, why did I mention Mongo Atlas?

With the continuous development of technology, people are always coming up with innovative solutions. Many providers have found ways to reduce the workload of developers. Instead of having them set up the system, spend time maintaining it, and manage risks... they will take care of all that. What developers need is to focus on developing and creating applications that run smoothly and efficiently.

Mongo Atlas has also supported serverless databases, indirectly acknowledging that serverless is an inevitable trend. Where users pay as they go. Inheriting the advantages of the Atlas infrastructure, serverless databases aim at individual users, rather than businesses as before. Enterprise customers always bring in huge revenue, but individual customers are also a huge potential if they know how to "take care" of them.

Serverless databases may be a new concept to many people. For example, I only learned about it about a year ago. The term "serverless database" refers to a database model where users do not need to manage resources such as servers, hardware, or infrastructure. It is completely different from traditional server deployment. Here, what we focus on is using development time, rather than configuring and maintaining the system.

However, serverless databases may not be suitable for everyone. The cost is calculated differently than traditional servers, depending on each provider, but generally based on the number of queries and storage capacity.

I am one of the people who have benefited from the serverless architecture. The evidence is that I have reduced the operating cost of my blog to zero. Therefore, today, I will summarize some services that provide free but limited serverless databases, which are very generous. I hope this helps readers.

Serverless Databases based on MySQL

TiDB is an open-source distributed database, based on MySQL. Like other open-source projects, TiDB provides Cloud services so you don't need to deploy it yourself. Moreover, TiDB offers a free package to "try out".

Specifically, the total storage capacity is up to 25GB for row/column data, accompanied by 250 million query units - simply put, the read/write speed of the CPU for each query, and even the Internet bandwidth is calculated. To learn more about the calculation method, read What is a Request Unit (RU).

Databases created on TiDB support the MySQL connection standard. That means you can use any library compatible with MySQL to connect to this database. Besides, Serverless is not left out when TiDB supports Cloudflare Workers, Vercel Edge Functions, and Netlify Edge Functions... TiDB Cloud Serverless Driver Node.js Tutorial

Serverless Databases based on PostgreSQL

Supabase is probably a name I've mentioned in many of my articles. Supabase supports Postgres very fully, almost everything you can do with Postgres can be done on Supabase. Like Functions, Triggers, or even Extensions...

Supabase offers a free package with limited storage capacity, only 500MB. But in return, the quality and stability are relatively high.

Neon is the next name, similar to Supabase. Also based on Postgres, also with 500MB storage capacity, accompanied by some limitations on computational units and 5GB Data transfer. Neon is also compatible with Postgres drivers. Both have drivers compatible with serverless environments. Although I haven't directly experienced it, Neon is being trusted and used by many people.

Xata.io seems to be a prominent name when compared to the two above. The storage capacity is up to 15GB... and no other limitations were found on the number of queries, processing speed, or bandwidth... Moreover, Xata also integrates AI chat support if you have any questions to answer.

Xata is compatible with Postgres drivers and, of course, serverless environments.

Serverless Databases based on SQLite

Since I learned about Turso, I have had a different view of SQLite. Previously, working on many projects, Postgres was always the top choice because it was too stable. While SQLite was suitable for small projects and local development, such as mobile applications.

Turso brought SQLite "to the cloud" and firmly stated that SQLite could definitely be used for large-scale real-world projects. They were very generous when they released a free package with a large storage capacity. Up to 9GB of storage, 1 billion reads, and 25 million writes.

Since I started moving my projects to Cloudflare to optimize costs, the name D1 appeared under the "Beta" label - meaning it's being tested before being officially released. D1 is a database based on SQLite. Before wanting to use D1, you need to upgrade your Cloudflare account to Paid. Additionally, D1 supports serverless environments very limitedly, only being compatible with Cloudflare Worker and not supporting SQLite drivers or other serverless environments.

Conclusion

The above is just a few among many names I know. I believe that in the near future, more names will join this game. Are you using any of the services mentioned in this article? Or is it another service? What are its pros and cons? Please leave a comment below!

Premium
Hello

Me & the desire to "play with words"

Have you tried writing? And then failed or not satisfied? At 2coffee.dev we have had a hard time with writing. Don't be discouraged, because now we have a way to help you. Click to become a member now!

Have you tried writing? And then failed or not satisfied? At 2coffee.dev we have had a hard time with writing. Don't be discouraged, because now we have a way to help you. Click to become a member now!

View all

Subscribe to receive new article notifications

or
* The summary newsletter is sent every 1-2 weeks, cancel anytime.
Author

Hello, my name is Hoai - a developer who tells stories through writing ✍️ and creating products 🚀. With many years of programming experience, I have contributed to various products that bring value to users at my workplace as well as to myself. My hobbies include reading, writing, and researching... I created this blog with the mission of delivering quality articles to the readers of 2coffee.dev.Follow me through these channels LinkedIn, Facebook, Instagram, Telegram.

Did you find this article helpful?
NoYes

Comments (1)

Leave a comment...
Avatar
Ẩn danh2 days ago
Xata với turso con nào ngon hơn vậy bác
Reply
Avatar
Xuân Hoài Tống1 day ago
Xata thì mình chưa dùng nhiều, nhưng nó không có nhiều tính năng bằng Supabase. Còn Turso là sqlite rồi, phù hợp với mấy tác vụ cơ bản, đơn giản, và rất ngon 😁