These two have always kind of puzzled me, since they don't seem to have followed the standard paths of European national genesis. They never really had independent states to speak of, don't have significant linguistic or religious differences from their neighbours, and have spent most of the last millennium split between various neighbouring powers. They just seem to have popped out of nowhere from the 1917 Russian Revolution, but still manage to have strong national identities and traditions. How did that happen?
Both were part of Polish-Lithuanian Commonwealth for a long time.
But before that Ukraine, whose name was Rus (Kiev Rus) was the largest Kingdom of the Medieval Europe.
There is a book by a Yale History Pro. Timothy Snyder "The reconstruction of the nations"
There is also a Harvard Professor Serhii Plokhy book "Ukraine: the Gates of Europe". Quick overview of Ukraine history can be found in this book: https://www.goodreads.com/book/show/39995949-ukraine-the-united-states