JavaScript Took Over the Server, Its Time It Takes Over the Database Too

This ad is not shown to multipass and full ticket holders
React Summit US
React Summit US 2026
November 17 - 20, 2026
New York, US & Online
Upcoming event
React Summit US 2026
React Summit US 2026
November 17 - 20, 2026. New York, US & Online
Bookmark
Rate this content
Sentry
Promoted
Code breaks, fix it faster

Crashes, slowdowns, regressions in prod. Seer by Sentry unifies traces, replays, errors, profiles to find root causes fast.

Get started

Freestyle is a new JavaScript runtime that gets rid of your database, by letting you make your in memory JavaScript stateful🤯 . 

We're going to go through the implications of development beyond databases, and the implications for JavaScript engineers.

This talk has been presented at JSNation US 2024, check out the latest edition of this JavaScript Conference.

FAQ

Cloud State is a new JavaScript runtime developed by Freestyle that allows you to write entire applications in TypeScript, enabling both front-end and back-end development within a single language ecosystem.

Cloud State eliminates the need for external layers such as REST, HTTP, or GraphQL by allowing TypeScript code to run natively, reducing friction and improving efficiency within TypeScript teams.

Cloud State allows developers to write TypeScript code that directly interacts with a custom database engine, eliminating the need for writing SQL or using ORMs, thus simplifying data persistence and access.

Cloud State uses a new TypeScript engine to offload data behind the scenes, making it persistent without requiring a traditional SQL database. This is achieved through marking data structures with '@cloud state'.

Yes, Cloud State supports real-time applications by enabling seamless back-end and front-end interactions and maintaining data synchronization without additional infrastructure.

Freestyle Chat is an open-source chat solution that integrates seamlessly with Cloud State, providing a fully configurable and forkable chat feature without relying on third-party vendors for data handling.

Cloud State's database engine is designed to handle fine-grained transactions by breaking down objects into individual fields, optimizing performance and data access.

Cloud State allows developers to share entire features, including back-end logic and data infrastructure, as packages, facilitating easier collaboration and reuse of code.

To install Freestyle Chat, run 'npm install freestyle-chat', then import the back-end and front-end React components to integrate a live chat feature into your application.

Cloud State extends the capabilities of JavaScript runtimes by integrating data persistence and seamless back-end operations within the TypeScript ecosystem, akin to how Node.js revolutionized server-side JavaScript.

Benjamin Swerdlow
Benjamin Swerdlow
13 min
21 Nov, 2024

Comments

Sign in or register to post your comment.
Video Summary and Transcription
Hi, I'm Ben, the CEO of Freestyle. We're building Cloud State, a JavaScript runtime that allows you to write your entire application in TypeScript. We believe that bringing all the layers into TypeScript natively can greatly improve team efficiency. By marking a class as 'at cloud state', it becomes persistent and can be deployed without a SQL database. Connecting to the front end is as simple as accessing the functions directly. CloudState enables the sharing of back-end data infrastructure as packages, eliminating the need for web servers and endpoints. Freestyle chat is an open-source chat solution that can be easily integrated into applications. Cloud State has the potential to transform databases like Node.js did to servers, making development better for JavaScript users.

1. Introduction

Short description:

Hi, I'm Ben, the CEO of Freestyle. We're building Cloud State, a JavaScript runtime that allows you to write your entire application in TypeScript. We believe that bringing all the layers into TypeScript natively can greatly improve team efficiency. We created a new TypeScript engine that runs your code in the database, making it persistent and eliminating the need for translation layers.

♪♪ ♪♪ ♪♪ Hi, I'm Ben. I'm the CEO of Freestyle. We're building a new JavaScript runtime called Cloud State that lets you write your whole application in TypeScript.

Now a lot of you might be thinking you already write your whole application in TypeScript. But that's not true. You might write your front-end in TypeScript and you might write your back-end in TypeScript, but then you're using Superbase TypeScript to connect out to a SQL database. And then when you're connecting your back-end and your front-end, you're using a REST, HTTP, GraphQL, any of these things that are outside of JavaScript.

We believe that these layers cause the problem and friction in TypeScript teams. And when you bring them into TypeScript natively, your teams can run much more efficiently. Here's how we do that. We created a new TypeScript engine that lets you write your code as regular TypeScript and then it runs in the database. So what that means is that you could have a counter. And by just writing this counter, this data isn't stored in the heap. It's actually offloaded behind the scenes so that it's now persistent. Your TypeScript team isn't writing a Superbase translation layer. It's not writing SQL. Your team is now writing JavaScript, regular old JavaScript, and that's how it works.

