MantisBase v0.3.3: Real-Time Database Updates with Server-Sent Events
February 4, 2026 — We're excited to announce the release of MantisBase v0.3.3, bringing real-time database capabilities to this lightweight, high-performance Backend-as-a-Service framework. This release introduces Server-Sent Events (SSE) support for both SQLite and PostgreSQL backends, along with critical bug fixes and improved system observability.
What's New in v0.3.3
Real-Time Database via SSE
The flagship feature of v0.3.3 is native real-time database synchronisation using Server-Sent Events. Unlike traditional polling approaches that waste resources checking for updates, SSE establishes a persistent HTTP connection that allows the server to push changes to clients as they happen.
Why SSE?
Server-Sent Events offer several advantages for real-time database applications:
- Efficient unidirectional streaming — Perfect for database change notifications where data flows primarily from server to client
- Built on standard HTTP — No special protocols or WebSocket infrastructure required
- Automatic reconnection — The browser's EventSource API handles connection recovery automatically
- Firewall-friendly — Works through corporate proxies and firewalls that might block WebSocket connections
- Low overhead — Simpler than WebSockets when you don't need bidirectional communication
Universal Backend Support
Real-time updates now work seamlessly with both SQLite and PostgreSQL databases. Whether you're running MantisBase on an embedded device with SQLite or scaling up with PostgreSQL, you get the same real-time capabilities without changing your code.
Enhanced System Observability
System logs have been moved to a dedicated database and are now accessible through the /api/v1/logs endpoint, providing administrators with powerful filtering and pagination capabilities for monitoring and debugging.
Getting Started with Real-Time
Opening an SSE Connection
Connect to the real-time endpoint and subscribe to entity changes:
// Subscribe to changes on the 'posts' entity
const eventSource = new EventSource(
'http://localhost:7070/api/v1/realtime?topics=posts'
);
// Listen for all events
eventSource.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log('Received event:', data);
};
// Handle connection events
eventSource.onopen = () => {
console.log('SSE connection established');
};
eventSource.onerror = (error) => {
console.error('SSE connection error:', error);
// Browser automatically reconnects
};
Subscribing to Multiple Entities
You can monitor multiple database entities on a single connection:
// Subscribe to posts, comments, and users
const eventSource = new EventSource(
'http://localhost:7070/api/v1/realtime?topics=posts,comments,users'
);
eventSource.onmessage = (event) => {
const data = JSON.parse(event.data);
// Events include the entity name they originated from
switch(data.entity) {
case 'posts':
updatePostsUI(data);
break;
case 'comments':
updateCommentsUI(data);
break;
case 'users':
updateUsersUI(data);
break;
}
};
Event Format
Real-time events follow a consistent JSON structure:
{
"type": "INSERT",
"entity": "posts",
"data": {
"id": "abc123",
"title": "New Post Title",
"content": "Post content here",
"created": "2026-02-03T14:30:00Z",
"updated": "2026-02-03T14:30:00Z"
},
"timestamp": "2026-02-03T14:30:00.123Z"
}
Event Types:
INSERT— New record createdUPDATE— Existing record modifiedDELETE— Record removed
Dynamic Topic Management
Update your subscriptions without reconnecting:
// Later, add more topics to the existing connection
async function subscribeToComments() {
await fetch('http://localhost:7070/api/v1/realtime', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${yourAuthToken}`
},
body: JSON.stringify({
client_id: clientId,
topics: ['posts', 'comments'] // Updated topic list
})
});
}
// Or clear all subscriptions
async function unsubscribeAll() {
await fetch('http://localhost:7070/api/v1/realtime', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${yourAuthToken}`
},
body: JSON.stringify({
client_id: clientId,
topics: [] // Empty array clears all topics
})
});
}
System Logs API
Access and monitor system logs with the new logs endpoint:
# Get recent logs (requires admin authentication)
curl -H "Authorization: Bearer <admin_token>" \
http://localhost:7070/api/v1/logs
# Filter by log level
curl -H "Authorization: Bearer <admin_token>" \
"http://localhost:7070/api/v1/logs?level=ERROR"
# Pagination
curl -H "Authorization: Bearer <admin_token>" \
"http://localhost:7070/api/v1/logs?limit=50&offset=100"
# Filter by time range
curl -H "Authorization: Bearer <admin_token>" \
"http://localhost:7070/api/v1/logs?from=2026-02-03T00:00:00Z&to=2026-02-03T23:59:59Z"
Migration Guide
If you're upgrading from v0.3.2, here's what you need to know:
Breaking Changes
There are no breaking changes in v0.3.3. The real-time API is a new addition that doesn't affect existing functionality. To enrol existing entities to be real-time "enabled", update the entities to trigger the real-time monitoring.
Security Considerations
Authentication for Real-Time
Real-time connections respect MantisBase's access control rules:
- For public topics (entities), no additional authentication is required.
- For non-public entities, the following rules are enforced:
- List Rule: Used to list records in an entity.
- Get Rule: Used to fetch a record by the record ID.
For non-public entities, provide the authorisation JWT token when creating the EventSource stream.
Installation & Upgrade
Download Pre-built Binaries
Download the latest release from GitHub Releases:
# Linux
wget https://github.com/allankoechke/mantisbase/releases/download/v0.3.3/mantisbase-linux-x64.zip
unzip mantisbase-linux-x64.zip
chmod +x mantisbase
./mantisbase serve
# Windows
# Download mantisbase-windows-x64.zip and extract
mantisbase.exe serve
Build from Source
git clone --recurse-submodules https://github.com/allankoechke/mantisbase.git
cd mantisbase
git checkout v0.3.3
cmake -B build
cmake --build build
./build/mantisbase serve
Bug Fixes
This release includes several important bug fixes:
- Fixed memory leak in SSE connection handling
- Improved database connection pooling for PostgreSQL
- Resolved race condition in concurrent entity updates
- Fixed authentication token refresh timing
- Corrected CORS headers for cross-origin real-time connections
Community & Support
Join our growing community:
- GitHub: github.com/allankoechke/mantisbase
- Documentation: allankoechke.github.io/mantisbase
- YouTube Tutorials: MantisBase Playlist
- Discussions: GitHub Discussions
- Support: Patreon
Acknowledgments
Thank you to everyone who contributed to this release through bug reports, feature requests, and code contributions. MantisBase is built for developers, by developers.
MantisBase—Lightning-fast BaaS in C++. One binary, full backend, anywhere.
For the full changelog, see v0.3.2...v0.3.3