build autonomous apps

Corto is an open source application framework for applications on the edge that make data-driven decisions at the speed of light.

connect your code with data

Model, publish, subscribe and query data for any datasource with a single, easy to use API! The framework separates application logic from infrastructure with its data-driven publish-subscribe paradigm, so your teams can focus on what they do best, while keeping code as reusable as possible.

// [1 / 4] Build a model for your data

container Car:/
  latitude: float64, tags = {coord/latitude}
  longitude: float64, tags = {coord/longitude}
  speed: float64, unit = mph

  leaf Engine:/
  temperature {
    type = float64
    unit = celsius
    tags = {temperature}
  }



            
// [2 / 4] Create objects and publish values

Car my_car = corto_create(
  root_o,
  "data/vehicles/my_car",
  Car_o);

corto_update_begin(my_car);

my_car->latitude = 37.7749;
my_car->longitude = 122.4194;
my_car->speed = 35;

corto_update_end(my_car);


            
// [3 / 4] Subscribe for realtime updates

void on_event(corto_subscriber_event *e) {
  printf("event received for %s, value = %s\n",
    e->record.id,
    corto_record_getText(&e->record));
}

corto_subscriber subscribe() {
  return
     corto_subscribe("*")
       .from("data/vehicles")
       .contentType("text/json")
       .callback(on_event);
}

            
// [4 / 4] Query for the last value of the data

corto_iter it;

corto_select("*")
  .from("data/vehicles")
  .contentType("text/json")
  .iter(&it);

while (corto_iter_hasNext(&it)) {
  corto_record *r = corto_iter_next(&it);
  printf("received '%s' => %s\n",
    r->id,
    corto_record_getText(r));
}
            

web-based monitoring and control

The corto web packages provide a powerful Vuejs-based foundation for defining pluggable corto-based web applications that can do anything from monitoring to control and visualization.

Learn how to write your own plugins by checking out our example plugin package:
driver-ui-example

Inspect data in realtime with the driver-ui-browser package.

Visualize data in VR 3D with the driver-ui-vr package.

the in-memory store

A hierarchical in-memory object store where data is repesented as regular C objects, so you can easily read and modify data using native language constructs. learn more

the virtual store

The virtual store behaves like single datastore, while actually forwarding queries, publications and subscriptions to connected databases, webservices and IoT protocols. learn more

install corto

curl https://corto.io/install-dev-src | sh
                

our users

#IoTSWC17 in Barcelona was a fantastic opportunity for IOTech to demonstrate EdgeXFoundry to the IoT community, but we were really up against the clock getting ready for the show. We were amazed at how quickly the Corto team integrated EdgeXFoundry into Corto’s Web Framework, providing us with a great GUI to showcase the power of EdgeX to excellent effect.

Andy Foster, Product Director at IOTech

We initially adopted corto because of its simple buildsystem and package management. We expanded our use of corto when we found its in-memory store to be fast enough for realtime EtherCAT-based control loops. Today we use it as the backbone for streaming large numbers of name-value pairs from a drilling rig to an InfluxDb historian.

Alex Hendren, CEO and Founder - OASYS

Our team found Corto to be an indispensable component in our backend. Anya's varying customer requirements need tailored metrics to measure marketing success. Corto ability to quickly pull together metrics from all kinds of datasources lets us onboard new customers quickly.

Luke Peng, CEO and Founder - Anya

Despite that its API is in C, I found Corto to be convenient backend framework. My code looks cleaner than most of the ORMs I’ve used, and the corto web console is a handy tool for quickly reviewing the data we've collected.

Johnny Lee, Full Stack Engineer - Alfie