Programming ecto build database apps in elixir for scalability and performance darin wilson - Downlo

Page 1


Darin Wilson

Visit to download the full and correct content document: https://textbookfull.com/product/programming-ecto-build-database-apps-in-elixir-for-sc alability-and-performance-darin-wilson/

More products digital (pdf, epub, mobi) instant download maybe you interests ...

Pro SQL Server Relational Database Design and Implementation: Best Practices for Scalability and Performance Louis Davidson

https://textbookfull.com/product/pro-sql-server-relationaldatabase-design-and-implementation-best-practices-forscalability-and-performance-louis-davidson/

Programming Scala: Scalability = Functional Programming + Objects, Third Edition Dean Wampler

https://textbookfull.com/product/programming-scala-scalabilityfunctional-programming-objects-third-edition-dean-wampler/

Programming in ELIXIR language 4444th Edition Muhammad Allah Rakha

https://textbookfull.com/product/programming-in-elixirlanguage-4444th-edition-muhammad-allah-rakha/

Programming Crystal: Create High-Performance, Safe, Concurrent Apps 1st Edition Ivo Balbaert

https://textbookfull.com/product/programming-crystal-create-highperformance-safe-concurrent-apps-1st-edition-ivo-balbaert/

Programming Crystal: Create High-Performance, Safe, Concurrent Apps 1st Edition Ivo Balbaert

https://textbookfull.com/product/programming-crystal-create-highperformance-safe-concurrent-apps-1st-edition-ivo-balbaert-2/

Programming Elixir 1 6 1st Edition Dave Thomas

https://textbookfull.com/product/programming-elixir-1-6-1stedition-dave-thomas/

Introducing Elixir Getting Started in Functional Programming 2nd Edition Simon St. Laurent

https://textbookfull.com/product/introducing-elixir-gettingstarted-in-functional-programming-2nd-edition-simon-st-laurent/

Build Your Own Database From Scratch James Smith

https://textbookfull.com/product/build-your-own-database-fromscratch-james-smith/

Android Continuous Integration: Build-Deploy-Test Automation for Android Mobile Apps Pradeep Macharla

https://textbookfull.com/product/android-continuous-integrationbuild-deploy-test-automation-for-android-mobile-apps-pradeepmacharla/

Programming Ecto

Build Database Apps in Elixir for Scalability and Performance

Version: P1.0 (April 2019)

Copyright © 2019 The Pragmatic Programmers, LLC. This book is licensed to the individual who purchased it. We don't copy-protect it because that would limit your ability to use it for your own purposes. Please don't break this trust—you can use this across all of your devices but please do not share this copy with other members of your team, with friends, or via file sharing services. Thanks.

Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and The Pragmatic Programmers, LLC was aware of a trademark claim, the designations have been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf and the linking gdevice are trademarks of The Pragmatic Programmers, LLC.

Every precaution was taken in the preparation of this book. However, the publisher assumes no responsibility for errors or omissions, or for damages that may result from the use of information (including program listings) contained herein.

About the Pragmatic Bookshelf

The Pragmatic Bookshelf is an agile publishing company. We’re here because we want to improve the lives of developers. We do this by creating timely, practical titles, written by programmers for programmers.

Our Pragmatic courses, workshops, and other products can help you and your team create better software and have more fun. For more information, as well as the latest Pragmatic titles, please visit us at http://pragprog.com.

Our ebooks do not contain any Digital Restrictions Management, and have always been DRM-free. We pioneered the beta book concept, where you can purchase and read a book while it’s still being written, and provide feedback to the author to help make a better book for everyone. Free resources for all purchasers include source code downloads (if applicable), errata and discussion forums, all available on the book's home page at pragprog.com. We’re here to make your life easier.

New Book Announcements

Want to keep up on our latest titles and announcements, and occasional special offers? Just create an account on pragprog.com (an email address and a password is all it takes) and select the checkbox to receive newsletters. You can also follow us on twitter as @pragprog.

About Ebook Formats

If you buy directly from pragprog.com, you get ebooks in all available formats for one price. You can synch your ebooks amongst all your devices (including iPhone/iPad, Android, laptops, etc.) via Dropbox. You get free updates for the life of the edition. And, of course, you can always come back and re-download your books when needed. Ebooks bought from the Amazon Kindle store are subject to Amazon's polices. Limitations in Amazon's file format may cause ebooks to display differently on different devices. For more information, please see our FAQ at pragprog.com/frequently-asked-questions/ebooks. To learn more about this book and access the free resources, go to https://pragprog.com/book/wmecto, the book's homepage.

Thanks for your continued support,

The team that produced this book includes: Andy Hunt (Publisher), Janet Furlow (VP of Operations), Susan Conant (Managing Editor), Series editor: Bruce A. Tate, Jacquelyn Carter (Development Editor), Kim Cofer (Copy Editor), Potomac Indexing, LLC (Indexing), Gilson Graphics (Layout)

For customer support, please contact support@pragprog.com. For international rights, please contact rights@pragprog.com.

Table of Contents

Acknowledgments

Darin Wilson

Eric Meadows-Jönsson

Introduction

Who This Book Is For What’s In This Book

How To Read This Book

Online Resources

Part I. Ecto Fundamentals

1. Getting Started with Repo

Ecto and Elixir

Ecto Modules

How Ecto Is Organized

Setting Up the Sample App

The Repository Pattern

The Repo Module

Putting Our Repo to Work

Customizing Your Repo

Wrapping Up

2. Querying Your Database

Query Basics

Refining Our Results with where

Working with Joins

Composing Queries

Other Ways to Use Queries

Wrapping Up

3. Connecting Your Tables to Elixir

Structs with Schemas

Creating Schemas

Writing Queries with Schemas

Inserting and Deleting with Schemas

Adding Associations to Schemas

Working with Associations in Queries

Optimizing Associations with Embedded

Schemas

Deleting Records with Associations

Using Schemas to Seed a Database

Wrapping Up

4. Making Changes with Changesets

Introducing Changesets

Casting and Filtering

Validating Your Data

Capturing Errors

Using Changesets Without Schemas

Working with Associations

Wrapping Up

5. Making Multiple Changes with Transactions and Multi

Running Transactions with Functions

Running Transactions with Ecto.Multi

Wrapping Up

6. Making Changes to Your Database

Introducing Migrations

Your First Migration

Running Migrations

Rolling Back Migrations

Adding Indexes

Changing Data and Table Structure Together

Specifying Up and Down Operations

Changing Default Behaviors

Wrapping Up

Part

II. Ecto Applied

7. Adding Ecto to an Elixir Application Without Phoenix

Creating a New Project

Adding Ecto’s Dependencies

Creating Your Repo Module

Adding Ecto to the Supervision Tree

Using Multiple Ecto Repos

Starting Your App

Wrapping Up

8. Working with Changesets and Phoenix Forms

Generating a Form for a Single Schema

Displaying Changeset Errors

Creating a Form with an Association

Creating a Form with Multiple Associations

Wrapping Up

9. Testing with Sandboxes

Setting Up an Async Test

