Wednesday, October 28, 2015

An Actual Guide to Accessing Google Datastore in PHP!

You've scoured the Internet, you've asked your friends, and you've complained about it for ages. Now, prepared to be stunned!

First off, let's give a quick run down of what Google Datastore (henceforth abbreviated as GDS) actually is. Google D... I mean GDS... is a SQL-ish database. It works very similarly, but there are a few key differences.

First, let's draw some parallels between the two. First off, GDS doesn't have databases. Instead, it has "namespaces", the default of which has no name. This can be useful to partition different applications within the same project. Next, GDS will not have tables, instead it will have "kinds" of  "objects". Objects are analogous to rows. Because each instance of an object can have or not have certain properties, it's more a object than a row. This guide assumes you understand all of these concepts. If you don't, I suggest glancing at the overview found at the Google Developer Site.

Now for the interesting stuff. How to actually use this. I use a great project that I found called "PHP-GDS" which is an adapter library to work with the Google API Client for PHP. The newest version at the time of this writing, 2.0 Beta, is leaps and bounds over the previous 1.x generation of the library. It uses Protocol Buffers to work with the datastore faster and more efficiently than before. The webpage says it isn't ready for production use, but quite frankly I've had fewer problems with version 2 with ProtoBuf than I did with the standard API use in 1.x versions.

Let's walk through how to configure PHP-GDS step by step.

Monday, October 19, 2015

Hello, World

Welcome to Undocumented Code!

What is Undocumented Code, you ask? Undocumented Code is a project I started in my free time to share what I've learned from messing with poorly documented code. I write a whole bunch of things ranging a wide variety of applications (Get it? Applications? Ha!) that some times requires the use of defunct libraries. I also have a very weird sense of humor. You'll get used to it I hope.

This isn't just for code, however. I'll write some things about software engineering and computer science maybe - who knows! I'll tag things appropriately, I promise, just in case you're not into that new fad that the kids these days are calling fun.

So yeah, that's Undocumented Code in a nutshell. As the blog evolves or becomes a waste of my time, we'll see where it goes. Because right now I have no idea. I just have some loose ideas at the moment.

Stay thirsty my friends.