Logux

Logux logo

Why not AJAX?

Working on collaborative features at the system level, engineers don’t often take into account editing conflicts or loss of connection. This constant forgetfulness occurs because they don’t happen on the developer’s local machine (when the client and server are running together). This results in poor UX for the end users.

The classic request-response approach (as in AJAX/REST or GraphQL) is not designed for real-time UI and makes accounting for non-perfect mobile connections incredibly difficult. Moreover, this approach takes too much effort to design a good UX: even large engineering teams may not have enough resources.

Logux provides an out-of-the-box solution to eliminate these problems. Further, it’s not just a library, it’s a revision of the approach to communication between server and client.

A new approach

Logux promises to change the way developers build offline-first web applications by introducing a novel approach to synchronize application state through the concept of append-only action logs. This approach makes it easy to create a smooth UX for an application in the network connections area (for instance, for an application to be ready for a temporary downtime).

Logux enhances collaborative apps operation when multiple users work with the same document. Users don’t need to wait for a server response for every activity. Any changes that they might perform locally on their computers are seamlessly synchronized with the service in real-time. It allows data synchronization even in complex cases, resolves conflicts, and solves “offline” problems.

Real-time

Logux combines WebSockets with modern reactive client architecture. It synchronizes user actions between clients and servers, and keeps the same order of actions on every machine.

This solution is relevant for plenty of situations from the real world.

  • If the Internet connection breaks while the user is making any updates (for example, a user enters the subway)—Logux will save the changes and send them as soon as the connection appears.
  • If two users edit the same document at the same time—Logux will automatically resolve the conflict using, for instance, CRDT Map strategy.
  • If a user with an old client connects to a new server (for instance, it’s been a week since a user has updated the page that’s open in the browser while you’ve already deployed the server with protocol changes 3 times). Each operation in Logux has a client version stamp—the server will ask the user to refresh the page on its own (if the protocol version is old) or the developer can add a client version check-up.
  • If a request to change something is sent before the server responds that everything has successfully been saved, Logux will roll back changes if the server sends an incorrect response. This avoids the use of loaders, which carry some speed limitations.

No vendor lock-in

The synchronization system in Logux doesn’t tie you to any cloud or stack and works in any cloud with any database. Logux is easy to configure, and it’s simple to get to its core and change it a little bit.

Logux’s approach to client-server communication is based on the Local-first philosophy, which is now gaining popularity and supports the design of a new generation of collaborative software allowing users to retain ownership of their data.

This approach helps keep infrastructure flexible: you can initially host your app on AWS and then migrate to Google Cloud or even deploy it on your own server via Docker image. At the same time, on the client side, Logux can work with React, Svelte, Vue, or pure JS.

Elements of the Logux branding

Elements of the Logux branding

Optimistic UI

You can improve UI performance by updating UI without waiting for an answer from the server. Time travel will revert changes later if the server refuses them.

Offline-first

Logux saves Redux actions to IndexedDB and has a lot of features to merge changes from different users.

Less dependencies

We implemented the capability to transport Logux actions to REST requests and improved sync channels for Logux Server—this can help halve the number of dependencies in your project.

Small size

Logux is a very compact library, and unlike some modern solutions, it does not include code that won’t be used in theJS bundle (due to the API design). You’ll get just an extra 9 KB in the client-side JS bundle.

Pro version

Logux’s Pro version supports scalability—you can run Logux servers on several servers to scale your app faster under increasing loads—and monitoring to trace these loads and other Logux servers metrics. It also offers priority support.

Learn more about Logux at logux.io

Author

In the same orbit

Explore more products

Contact us

We’d love to hear from you! We’re not really all that evil, and we love discussing potential projects, intriguing ideas, and new opportunities. Complete the form below or drop us a line at surrender@evilmartians.com.

Martians at a glance
16
years in business

A product development consultancy that works with startups and established businesses, while also creating open source-based products and services