2. Building a to-do list in TypeScript with freestyle

Short description:

When you use it in freestyle, you can write JavaScript code on your back-end and call your back-end functions from your front-end. Let's look at an example of building a to-do list in TypeScript with freestyle. By marking the to-do list class as 'at cloud state', it becomes persistent and can be deployed without a SQL database. Connecting to the front end is as simple as writing 'use cloud' of the to-do list and accessing the functions directly.

When you use it in freestyle, you actually go even further. Not only do we let you write this counter in JavaScript and have it be persisted on your back-end, but you can actually just call your back-end functions from your front-end without any issues.

So let's take a look at a slightly more complex example. This is how you build a to-do list in TypeScript with freestyle. Now, the first part of the to-do list is at cloud state. That's what tells us that this is persistent. So you can see we take a regular to-do list class, give it an ID, and mark it as at cloud state.

And then, we'll skip this for now. We're going to go return items.info, and that is running on the to-do item class, which also has an ID and has a regular function, toItems.info. And what you can see here if I zoom out is we have a 53-line file that exists in isolation with pretty much just regular TypeScript. You're taking a to-do list class. This is how you could write a to-do list regularly. And with a single line at cloud state, this class has now gone from being an in-memory thing that you can run on the front end to not just running in your back end, but also having the data persisted. So this can actually be deployed to production now without needing a SQL database. This is the database.

So, how do you connect to this from the front end? Well, what you can do is on the front end, you write use cloud of the to-do list. And now, I can do to-do list dot, and you can see the functions we wrote are right there. Add item with all of the strong types, all of the TypeScript, it's right there.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Debugging JS
React Summit 2023React Summit 2023
24 min
Debugging JS
Top Content
Debugging JavaScript is a crucial skill that is often overlooked in the industry. It is important to understand the problem, reproduce the issue, and identify the root cause. Having a variety of debugging tools and techniques, such as console methods and graphical debuggers, is beneficial. Replay is a time-traveling debugger for JavaScript that allows users to record and inspect bugs. It works with Redux, plain React, and even minified code with the help of source maps.
Building a Voice-Enabled AI Assistant With Javascript
JSNation 2023JSNation 2023
21 min
Building a Voice-Enabled AI Assistant With Javascript
Top Content
This Talk discusses building a voice-activated AI assistant using web APIs and JavaScript. It covers using the Web Speech API for speech recognition and the speech synthesis API for text to speech. The speaker demonstrates how to communicate with the Open AI API and handle the response. The Talk also explores enabling speech recognition and addressing the user. The speaker concludes by mentioning the possibility of creating a product out of the project and using Tauri for native desktop-like experiences.
A Framework for Managing Technical Debt
TechLead Conference 2023TechLead Conference 2023
35 min
A Framework for Managing Technical Debt
Top ContentPremium
Today's Talk discusses the importance of managing technical debt through refactoring practices, prioritization, and planning. Successful refactoring requires establishing guidelines, maintaining an inventory, and implementing a process. Celebrating success and ensuring resilience are key to building a strong refactoring culture. Visibility, support, and transparent communication are crucial for addressing technical debt effectively. The team's responsibilities, operating style, and availability should be transparent to product managers.
A Practical Guide for Migrating to Server Components
React Advanced 2023React Advanced 2023
28 min
A Practical Guide for Migrating to Server Components
Top Content
React query version five is live and we'll be discussing the migration process to server components using Next.js and React Query. The process involves planning, preparing, and setting up server components, migrating pages, adding layouts, and moving components to the server. We'll also explore the benefits of server components such as reducing JavaScript shipping, enabling powerful caching, and leveraging the features of the app router. Additionally, we'll cover topics like handling authentication, rendering in server components, and the impact on server load and costs.
Monolith to Micro-Frontends
React Advanced 2022React Advanced 2022
22 min
Monolith to Micro-Frontends
Top Content
Microfrontends are considered as a solution to the problems of exponential growth, code duplication, and unclear ownership in older applications. Transitioning from a monolith to microfrontends involves decoupling the system and exploring options like a modular monolith. Microfrontends enable independent deployments and runtime composition, but there is a discussion about the alternative of keeping an integrated application composed at runtime. Choosing a composition model and a router are crucial decisions in the technical plan. The Strangler pattern and the reverse Strangler pattern are used to gradually replace parts of the monolith with the new application.
Power Fixing React Performance Woes
React Advanced 2023React Advanced 2023
22 min
Power Fixing React Performance Woes
Top Content
This Talk discusses various strategies to improve React performance, including lazy loading iframes, analyzing and optimizing bundles, fixing barrel exports and tree shaking, removing dead code, and caching expensive computations. The speaker shares their experience in identifying and addressing performance issues in a real-world application. They also highlight the importance of regularly auditing webpack and bundle analyzers, using tools like Knip to find unused code, and contributing improvements to open source libraries.

