Skip to main content

Learn to love the batches

Ever wondered what steps the orders actually take through Prime Penguin to your logistics provider? And why those steps look like they do? This is were we try to untangle the batches that governs almost all of the data synchronization Prime Penguin do.

Since the order flow is the most complicated thing we’re going to deal with, and also the most important, this is what we’ll use in this article. But please note that all data synchronization in Prime Penguin most likely will be batched, so it relates to products, purchase order, returns, suppliers etc. as well.

Overview

What Prime Penguin is, in its most basic form, synchronizing data (“state”) between multiple systems, your sales channels, your ERP, your logistics providers.

State is hell – Ken Arnold

In particular, distributed state between multiple systems is even more hell, if that is possible. We don’t have to cover the “two generals problem” or “distributed transactions” in this article, just note that keeping data synchronized across systems is surprisingly difficult.

Prime Penguin tries to be practical, we will read data in batches at scheduled intervals, and we will write data in batches at scheduled intervals. And in between the data will rest in Prime Penguin. This has the advantage of working at almost any system and being efficient for large volumes of data, but it will introduce timing issues and can be cumbersome to wrap your head around.

Oh yes, the interval between the scheduled batches may wary depending on sales channel. And if you have “development support” with us, we might have customized the interval for you as well. Just to complicate things further.

The order flow

1) Reading from sales channel

In general, Prime Penguin will read orders from the sales channel (or ERP) every 30 minutes. We will also use filters to try to determine which orders are eligible to be picked up and what we need to to with them.

For most sales channels, this means reading all orders but with a “if modified since” filter applied. This will give us not only orders that have been edited, but also new orders that have been created. If the sales channel does not support this filter, we will resort to try to read orders from a fixed period in the past, but this is less reliable and we try to avoid it.

So:

  1. Read all orders that have been created or modified since last time we synced
  2. For each new order, use filters to make sure it is in a state were we should pick it up

2) Store orders from sales channel

New orders will be created in Prime Penguin and existing orders will be updated – if possible. The order will be stored in a common “Prime Penguin Format” (see “Field Mapping” below). Here’s our first gotcha:

  • The orders will not be immediately forwarded to their logistics providers

3) Write order to logistic provider

New order will be created, and edits done if possible, with the logistics provider according to the current order routing. This will in general be done once per hour – but this may vary between logistics providers. The order will have another format in the logistic providers system (see “Field Mapping” below). Here’s the next couple of gotchas:

  • Not all logistic providers will immediately acknowledge the order, so it may take a while for the order to update in Prime Penguin to reflect that it is now PENDING at the warehouse.
  • Even if that order status is immediately updated by the logistics provider, it will not show up immediately in the sales channel.

4) Read and store order updates from logistics provider

At some point later, the logistics provider will pick, pack and ship the order which will update the order status in the logistic providers system.

Was this article helpful?

Related Articles