Changing the Ownership Mode

Safely Sharing Connections with Allowances

Wrapping Up

10. Creating and Using Custom Types

Building on Top of Ecto’s Types

Adding Custom Types Without the Built-In Types

Wrapping Up

11. Inserting and Updating with Upserts

Performing Upserts Without Schemas

Performing Upserts with Schemas

Wrapping Up

12. Optimizing Your Application Design

Separating the Pure from the Impure

Working with Contexts

Working with Umbrella Applications

Wrapping Up

13. Working with Embedded Schemas

Creating Embedded Schemas

Adding Embeds to Another Schema

Making Changes

Choosing Between Embedded Schemas and Associations

Wrapping Up

14. Creating Polymorphic Associations

Polymorphism in Other Frameworks

Approach #1: Multiple Foreign Keys

Approach #2: Using an Abstract Schema

Approach #3: Using many_to_many

Wrapping Up

15. Optimizing IEx for Ecto

Adding Imports and Aliases

Adding Helper Functions

Wrapping Up

16. Using Schemas Without Tables

Downsides to Locking Schemas to Tables

Breaking Up the Artist Schema

Creating Table-less Schemas

Saving the Table-less Structs

Wrapping Up

17. Tuning for Performance

Preparing to Optimize

Optimizing Queries

Executing Bulk Operations

Fetching Large Datasets with Streams

Wrapping Up

Bibliography

Copyright © 2019, The Pragmatic Bookshelf.

Early praise for Programming Ecto

Let’s face it, Ecto is not a small library. I think Darin and Eric did a fantastic job of breaking it all down into understandable pieces, giving a ton of examples along the way. You’ll learn how to use Ecto, and perhaps more importantly, how it was meant to be used. And if you think you know it very well already, I’m sure you’ll learn new things too!

→Wojtek Mach

Hex Core Team, Consultant at Plataformatec

It does a great job of not only explaining how to use Ecto, but also illuminating the SQL underneath and the design decisions that the Ecto team made when building it. For a new team, this would be a great book to teach with; likewise, for an experienced team, this makes for a good reference book.

→Ben Marx

Software Architect, Bleacher Report

This is a useful guide for beginners, but also a great resource for developers that have a medium level of knowledge of Ecto. I learned new tricks reading this book.

→ Ulisses De Almeida

Elixir Developer, author of LearnFunctionalProgrammingwith Elixir

For many Elixir projects, Ecto is your most important partner, so it’s important to learn to use it effectively. Darin and Eric have created a

wonderful roadmap to help beginners and experienced developers explore its powerful feature set. It’s full of clear examples that will help you quickly master Ecto—finish this book and you’ll be well on your way to creating powerful, scalable, reliable, and maintainable database applications.

→Bryan Stearns

Senior Software Engineer and Consultant

An eloquent discussion of the tools Ecto provides for database programming in Elixir: testing with sandboxes, changesets, embedded schemas, polymorphic associations, and much more. This book will be a reference for most engineers working in Elixir and Ecto.

Software Engineer, Enbala Power Networks

Acknowledgments

As the book’s authors, we’re the lucky ones who get to have our names on the front cover. But without the extra effort and support of many other folks, this book would have been a fraction of what it currently is, if it existed at all.

We’re deeply grateful to Bruce Tate for originally suggesting the idea to us, and for sharing the wisdom gathered from the many books he’s written over the years. Our editor Jackie Carter did an extraordinary job guiding a pair of nervous first-time authors with insight, editorial acumen, and a seemingly endless supply of patience. José Valim made himself available at several points in the process to clarify behavior we weren’t sure of, and help us stay on top of features in upcoming releases.

We’d also like thank the reviewers who gave us much-needed feedback on the book as it was evolving: Olufemi Adeojo, Ulisses De Almeida, Mike Foster, Elias Karakoulakis, Justin Lane, Wojtek Mach, Ben Marx, Sean Miller, Matt Milton, Kim Shrier, and Stefan Turalski. And big thanks to the many beta readers who sent in errata to the Pragmatic Bookshelf website—this book would have a lot more errors if not for the efforts of these folks.

Darin Wilson

I’d like to send thanks and shout-outs to my teammates at Infinite Red, especially the leadership team (Jamon Holmgren, Ken Miller, and Todd Werth) for steering us toward Elixir in the first place. And extra gratitude is to due to my fellow Elixirists: Daniel Berkompas, Zach Berkompas, Ryan Linton, Yulian Glukhenko, Morgan Laco, and Silas Matson. Their pull requests and code reviews have taught me more about Elixir than they’ll ever know.

Finally, I’d like to thank the loves of my life, my wife Jessica and daughter Ella. I’d need a book ten times this size to tell you how grateful I feel to have you both in my life. Thank you for all the love, inspiration, support, and laughter.

Eric Meadows-Jönsson

I’d like to thank José Valim, first of course for creating Elixir but primarily for mentoring me through the initial development of Ecto. When Ecto was created I was still new to Elixir as almost everyone was back then, before the release of Elixir 1.0. José helped guide me through the process of creating Ecto and taught me about Elixir and OSS development. José eventually invited me to be a core part of the development of Elixir itself which I am very grateful for.

I would also like to thank Bruce Tate, the series editor of this book. Bruce hired me right out of school when Elixir was still in its infancy and made a bet on Elixir and on me, which allowed me to continue to work with Elixir.

Copyright © 2019, The Pragmatic Bookshelf.

Introduction

For as long as there have been databases, there have been programmers writing libraries to access those databases in a more friendly way.

Which is a nice way of saying that they’ve been trying to avoid writing SQL.

SQL is powerful—there’s a reason it’s stuck around as long as it has —but generating it manually is tedious and error-prone. Developers have addressed this problem by creating libraries that wrap up the low-level vagaries of talking to a database into an API that’s more harmonious with the language being used. In Java, we had Hibernate. In Python, SQLAlchemy. In Ruby, ActiveRecord and DataMapper. And now in Elixir, we have Ecto.

Ecto is a large library, and even with its excellent documentation, it can be hard to know where to start. This book will help you with that. Just as it’s helpful to have a tour guide when visiting a new city, this book will help you find your way through Ecto. We’ll take you through what we believe is the optimal path for learning the major components, and along the way you’ll get expert advice and insight from one of Ecto’s creators. At the end, you’ll have a solid working knowledge of Ecto and you’ll be ready to start integrating it into your own projects.

Who This Book Is For

This book is for developers who want to access relational databases from their Elixir applications. This includes applications that use the Phoenix web development framework, but Ecto can work in any Elixir app, whether it uses Phoenix or not.

We’re going to assume you have some basic knowledge of Elixir. You should be comfortable with creating and running Elixir applications, as well as the basic components of the language: modules, functions, pattern matching, working with the pipe operator, and so on. If you’re brand new to the language, you might want to get some experience under your belt before diving into Ecto.

ProgrammingElixir≥1.6[Tho18] is a great place to start.