Workshops on related topic

Building a Shopify App with React & Node
React Summit Remote Edition 2021React Summit Remote Edition 2021
87 min
Building a Shopify App with React & Node
Top Content
Workshop
Jennifer Gray
Hanna Chen
2 authors
Shopify merchants have a diverse set of needs, and developers have a unique opportunity to meet those needs building apps. Building an app can be tough work but Shopify has created a set of tools and resources to help you build out a seamless app experience as quickly as possible. Get hands on experience building an embedded Shopify app using the Shopify App CLI, Polaris and Shopify App Bridge.We’ll show you how to create an app that accesses information from a development store and can run in your local environment.
Build a chat room with Appwrite and React
JSNation 2022JSNation 2022
41 min
Build a chat room with Appwrite and React
Workshop
Wess Cope
Wess Cope
API's/Backends are difficult and we need websockets. You will be using VS Code as your editor, Parcel.js, Chakra-ui, React, React Icons, and Appwrite. By the end of this workshop, you will have the knowledge to build a real-time app using Appwrite and zero API development. Follow along and you'll have an awesome chat app to show off!
Hard GraphQL Problems at Shopify
GraphQL Galaxy 2021GraphQL Galaxy 2021
164 min
Hard GraphQL Problems at Shopify
Workshop
Rebecca Friedman
Jonathan Baker
Alex Ackerman
Théo Ben Hassen
 Greg MacWilliam
5 authors
At Shopify scale, we solve some pretty hard problems. In this workshop, five different speakers will outline some of the challenges we’ve faced, and how we’ve overcome them.

Table of contents:
1 - The infamous "N+1" problem: Jonathan Baker - Let's talk about what it is, why it is a problem, and how Shopify handles it at scale across several GraphQL APIs.
2 - Contextualizing GraphQL APIs: Alex Ackerman - How and why we decided to use directives. I’ll share what directives are, which directives are available out of the box, and how to create custom directives.
3 - Faster GraphQL queries for mobile clients: Theo Ben Hassen - As your mobile app grows, so will your GraphQL queries. In this talk, I will go over diverse strategies to make your queries faster and more effective.
4 - Building tomorrow’s product today: Greg MacWilliam - How Shopify adopts future features in today’s code.
5 - Managing large APIs effectively: Rebecca Friedman - We have thousands of developers at Shopify. Let’s take a look at how we’re ensuring the quality and consistency of our GraphQL APIs with so many contributors.
Build Modern Applications Using GraphQL and Javascript
Node Congress 2024Node Congress 2024
152 min
Build Modern Applications Using GraphQL and Javascript
Workshop
Emanuel Scirlet
Miguel Henriques
2 authors
Come and learn how you can supercharge your modern and secure applications using GraphQL and Javascript. In this workshop we will build a GraphQL API and we will demonstrate the benefits of the query language for APIs and what use cases that are fit for it. Basic Javascript knowledge required.
0 To Auth In An Hour For Your JavaScript App
JSNation 2023JSNation 2023
57 min
0 To Auth In An Hour For Your JavaScript App
WorkshopFree
Asaf Shen
Asaf Shen
Passwordless authentication may seem complex, but it is simple to add it to any app using the right tool.
We will enhance a full-stack JS application (Node.js backend + Vanilla JS frontend) to authenticate users with One Time Passwords (email) and OAuth, including:
- User authentication – Managing user interactions, returning session / refresh JWTs- Session management and validation – Storing the session securely for subsequent client requests, validating / refreshing sessions
At the end of the workshop, we will also touch on another approach to code authentication using frontend Descope Flows (drag-and-drop workflows), while keeping only session validation in the backend. With this, we will also show how easy it is to enable biometrics and other passwordless authentication methods.