We’re also going to assume that you’re comfortable working with relational databases and SQL. You don’t need to be an expert, but you should be familiar with tables, columns, indexes, and how to write queries. Many online tutorials are available that can teach you the basics.

What’s In This Book

The book is divided into two parts. The first part will walk you through the main modules that form the core of Ecto’s functionality. The second part will build on that knowledge and apply it to realworld use cases that often come up with database programming.

Throughout both parts, you’ll be practicing what you learn by working on a sample app that’s included with the book. We’ll talk more about that in Chapter 1, GettingStartedwithRepo.

Part I - Ecto Fundamentals

Part I is a tour of Ecto’s API. We’ll start at the ground level with the most basic features that Ecto provides, then work our way up, module-by-module, through all of the core features of the library. You’ll be writing code every step of the way to help get Ecto into your fingers. At the end of Part I, you’ll have a solid understanding of the API, and experience using it in working code.

Part II - Ecto Applied

Part II will take the knowledge you picked up in Part I and put it to work. Each chapter covers a specific task or use case that you’re likely to run into as you start integrating Ecto into your projects. You’ll learn things like integrating Ecto with Phoenix, running tests asynchronously, working with custom types, streaming large datasets, and the like.

How To Read This Book

You should start by reading Part I in order, from start to finish. Part I covers the most important features of Ecto and each chapter builds on the one before. Even if you’ve done some work with Ecto before, it’s best not to skip around too much, as you might miss out on some key features you weren’t aware of.

Part II is much less strict. You can read the chapters in any order, and you should feel free to focus your attention on the topics that are most interesting to you, and leave the rest for another time.

Online Resources

You can download all the example source code for the book from the Pragmatic Bookshelf website for this book.[1] You can also provide feedback by submitting errata entries.

If you’re reading the book in PDF form, you can click the link above a code listing to view or download the specific examples.

Ready to dive in? Open a terminal window and your favorite editor, and let’s get started.

Footnotes

https://pragprog.com/book/wmecto/programming-ecto

Copyright © 2019, The Pragmatic Bookshelf.

Part 1

Ecto Fundamentals

Webeginbygraduallylearningthecorefeaturesof Ecto’sAPI.Eachchapterinthispartcoversadifferent Ectomodule,startingwiththebasics,thenworking towardmorecomplexusecases.It’sbesttoreadthis partinorderfromstarttofinish.You’llthenhavethe foundationyouneedtolookatthespecificusecases coveredinPartII.

Chapter 1

Getting Started with Repo

Welcome to Ecto!

If you’re one of the majority of users who needs to use Elixir with a database, you’re in luck: Ecto is the most prominent persistence framework for Elixir. Actively developed since its introduction in 2014, Ecto is mature, stable, and well-supported by an enthusiastic community of developers that includes members of the Elixir core team.

Ecto is the default database library that ships with the Phoenix web development framework, so for many developers, working with Phoenix is their first introduction to Ecto. Ecto works well with Phoenix, but it’s a completely separate project and you can use it in any Elixir app. In fact, aside from a couple of chapters in Part II, we won’t be discussing Phoenix at all in this book. We’ll stay focused on Ecto itself.

In this chapter, we’ll start with the basics. We’ll get a brief overview of Ecto as a whole, then set up a small sample app so that you can try out the code you’re learning as we go. We’ll then take a close look at the Repo module, which is the heart of Ecto and the springboard for the rest of this part of the book.

Ecto and Elixir

Ecto is not the only database library for Elixir, but it’s one of the most mature and best-supported. Plataformatec, the company that launched Elixir, has been involved in Ecto’s development since the beginning, and José Valim is still a frequent committer.

But beyond Ecto’s pedigree, three main characteristics make it stand out.

First, Ecto is approachable.As database libraries go, Ecto is a newcomer, but it has a sense of history and builds on work that has come before. The query syntax was inspired by LINQ in the .NET framework. The migrations and relation syntax feel a lot like ActiveRecord. Depending on the libraries you’ve used, you’re likely to find parts of Ecto that will make you feel at home. The Ecto developers have tried to bring the best of what has come before, while avoiding some of the known pitfalls. Hopefully, your progress through learning Ecto will be met with responses of “oh, this feels very familiar,” and “wow, that solves a problem that’s been bugging me for years!”

Second, Ecto is explicit.Like the Elixir language itself, Ecto avoids the “magic” that characterizes many other database libraries. Magic is a seductive characteristic. It appears to make everything easy and efficient, but only at first. Over time, those hundreds of decisions made on your behalf start to catch up with you, and you lose track of what’s actually going on. When you work with Ecto, you have clarity: you know exactly when your app is talking to the database, and what it’s saying. This is welcome news if you’ve ever diagnosed a sluggish application and discovered that your database library was making dozens or hundreds of requests that you weren’t even aware of.

Finally, Ecto is flexible.Ecto doesn’t lock you into one particular way of working with it. In fact, it’s more accurate to think of Ecto as a suite of tools for database access, rather than a large-scale framework you need to adapt to. You can use some parts of Ecto and not others. You can use them in various combinations. And, perhaps most surprising, you can use parts of Ecto without a relational database. We’ll see some examples of this later in the book.

Ecto Modules

Ecto’s core functionality is contained in six main modules, and in Part I, we’ll look at each of them in detail.

Later in this chapter, we’ll start with Repo. Repo is the heart of Ecto and acts as a kind of proxy for your database. All communication to and from the database goes through Repo.

The Query module contains Ecto’s powerful but elegant API for writing queries. Here you’ll find everything you need to pull the data you want out of your database, and make precise changes.

A schema is a kind of map, from database tables to your code. The Schema module contains tools to help you create these maps with ease. The best part is Ecto schemas are very flexible—you’re not locked into a simple one-to-one relationship between your tables and your structs. As you’ll see, this allows for whole new levels of expressiveness when creating your data structures.

Many database layers have one or two kinds of change. Ecto understands that one size does not fit all, so it provides the changeset:a data structure that captures all aspects of making a change to your data. The Changeset module provides functions for creating and manipulating changesets, allowing you to structure your changes in a way that is safe, flexible, and easy to test.

You often need to coordinate several database changes simultaneously, where they must all succeed or fail together. The transaction function works great for simple cases, but the Multi module can handle even very complex cases while still keeping your code clean and testable.

Change happens. As your app grows and evolves, so too must the underlying database. Changing the structure of a database can be tricky, particularly when multiple developers are involved, but Migration helps you coordinate these changes so that everyone stays in sync.

We’ll get started on our tour with the Repo module, but before we do that, we’ll take a moment to set up a small sample application that uses Ecto. We’ll use this app throughout the book as a playground to try out Ecto functions as we learn them.

How Ecto Is Organized

Under the hood, Ecto is actually two separate packages: ecto and ecto_sql. The ecto package contains some of the core data manipulation features that are useful even if you’re not using a relational database. These include the Repo, Query, Schema, and Changeset modules (among others).

ecto_sql, on the other hand, contains modules specifically needed to communicate with relational databases. These include the various database-specific adapters, migrations, and so forth.

The ecto_sql package includes ecto as a dependency, so if you’re using Ecto to work with a relational database, you just need to include ecto_sql in your dependencies, and you’ll get ecto in the process. But if you’re not working with a relational database and want to take advantage of the some of the data manipulation features that Ecto offers (validations, for example) you can include ecto rather than ecto_sql and your dependency tree will be a little lighter.

Setting Up the Sample App

To get a real feel for Ecto, you’ll want to write and execute some code for yourself, and not just read about it. In Chapter 7, Adding EctotoanElixirApplicationWithoutPhoenixwe walk through all the steps of how to add Ecto to an existing application, but for now, we want to make this as easy as possible.

We’ve created a small Elixir application with Ecto already installed and set up. This app is a very simple music database that you might use to keep track of your music collection. It’s a standard Elixir mix project that comes with Ecto and sample data already baked in. All you need to do is download it, configure it to work with your local database, and you’re ready to go. In this section, we’ll walk you through the process.

To start, you’ll need Elixir 1.5 or greater, and a database that can support Ecto 3 (we recommend Postgres, but you can also use MySQL). If you don’t have Elixir installed, you can get it here.[2] Postgres can be downloaded here.[3]

Another random document with no related content on Scribd:

young Cæsar Valentinian, between East and West, a new, if unsubstantial, cordiality appeared. Italy at least was restored to prosperity, while in Aetius she possessed a general as great as the great Stilicho. But if Italy was safe the provinces were in peril and she herself saw Africa betrayed by Boniface and ravaged by and lost to the Vandals under Genseric. Nor was the domestic state of her household and court such as to inspire her with confidence in the future. If her son Valentinian was a foolish and sensual boy, her daughter Honoria was discovered in a low intrigue with a chamberlain of the palace, and when in exile at Constantinople sent, perhaps longing for the romantic fate of her mother, her ring to the new and youthful King of the Huns, soon to be famous as Attila, inviting him to carry her off as Adolphus, the Goth, had carried off Placidia.

Such was the condition of things in the royal household of the West. In Constantinople things were not more promising. Theodosius, the young Emperor, called the Calligrapher, was a dilettante of the fine arts, not a statesman. Those who surrounded him were mediocrities intent rather on theological controversies than on the safety of the State, or sunk in a cynical corruption in which everything noble was lost. No one East or West seemed able to grasp or to realise that there was any danger. Had the Imperial Governments failed altogether to understand the fundamental cause of the Gothic advance, the Vandal attack, indeed of all their embarrassments? Had they failed to remember what was there beyond the Rhine and the Danube? Had they forgotten the Huns?

FOOTNOTES:

[2] See my “Ravenna” (Dent, 1913), pp. 1-10.

II

THE HUNS AND ATTILA

The people called the Huns, “scarcely mentioned in other records,” are fully described by that Ammianus Marcellinus[3] whom I have already quoted. He lived at the end of the fourth century, was a Roman historian born of Greek parents at Antioch, and after fighting in Gaul, in Germany and the East, settled in Rome and devoted himself to history. He describes the Huns as “living beyond the Sea of Azov on the borders of the Frozen Ocean.” And adds that they were a people “savage beyond all parallel.” He then gives us the following careful description of them:—

“In their earliest infancy deep incisions are made in the cheeks of their boys[4] so that when the time comes for the beard to grow the sprouting hairs may be kept back by the furrowed scars, and therefore they grow to old age as beardless as eunuchs. At the same time all have strong and well-built limbs and strong necks; they are indeed of great size, but so short-legged that you might fancy them to be two-legged beasts, or the figures which are hewn out in a rude manner with an axe on the posts at the end of bridges.[5]

“They do, however, just bear the likeness of men (horribly ugly though they be), but they are so little advanced in civilisation that they make no use of fire, nor of seasoned food, but live on roots which they find in the fields, or on the half raw flesh of any animal which they merely warm a little by placing it between their own thighs and the backs of their horses.

“They do not live under roofed houses but look upon them as tombs and will only enter them of necessity. Nor is there to be found among them so much as a cabin thatched with reed; but they wander about over the mountains and through the woods training

themselves to bear from their infancy the extremes of frost and hunger and thirst.

“They wear linen clothes or else the skins of field mice sewn together, and this both at home and abroad. When once such a tunic is put on, it is never changed till from long decay it falls to pieces. Their heads are covered with round caps and their hairy legs with goat skins and their shoes which are ignorant of any last are so clumsy as to hinder them in walking.

“For this cause they are not well suited for infantry; but, on the other hand, they are almost one with their horses, which are poorly shaped but hardy; often they sit them like women. In truth they can remain on horseback night and day; on horseback they buy and sell, they eat and drink, and bowed on the narrow neck of their steeds they even sleep and dream. On horseback too they discuss and deliberate. They are not, however, under the authority of a king, but are content with the loose government of their chiefs.

“When attacked they sometimes engage in regular battle formed in a solid body and uttering all kinds of terrific yells. More often, however, they fight irregularly, suddenly dispersing, then reuniting and after inflicting huge loss upon their enemy will scatter over the plains hither and thither, avoiding a fortified place or an entrenchment. It must be confessed that they are very formidable warriors....

“None of them ploughs or even touches a plough-handle; for they have no settled abode, but are alike homeless and lawless, continually wandering with their waggons which indeed are their homes. They seem to be ever in flight.... Nor if he is asked can any one tell you where he was born; for he was conceived in one place, born in another far away, and bred in another still more remote.

“They are treacherous and inconstant and like brute beasts are utterly ignorant of the distinction between right and wrong. They only express themselves with difficulty and ambiguously, have no respect for any religion or superstition, are immoderately covetous of gold, and are so fickle and cantankerous that many times in a day they will

quarrel with their comrades without cause and be reconciled without satisfaction.”[6]

Such were the people who according to Ammianus were “the original cause of all the destruction and manifold calamities” which descended upon the Roman Empire, in the fifth century of our era.

Fifty-six years before they began directly to menace civilisation and the Roman Empire, they had, as we have seen, in 376 .., driven the Goths before them to the first of those famous assaults upon the frontiers of the Roman world. They themselves, utter barbarians as they were, attempted then no direct attack upon our civilisation, though in 396 they crossed the Caucasus, raided Armenia and as Claudius notes, “laid waste the pleasant fields of Syria.” In 409, however, Alaric being then intent on Italy, they crossed the Danube and pushed on into Bulgaria, Uldis, their chief, boasting in true Barbarian fashion, “All that the sun shines upon I can conquer if I will.” It was the first claim of the Barbarian, vocal and explicit, to “a place in the sun”—someone else’s place. Uldis’ boast, however, had been but the prelude to his flight and fall. Amid the welter of Barbarians less barbarous than he, Visigoths, Vandals, Suevi, Alani, the Hun in fact was unable to do much more than drive them on. When they had passed into the Empire, into Gaul and Spain and Africa, he, worse than them all, was free at last to threaten Christendom and its capitals, Constantinople and Rome.

It was not till the two brothers Attila and Bleda ascended the Hunnish throne, if throne it can be called, in the year 423, that the Huns really became immediately and directly dangerous to civilisation.

That civilisation already half bankrupt and in transition had, as we have seen, been bewildered and wounded by the actual incursion of Barbarian armies south of the Danube and the Rhine, nay within the heart of the Empire, within reach of Constantinople, within the very walls of Rome. It was now to be assaulted by a savage horde, wholly heathen, intent on murder and rape, loot and destruction.

The contrast between the two attacks, the attack of Alaric and that of Attila, is very striking. To admire Alaric, even to defend him, is

obviously not impossible, since so many historians have been found ready to do both. No voice unless it be Kaiser Wilhelm’s has ever been raised in behalf of Attila. Here was the Empire, Christendom; he fell upon it like a wild beast. At least the Goths were Christian— though Arian—the Huns were pagan heathen. At least Alaric had revered the Roman name and sought to assume it; Attila despised and hated it and would have destroyed it utterly. But if there is this moral contrast between the Gothic and the Hunnish attacks upon the Empire, militarily they are alike in this above all that both were directed first upon the East and were only turned upon the West after a sort of failure. Happily for us the attacks of Attila, while infinitely more damaging, were not nearly so dangerous as those of Alaric. The Empire was assaulted by an assassin; it was delivered.

The Roman system with regard to the Barbarians had long been established when Theodosius II ascended the Eastern throne. It consisted not only in employing Barbarians as auxiliaries—thus Uldis and his Huns had fought under Stilicho against Radagaisus at the battle of Fiesole; but in setting the different Barbarian tribes and races one against another. The Huns especially had been favoured by the Empire in this way, Stilicho knew them well and Aetius who was at last to defeat them upon the Catalaunian plains owed them perhaps his life in the crisis that followed the death of his rival Boniface in 433. But that policy, always dangerous, and the more so if it were inevitable, was already bankrupt. The dispersal through the provinces of the Goths, the Vandals, the Alani, Suevi and other tribes left the Empire face to face upon its northern frontier with the real force which had driven them on. In 432 we find Roua, King of the Huns, in receipt of an annual subsidy, scarcely to be distinguished from a tribute, of 350 pounds’ weight of gold. He it was who perhaps first broke the old Roman policy. When the Empire, according to its custom, made alliances with certain Barbarian tribes his neighbours, he claimed them as his subjects and immediately swore that he would denounce all his treaties with the Empire unless the Emperor broke off these alliances. Moreover, he demanded that all those of his subjects then within the Empire should be restored to him; for many had entered the Roman service to escape his harsh rule. These demands could not be ignored or refused. In 433 Theodosius

was on the point of sending an embassy to treat with Roua, when he heard that he was dead and that his two nephews, still young men, Attila and Bleda, had succeeded him. It was they who received the Imperial ambassadors.

The conference met on the right bank of the Danube within the Empire, that is near the Roman town of Margus or Margum, a city of Moesia, where the Danube and the Morava meet. The place was known as the Margum planum on account of the character of the country, and was famous as the spot where Diocletian had defeated Carinus.[7]

The Byzantine historian Priscus has left us an account of this strange meeting. The Huns it seems came on horseback and as they refused to dismount the Roman ambassadors also remained on their horses. It was thus they heard the arrogant demands of the Hunnish kings: the denunciation by Theodosius of his alliance with the Barbarians of the Danube, the expulsion of all the Huns serving in the Imperial armies or settled within the Empire, an undertaking not to assist any Barbarian people at war with the Huns, and the payment by the Empire as tribute, tributi nomine, of seven hundred pounds’ weight of gold instead of the three hundred and fifty given hitherto. To all these demands the ambassadors were forced to agree as Attila insisted either upon their acceptance or upon war, and Theodosius preferred any humiliation to war. The famous conference of Margus was thus a complete victory for the Huns, a victory Attila never forgot.

That Theodosius was ready to accept any terms which Attila might insist upon is proved by the fact that he immediately delivered up to him his two guests, young princes of the Huns, and made no protest when Attila crucified them before the eyes of his ambassadors.

This act seems to symbolise at the outset the character of Attila and his reign. He was then, we may suppose, between thirty and forty years old, and although the younger always the master of his brother Bleda, whom he was soon to murder. Of the place of his birth we know nothing,[8] but he grew up on the Danube and there learned the use of arms, perhaps in the company of the young Aetius, who

had been a Roman hostage of Roua and who was one day to conquer Attila. If we look for a portrait of him we shall unhappily not find it in any contemporary writer; but Jornandes, probably repeating a lost passage of some earlier writer, perhaps Priscus himself, tells us that he was short, with a mighty chest, a large head, eyes little and deep-set, a scant beard, flat nose and dark complexion. He thrust his head forward as he went and darted his glances all about, going proudly withal, like one destined to terrify the nations and shake the earth. Hasty and quarrelsome, his words, like his acts, were sudden and brutal, but though in war he only destroyed, and left the dead unburied in their thousands for a warning; to those who submitted to him he was merciful, or at least he spared them. He dressed simply and cleanly, ate as simply as he dressed, his food being served on wooden dishes; indeed his personal temperance contrasted with the barbaric extravagance he had about him. Nevertheless he was a Barbarian with the instincts of a savage. Constantly drunk he devoured women with a ferocious passion, every day having its victim, and his bastards formed indeed a people. He knew no religion but surrounded himself with sorcerers, for he was intensely superstitious.[9] As a general he was seldom in the field, he commanded rather than led and ever preferred diplomacy to battle.[10] His greatest weapon was prevarication. He would debate a matter for years and the continual embassies of Theodosius amused without exhausting him and his patience. He played with his victims as a cat does with a mouse and would always rather buy a victory than win it. He found his threat more potent than his deed, and in fact played with the Empire which had so much to lose, very much as Bismarck played with Europe. Like Bismarck too his business was the creation of an Empire. His idea, an idea that perhaps even Roua had not failed to understand, was the creation of an Empire of the North, a Hunnish Empire, in counterpoise against the Roman Empire of the South, to the south that is of the Rhine and the Danube. For this cause he wished to unite the various Barbarian tribes and nations under his sceptre, as Bismarck wished to unite the tribes of the Germans under the Prussian sword. He was to be the Emperor of the North as the Roman Emperors were Emperors of the South. Had he lived in our day he would have understood that

famous telegram of the Kaiser to the Tsar of Russia—“the Admiral of the Atlantic....”

It was the business of Theodosius to prevent the realisation of this scheme, nor did he hesitate to break the treaty of Margus to achieve this. His emissaries attempted to attach to the Empire the Acatziri, a Hunnish tribe that had replaced the Alani on the Don. Their chief, however, fearing for his independence, or stupidly handled, sent word to Attila of the Roman plot. The Hun came down at the head of a great army, and though he spared the Acatziri, for their chief was both wily and a flatterer, he brought all the Barbarians of that part within his suzerainty and, returning, soon found himself master of an Empire which stretched from the North Sea to the Caucasus, and from the Baltic to the Danube and the Rhine, an Empire certainly in extent comparable with that of Rome.

It was in achieving this truly mighty purpose that Attila exhibits two of his chief characteristics, his superstition and his cruelty.

It seems that the ancient Scythians on the plain to the east of the Carpathians had for idol and perhaps for God a naked sword, its hilt buried in the earth, its blade pointed skyward. To this relic the Romans had given the name of the sword of Mars. In the course of ages the thing had been utterly forgotten, till a Hunnish peasant seeing his mule go lame, and finding it wounded in the foot, on seeking for the cause, guided by the blood, found this sword amid the undergrowth and brought it to Attila who recovered it joyfully as a gift from heaven and a sign of his destined sovereignty over all the peoples of the earth. So at least Jornandes relates.[11]

The other episode exhibits his cruelty. In founding his empire Attila had certainly made many enemies and aroused the jealousy of those of his own house. At any rate he could not remember without impatience that he shared his royalty with Bleda. To one of his subtlety such impatience was never without a remedy Bleda was accused of treason, perhaps of plotting with Theodosius, and Attila slew his brother or had him assassinated; and alone turned to enjoy his Barbary and to face Rome.

FOOTNOTES:

[3] In the thirty-first book of his History of Rome: see Appendix I.

[4] The Prussian student is even to-day famous for the scars on his face inflicted in the duels at the Universities.

[5] Cf the physique of the ordinary Prussian at its most characteristic in Von Hindenberg, who really seems to have been hewn out of wood

[6] It was a modern and famous German who not long since declared that the Prussians were such quarrelsome and disagreeable brutes that it was only their propensity to drink beer and that continually that mollified them sufficiently to be regarded as human beings.

[7] It is curious to remember that this first encounter of Attila with the Imperial power took place in what is now Servia only fifty miles further down the Danube than Belgrade.

[8] It has been suggested that his name Attila is that of the Volga in the fifth century and that therefore he was born upon its banks; but as well might one say that Roua was born there because one of the ancient names of that river was Rha

[9] For all this see Appendix: Jornandes, R. Get., 35 and especially for his dress and food, Priscus, infra.

[10] Cf Jorn , R Get , 36: “Homo subtilis antequam arma gereret , arte pugnabat ”

[11] See Appendix, Jornandes, R. Get., 35.

III

ATTILA AND THE EASTERN EMPIRE

When Attila had achieved the hegemony of the North he turned his attention upon the Empire; and it is curious for us at this moment to note the coincidence that this first attack upon civilisation was delivered at the very spot upon the Danube where the Germanic powers in August, 1914, began their offensive. Attila directed his armies upon the frontiers of modern Servia at the point where the Save joins the Danube, where the city of Singidunum rose then and where to-day Belgrade stands.

The pretext for this assault was almost as artificial and manufactured as that which Austria put forward for her attack upon Servia. Attila asserted that the Bishop of that same frontier town of Margus, on the Morava, where he had made treaty with the Empire, had crossed the Danube, and having secretly obtained access to the sepulchre of the Hunnish kings had stolen away its treasures. The Bishop, of course, eagerly denied this strange accusation, and it seemed indeed so unlikely that he was guilty that Theodosius was exceedingly reluctant to sacrifice him. The people of Moesia clamoured for a decision; if the Bishop were guilty then he must be delivered to Attila, but if not Theodosius must protect both him and them. For Attila had waited for nothing; he had crossed the Danube before making his accusation and had occupied Viminacium, one of the greater towns upon the frontier.

Meanwhile the Bishop, seeing the hesitation of Theodosius and expecting to be sacrificed, made his way to the camp of the Huns and promised in return for his life to deliver Margus to them, and this he did upon the following night. Then, dividing his forces into two armies, Attila began his real attack upon the Empire.

The first of these armies was directed upon Singidunum, the modern Belgrade, which was taken and ruined, and when that was achieved it proceeded up the Save to Sirmium, the ancient capital of Pannonia, which soon fell into its hands. The second crossed the Danube further eastward and besieged Ratiaria, a considerable town, the head-quarters of a Roman Legion and the station of the fleet of the Danube.

THE ATTACK OF ATTILA UPON THE EAST.

Having thus, with this second army, secured the flank, Attila marched his first army from Singidunum up the Morava to Naissus (Nisch), precisely as the Austrians tried to do but yesterday. They failed, but he succeeded and Naissus fell. Thence he passed on to Sardica where he was met by his second army which had taken Ratiaria. Sardica was pillaged and burnt.

Attila thus possessed himself in the year 441 of the gateways of the Balkans, almost without a protest from Theodosius. Five years later, in 446, he was ready to advance again. In that year and the next he destroyed two Roman armies, took and pillaged some seventy towns, and pushed south as far as Thermopylae, and

eastward even to Gallipoli; only the walls of Constantinople saved the capital. Theodosius was forced to buy a disgraceful peace at the price of an immediate payment of 6000 pounds’ weight of gold, an annual tribute, no longer even disguised, of 2000 pounds, and an undertaking that the Empire would never employ or give refuge to any of those whom Attila claimed as his subjects.

It was easier to agree to such terms than to fulfil them. The provinces were ruined, the whole fiscal system of the East in confusion, and even what wealth remained was, as Priscus tells us, “spent not in national purposes, but on absurd shows and gaudy pageants, and all the pleasures and excesses of a licentious society such as would not have been permitted in any properly governed State, even in the midst of the greatest prosperity.” Attila, who marked the decay and the embarrassment of the Imperial Government, forewent nothing of his advantage. He became more and more rapacious. When he did not obtain all he desired he sent an embassy to Constantinople to intimidate the government, and this became a regular means of blackmail with him, a means more humiliating than war and not less successful.

The first of these embassies arrived in Constantinople immediately after the terms of peace had been agreed upon. It made further demands, and was treated with the most extravagant hospitality. Three times within a single year other embassies arrived; they were a means of blackmail and were assured of an ever-increasing success.

The most famous and the most important of these embassies was that which arrived in Constantinople in 449. The ambassadors then employed by Attila are worthy of notice, for in them we see not only the condition of things at that time, but also the naive cunning of the Hun. The two chief legates whom Attila dispatched to Constantinople upon this occasion were Edecon and Orestes. Edecon was a Scythian or Hun by birth, a heathen of course, and a Barbarian, the commander of the guard of Attila, and the father of Odoacer, later to be so famous. Orestes, on the other hand, who was one of Attila’s chief ministers, was a Roman provincial of Pannonia, born at Petavium (probably Pettau on the Drave), who had made a fortunate

marriage as a young man when he allied himself with Romulus, a considerable Roman personage of that province. He had, however, deserted the Imperial service, certainly open to him, for that of the Barbarians, and had made his fortune. Nor was his part in history to be played out in the service of Attila, for his son Romulus was to be the last of the Western Emperors, contemptuously known to history as Romulus Augustulus.

Orestes was then an adventurer pure and simple, but in sending him with the Barbarian Edecon, we see the system of Attila in his blackmail of the Empire. The employment of a Roman provincial was a check upon the Barbarian envoy. A bitter jealousy subsisted between them, each spied on the other, and thus Attila was well served. The fact that the Hun was able to command the services of such as Orestes is a sufficient comment upon the condition of the frontier provinces.

It was these two jealous envoys that, in the early months of 449, appeared in Constantinople bringing, of course, new demands. Their mission, indeed, was the most insolent that Attila had so far dared to send. It demanded three main things; first, that all the country to the south of the Danube as far as Naissus should be regarded as a part of the Hunnish Empire; second, that in future Theodosius should send to the Hunnish court only the most illustrious ambassadors, but if this were done Attila for his part would consent to meet them on the frontier at Sardica; third, that the refugees should be delivered up. This last demand was a repetition of many that had gone before it. As before Attila threatened if his requests were not granted he would make war.

The ambassadors Edecon and Orestes came to Constantinople where a “Roman” named Vigilas acted as their guide and interpreter, an indiscreet and vulgar fellow of whom we shall hear more presently. Received in audience by Theodosius in the famous palace on the Bosphorus, the ambassadors with the interpreter later visited the chief minister, the eunuch Chrysaphius. On their way they passed through the noble halls of Constantine decorated with gold and built of marble, the whole a vast palace, perhaps as great as the Vatican. Edecon, the Hun, was stupefied by so much splendour, he

could not forbear to express his amazement; Vigilas was not slow to mark this naive astonishment nor to describe it to Chrysaphius, who presently proposed to put it to good use. Taking Edecon apart from Orestes as he talked he suggested to him that he also might enjoy such splendour if he would leave the Huns and enter the service of the Emperor. After all it was not more than Orestes had done. But Edecon answered that it would be despicable to leave one’s master without his consent. Chrysaphius then asked what position he held at the court of Attila, and if he was so much in the confidence of his master as to have access freely to him. To which Edecon answered that he approached him when he would, that he was indeed the chief of his captains and kept watch over his person by night. And when Chrysaphius heard this he was content and told Edecon that if he were capable of discretion he would show him a way to grow rich without trouble, but that he must speak with him more at leisure, which he would do presently if he would come and sup with him that evening alone without Orestes or any following. Already in the mind of the eunuch a plan was forming by which he hoped to rid the Empire once for all of the formidable Hun.

Edecon accepted the invitation. Awaiting him he found Vigilas with Chrysaphius, and after supper heard apparently without astonishment the following amazing proposal. After swearing him to secrecy, Chrysaphius explained that he proposed to him the assassination of Attila. “If you but succeed in this and gain our frontiers,” said he, “there will be no limit to our gratitude, you shall be loaded with honours and riches.”

The Hun was ready in appearance at least to agree, but he insisted that he would need money for bribery, not much, but at least fifty pounds’ weight of gold. This he explained he could not carry back with him as Attila was wont upon the return of his ambassadors to exact a most strict account of the presents they had received, and so great a weight of gold could not escape the notice of his own companion and servants. He suggested then that Vigilas should accompany him home under the pretext of returning the fugitives and that at the right moment he should find the money necessary for the project. Needless to say, Chrysaphius readily agreed to all that

Edecon proposed. He does not seem either to have been ashamed to make so Hunnish a proposal or to have suspected for a moment that Edecon was deceiving him. He laid all before Theodosius, won his consent and the approval of Martial his minister.

Together they decided to send an embassy to Attila, to which the better to mask their intentions Vigilas should be attached as interpreter. This embassy they proposed to make as imposing as possible, and to this end they appointed as its chief a man of a high, but not of consular rank, and of the best reputation. In this they showed a certain ability, for as it seemed to them if their plot failed they could escape suspicion by means of the reputation of their ambassador. The man they chose was called Maximin, and he fortunately chose as his secretary Priscus, the Sophist, to whose pen we are indebted for an account of all these things. He asserts, and probably with truth, that neither Maximin nor he himself was aware of the plot of assassination. They conceived themselves to be engaged in a serious mission and were the more impressed by its importance in that its terms were far less subservient to the Hun than had been the custom in recent times. Attila was told that henceforth he must not evade the obligations of his treaties nor invade at all the Imperial territories. And with regard to the fugitives he was informed that beside those already surrendered seventeen were now sent but that there were no more. So ran the letter. But Maximin was also to say that the Hun must look for no ambassador of higher rank than himself since it was not the Imperial custom towards the Barbarians; on the contrary, Rome was used to send to the North any soldier or messenger who happened to be available. And since he had now destroyed Sardica his proposal to meet there any ambassador of consular rank was merely insolent. If indeed the Hun wished to remove the differences between Theodosius and himself he should send Onegesius as ambassador. Onegesius was the chief minister of Attila.

Such were the two missions, the one official, the other secret, which set out together from Constantinople.

The great journey seems to have been almost wholly uneventful as far as Sardica, 350 miles from Constantinople, which was

reached after a fortnight of travel. They found that town terribly pillaged but not destroyed, and the Imperial embassy bought sheep and oxen, and having prepared dinner invited Edecon and his colleagues to share it with them, for they were still officially within the Empire. But within those ruins, even among the ambassadors, peace was impossible. Priscus records the ridiculous quarrel which followed. The Huns began to magnify the power of Attila,—was not his work around them? The Romans knowing the contents of the letter they bore sang the praises of the Emperor. Suddenly Vigilas, perhaps already drunk, asserted that it was not right to compare men with the gods, nor Attila with Theodosius, since Attila was but a man. Only the intervention of Maximin and Priscus prevented bloodshed, nor was harmony restored till Orestes and Edecon had received presents of silk and jewels. Even these gifts were not made altogether without an untoward incident. For Orestes in thanking Maximin exclaimed that he, Maximin, was not like those insolent courtiers of Constantinople “who gave presents and invitations to Edecon, but none to me.” And when Maximin, ignorant of the Chrysaphian plot, demanded explanations, Orestes angrily left him. Already the plan of assassination was beginning to fester.

The ambassadors went on from ruined Sardica to desolate Naissus (Nisch) utterly devoid of inhabitants, full only of horror and ruins. They crossed a plain sown with human bones whitening in the sun, and saw the only witness to the Hunnish massacre of the inhabitants—a vast cemetery. “We found,” Priscus tells us, “a clean place above the river where we camped and slept.”

Close to this ruined town was the Imperial army, commanded by Agintheus, under whose eagles five of the seventeen refugees to be surrendered had taken refuge. The Roman general, however, was obliged to give them up. Their terror as they went on in the ambassadorial train towards the Danube may well be imagined.

The great river at length came in sight; its approaches lined and crowded with Huns, the passages served by the Barbarians in dugouts, boats formed out of the hollowed trunks of trees. With these boats the whole Barbarian shore was littered as though in readiness for the advance of an army. Indeed, as it appeared Attila was in

camp close by, and intent on hunting within the Roman confines to the south of the river, a means certainly of reconnaissance as habitually used by the Huns as commerce has been for the same end by the Germans.

We do not know with what feelings Maximin and Priscus saw all this and crossed the great river frontier at last and passed into Barbary. To their great chagrin, for they had made the way easy for the Hunnish ambassadors on the road through the Imperial provinces, Edecon and Orestes now left them brusquely enough. For several days they went on alone but for the guides Edecon had left them, till one afternoon they were met by two horsemen who informed them that they were close to the camp of Attila who awaited them. And indeed upon the morrow they beheld from a hill-top the Barbarian tents spread out innumerable at their feet, and among them that of the King. They decided to camp there on the hill; but a troop of Huns at once rode up and ordered them to establish themselves in the plain. “What,” cried they, “will you dare to pitch your tents on the heights when that of Attila is below?”

They were scarce established in their appointed place when to their amazement Edecon and Orestes and others appeared and asked their business, the object of their embassy. The astonished ambassadors looked at one another in amaze. When the question was repeated Maximin announced that he could not disclose his mission to any other than Attila to whom he was accredited. Scotta, the brother of Onegesius, then announced angrily that Attila had sent them and they must have an answer. When Maximin again refused the Huns galloped away.

The Romans, however, were not left long in doubt of the reception they were to get. Scotta and his friends soon returned without Edecon, and to the further amazement of Maximin repeated word for word the contents of the Imperial letter to Attila. “Such,” said they, “is your commission. If this be all depart at once.” Maximin protested in vain. Nothing remained but to prepare for departure. Vigilas who knew what Chrysaphius expected was particularly furious; better have lied than to return without achieving anything, said he. What to do? It was already night. They were in the midst of Barbary, between

them and the Danube lay leagues of wild unfriendly country Suddenly as their servants loaded the beasts for their miserable journey other messengers arrived from the Hun. They might remain in their camp till dawn. In that uneasy night, had Vigilas been less of a fool, he must have guessed that Edecon had betrayed him.

It was not the barbarous Vigilas, however, who found a way out of the difficulty, for at dawn the command to depart was repeated, but that Priscus who has left us so vivid an account of this miserable affair. He it was who, seeing the disgrace of his patron, sought out Scotta, the brother of Onegesius, the chief minister of Attila, in the Hunnish camp. With him went Vigilas as interpreter, and so cleverly did the Sophist work upon the ambition of Scotta, pointing out to him not only the advantages of peace between the Huns and the Romans, but also the personal advantage Scotta would gain thereby in honour and presents, and at last feigning to doubt Scotta’s ability to achieve even so small a matter as the reception of the embassy that he had his way. Scotta rode off to see Attila, Priscus returned to his patron, and soon after Scotta returned to escort them to the royal tent.

The reception must have been a strange spectacle. The tent of Attila was quite surrounded by a multitude of guards; within, upon a stool of wood, was seated the great Hun. Priscus, Vigilas and the servants who attended them bearing the presents remained upon the threshold. Maximin alone went forward and gave into Attila’s hands the letter of Theodosius saying: “The Emperor wishes Attila and all that are his health and length of days.” “May the Romans receive all they desire for me,” replied the instructed Barbarian. And turning angrily to Vigilas he said: “Shameless beast, why hast thou dared to come hither knowing as thou dost the terms of peace I made with thee and Anatolius. Did I not then tell thee that I would receive no more ambassadors till all the refugees had been surrendered!” Vigilas replied that they brought seventeen fugitives with them and that now there remained no more within the Empire. This only made Attila more furious: “I would crucify thee and give thee as food for the vultures but for the laws regarding envoys,” cried he. As for the refugees, he declared there were many still within the

Empire, and bade his people read out their names, and this done he told Vigilas to depart with Eslas, one of his officers, to inform Theodosius that he must forthwith return all the fugitives who had entered the Empire from the time of Carpilio, son of Aetius, who had been his hostage. “I will never suffer,” said he, “that my slaves shall bear arms against me, useless though they be to aid those with whom they have found refuge.... What city or what fortress have they been able to defend when I have determined to take it?” When he had said these words he grew calmer; informed Maximin that the order of departure only concerned Vigilas, and prayed the ambassador to remain and await the reply to the letter of the Emperor. The audience closed with the presentation and acceptance of the Roman presents.

Vigilas must surely have guessed now what his dismissal meant. Perhaps, however, he was too conceited and too stupid to notice it. At any rate he did not enlighten his companions but professed himself stupefied by the change of Attila’s demeanour towards him. The whole affair was eagerly discussed in the Roman camp. Priscus suggested that Vigilas’ unfortunate indiscretion at Sardica had been reported to Attila and had enraged him. Maximin did not know what to think. While they were still debating Edecon appeared and took Vigilas apart. The Hun may well have thought he needed reassurance. He declared that he was still true to the plan of Chrysaphius. Moreover, seeing what a fool Vigilas was, he told him that his dismissal was a contrivance of his own to enable the interpreter to return to Constantinople and fetch the money promised, which could be introduced as necessary to the embassy for the purchase of goods. Vigilas, however, can scarcely have believed him, at any rate for long; a few hours later Attila sent word that none of the Romans were to be allowed to buy anything but the bare necessities of life from the Huns, neither horses, nor other beasts, nor slaves, nor to redeem captives. Vigilas departed with the order ringing in his ears, upon a mission he must have known to be hopeless.

Two days later Attila broke camp and set out for his capital, the Roman ambassadors following in his train under the direction of

guides appointed by the Hun They had not gone far on their way northward when they were directed to leave the train of Attila and to follow another route, because, they were told, the King was about to add one more to his innumerable wives, Escam, the daughter of a chief in a neighbouring village.

Very curious is Priscus’ description of the way followed by the patron and his embassy. They journeyed across the Hungarian plain, across horrible marshes and lakes which had to be traversed sometimes on rafts; they crossed three great rivers, the Drave, the Temes, and the Theiss in dug-outs, boats such as they had seen on the Danube hollowed out of the trunks of trees. They lived for the most part on millet which their guides brought or took from the wretched inhabitants, they drank mead and beer, and were utterly at the mercy of the weather, which was extremely bad. On one occasion, indeed, their camp was entirely destroyed by tempest, and had it not been for the hospitality of the widow of Bleda they would perhaps have perished.

For seven days they made their way into the heart of Hungary till they came to a village where their way joined the greater route by which Attila was coming. There they were forced to await the King, since they must follow and not precede him. It was in this place that they met another Roman embassy, that of the Emperor in the West, Valentinian III, who was quarrelling with Attila about the holy vessels of Sirmium. It seems that the Bishop of Sirmium in 441, seeing his city invested, had gathered his chalices and patens and plate, sacred vessels of his church, and had sent them secretly to a certain Constantius, a Gaul, at that time Attila’s minister. In case the city fell they were to be used as ransom, first of the Bishop, and in case of his death of any other captives. Constantius was, however, untrue to the trust placed in him by the Bishop, and sold or pawned the plate to a silversmith in Rome. Attila hearing of it when Constantius was beyond his reach claimed the booty as his own. It was upon this miserable business that Valentinian had sent an embassy to Attila from Ravenna.

It is certainly a shameful and an amazing spectacle we have here. In that little village of Barbary the ambassadors of the Emperors,

Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.