Tratar o armazenamento de objetos na nuvem como um sistema de arquivos desperdiça seus melhores recursos
Multipart uploads inacabados continuam parados em um bucket, ocupando capacidade que alguém paga, e dez versões salvas de um documento de 5 MB ocupam 50 MB. Orit Wasserman, que trabalhou no armazenamento de objetos do Ceph na Red Hat e atendeu grandes clientes, já viu esse tipo de uso inadequado muitas vezes. Quais recursos nativos acabam com o desperdício automaticamente, e quais configurações evitam que dados na nuvem vazem?
Saiba quando usar multipart upload, versionamento, regras de ciclo de vida e configurações de segurança de buckets
Orit Wasserman, OpenShift Container Storage Architect na Red Hat, explica o que é armazenamento de objetos na nuvem e por que seu design plano e imutável se adequa à escala da nuvem. Com base em seu trabalho no desenvolvimento do armazenamento de objetos do Ceph, ela apresenta multipart upload, versionamento, regras de ciclo de vida e prefixos, e encerra com recomendações práticas de segurança e privacidade.
“Você não pode atualizar uma parte do objeto. Você o sobrescreve por completo.”
“E a mudança, o que mudou e tornou o armazenamento de objetos tão popular foi a nuvem.”
What you will learn
Explicar como o armazenamento de objetos difere do armazenamento em bloco e de arquivos: namespace plano, objetos imutáveis e metadados ricos.
Decidir quando usar multipart upload e verificar os limites dos SDKs para que objetos pequenos não o usem e objetos acima de 5 GB o usem.
Configurar regras de ciclo de vida para expirar versões antigas, limpar uploads incompletos e mover objetos não lidos para um nível de arquivamento.
Organizar objetos com prefixos para simular pastas e filtrar listagens de buckets.
Proteger buckets com HTTPS, criptografia no lado do cliente, nenhum bucket público e políticas de bucket e de usuário com privilégio mínimo.
Details
Level
Intermediate
Format
Talk
Technical depth
Practitioner
For
Early career, Mid-career, Senior individual contributor
Length
18:44
Published
June 2021
Questions this talk answers
O que diferencia o armazenamento de objetos do armazenamento em bloco e de arquivos?
O armazenamento de objetos usa um namespace plano de buckets que contêm objetos referenciados por nome, e os objetos são gravados por inteiro, sem atualizações parciais. Isso simplifica o gerenciamento, reduz custos e permite metadados de usuário ricos.
Quando o multipart upload deve ser usado, e quando não?
Use-o para objetos grandes, e sempre acima do limite de 5 GB para upload único, pois ele permite retomar, pausar e fazer uploads em paralelo. Evite-o para objetos pequenos, em que as requisições extras podem deixar a taxa de transferência até três vezes mais lenta.
Como evitar que o versionamento e uploads com falha desperdicem armazenamento?
Defina regras de ciclo de vida, por exemplo para excluir versões não atuais com mais de 30 dias e multipart uploads incompletos com mais de sete dias. Regras de tiering também podem mover para um arquivo objetos não lidos há um ano.
O armazenamento de objetos pode ter pastas?
Não nativamente, mas prefixos adicionados às chaves dos objetos simulam uma hierarquia. Listar um bucket com um prefixo retorna apenas os objetos sob esse prefixo.
Como manter os dados no armazenamento de objetos na nuvem seguros e privados?
Use HTTPS, use criptografia no lado do cliente com suas próprias chaves ou um sistema de gerenciamento de chaves, nunca use buckets públicos e conceda o acesso mais limitado possível com políticas de bucket e de usuário.
O que diferencia o armazenamento de objetos (90 s)
Como o multipart upload salva uploads grandes (80 s)
Pare de vazar dados de buckets na nuvem (79 s)
Speaker 1: Hello, everyone. Welcome to storing your data in the cloud, doing it right. Today, I'm going to introduce you to Optics Storage, the right way to store data in the cloud. I'm Orit Wasserman. I'm a senior principal software engineer at Red Hat. Speaker 1: I have been developing software for many, many years already, and I'm almost half of my career in open source. I love low level programming and especially storage and being working on different storage systems distributed for me in quite a while.
Speaker 1: In the last few years, I'm focusing on Ceph, which is a social defined storage, completely open source. And of course, it provides also object storage, also block and file. Speaker 1: And today, I'm an OpenShift Data Foundation architect at Red Hat. OpenShift Data Foundation provides persistent data services for containers application running in OpenShift. Speaker 1: It is Red Hat platform as a service infrastructure for the hybrid cloud based on Kubernetes. And I'm from Israel if anyone interested working from home even before COVID.
Speaker 1: So today, I want to introduce you to object storage. I want to tell you what's special about it and why it's such a good fit to the cloud. Speaker 1: Then go very cool, unique feature it has that make it even perfect, more perfect for the cloud. Speaker 1: And as we are talking about cloud, we also have to have a section about security and privacy.
Speaker 1: So storage is. Speaker 1: Is a very important infrastructure been around for quite a while. This is actually the evolution and. Speaker 1: And now in today's cloud era, it's even is transformed even more. Speaker 1: And usually when we talked about storage, we would divide it to block storage or file system storage. Speaker 1: And but now today we also have a new kind of storage called object storage. So why do we need this first type?
Speaker 1: So basically what happened is that we create so much data set a scale data actually it's not. Speaker 1: As you see, it's like 1,300 extra bite which is actually it's at the bite and it scores exponentially, which means that we need different kind of storage system to store the data. Speaker 1: And it can be very, very scalable and also be cost effective because it's also quite expensive to store storage data and block storage and file system.
Speaker 1: I've inherited limitation that make it harder. So that's why there is the carrying the object storage. Speaker 1: So what is object storage? It's first of all, it's a flat namespace. Speaker 1: We have buckets buckets contain objects and we reference object by name. Speaker 1: So so it's bucket. So if you still bucket, you want to, if it's an object, you tell this bucket and that object name, but a bucket cannot contain another bucket.
Speaker 1: Unlike with file system, the directories can have other directories inside. We are talking about flat namespace. Speaker 1: This limitation helps with reducing the cost of the storage and make the management much, much more easier for the storage. Speaker 1: The second difference from files is that objects are immutable. Speaker 1: What do you mean immutable? I don't mean that objects cannot change and be updated, but the way we have them.
Speaker 1: Then them is as one entity. You cannot update a part of the object. You overwrite it completely. Speaker 1: You can of course read whatever part of the object, read read, whatever you want, but when you write an object, it's always the full object. Speaker 1: And because it's much easier to manage the storage with object storage, we can add very rich metadata to the object and better access control, but also user metadata.
Speaker 1: So how I'm as a user of object storage can store my metadata on the object. Speaker 1: And we can see example where it can help us. It can helps with analytics, with searching, search of object and so on. Speaker 1: Object storage has been around for a while. People don't know, but from the middle of the nineties, it's quite a while, but it didn't break out.
Speaker 1: It was like a niche, EMC at Sentera, which provided, they call it content addressable storage, but that was it. Speaker 1: And the change, what changed and made object storage so popular is the cloud. In 2006, AWS announced their cloud service, EC2, Elastic Compute Cloud, and a storage service that comes with it called S3. Speaker 1: Simple storage service, and I really like that. And S3 is object storage. Object storage with one addition that is very important.
Speaker 1: All the access to the storage, all the management is done with Westfall API. Speaker 1: It means that API is always by using an HTTP request, which is perfect for the cloud because in cloud, we always have lots of service all around. Speaker 1: Usually all our access are remote and HTTP makes it easier. It's quite easy to use HTTP to access a remote server or remote storage.
Speaker 1: You don't need to do it. So the firewalls are open. Everything is standard, standard networks and much, much easier than the storage protocols. Speaker 1: And today, object storage is dominating the cloud. Of course, AWS S3, which is huge. Every big cloud vendor has its own object storage, Google Cloud Storage, for example, as low storage and so on.
Speaker 1: And on premise, we have staff that also provide S3-compatible object storage. Speaker 1: And I noticed I want to use DigitalOcean because DigitalOcean are using safe to provide cloud object storage as well. Speaker 1: So that's a little exam of uses of object storage. So the classical, as we say, is photos. So if you think about photos are nature immutable.
Speaker 1: Because of the format of photos, even if we just edit the photo, let's say rotate, we have to form to write the photo as one unit. Speaker 1: You never write parts of the photo. So objectoid is classical for photos. This is Flickr. Speaker 1: I don't know what's going on Flickr. It used to be our, but I don't know. I always use Flickr because they use F as well.
Speaker 1: So here in Flickr, we have albums. Album is a bucket. And of course, it's photo is a different object. Speaker 1: So our first problem is uploading the photos to the cloud. Photos are growing actually bigger. We have better cameras on the phone. Speaker 1: So when we upload the photo in the cloud, it's very annoying if we have some network or some other problem and we need to upload them again.
Speaker 1: And also, it's not always photos. Sometimes we want a video. Those are even bigger. So we need a different way to upload the photos, the object to the cloud. And object storage has what we call multi-part upload to solve the problem. Speaker 1: So multi-part upload with the name. We take the big object and we cut it into parts and we upload each part separately.
Speaker 1: It's a transaction based protocol. First of all, you have an init command. You go to the object storage, tell him, I want to update this object. Give it the name and you can tell him how many parts and parts sides, but you don't have to. And the object storage will return and upload ID. Speaker 1: You need to use it all keep it. And then we upload each part separately and without correct upload ID. And when we are done, we send the complete command and only then the object will be created on the object storage and visible them.
Speaker 1: So now when I upload it for a big object, first of all, in case I have a network problem, Speaker 1: All the parts that were already successfully uploaded will be there. Speaker 1: Then I also can parallelize the upload, getting much better network throughput, much shorter time to upload. I can pause and resume object. So for example, for my phone, I only upload photos when I'm Wi-Fi area. So if I go out of the Wi-Fi area, that would Speaker 2: I will pause and when I go back, it will continue from the last part that I still didn't upload.
Speaker 1: You can upload an object. You don't know the actual, the final size, for example, when you stream video and you can use it as a transaction instead of what you use, which file system rename. Speaker 1: But there are some pitfalls from using a multi-power upload. First of all, Speaker 1: You need that to make, to understand the performance instead of one request, we have free. So if the object is small, you want to make sure that you actually don't use multiple upload Speaker 1: Because it can get up to three times slower throughput. And also if you use regular upload, you should know that the object size is limited to five giga. So always for object larger than five giga, you should use multiple upload, which is limited by five.
Speaker 1: Luckily, when we use S3, we have lots of frameworks and SDKs that can handle all those for us. And you just need to make sure that the defaults are set correctly and the threshold to using multiple upload is correct. Speaker 1: Another problem we have is, is what happens if I never complete the upload, I'm storing the parts in the storage. So I'm using capacity and actually paying for it, but it's a waste.
Speaker 1: We call those our friend uploads and those needs to be sealed up. I can do it manually. And later in the presentation, I'm going to present you how you can do it automatically. Speaker 1: Let's look at another example of documents. So first, it seems that documents are not a good fit for object storage because documents are actually very immutable. You've changed them a lot in all, in every part.
Speaker 1: But as they are relatively not large and the updates are infrequent, you're in frequency and slow compared to computers, they actually are a good fit. Speaker 1: And when object storage adds to documents, which is a very important feature, as you can see here, I can keep version from the document. So if I did a mistake and I will get back, I can go to the search and get an older version.
Speaker 1: So what happens if I don't specify which version I want to read, I'll always read with the current version, the latest, but I can specify the version ID and get an old version. If I want to, I can revert to it. Speaker 1: So basically, versioning is a bucket feature. You enable it per bucket. And then you'll get every time you overwrite an object, it won't be the old data.
Speaker 1: The old data won't be deleted, but the new version is added. As you can see, one problem here is that it uses lots of space. So if I have a document, it's five mega usually. If I have 10 version of it, I'm using 50 mega. That's a lot. Speaker 1: So what we need to do to remember when we use versioning is to delete the old version that I don't, no longer need. So we free up space.
Speaker 1: Sadly, I don't remember to do anything, but here the object storage help us. Speaker 1: And you can see this is an example from drive. The older version are only kept for 30 days. The object storage will delete them for us. This is, I think, with the best feature object storage has. And it's called life cycle.
Speaker 1: Life cycle and life cycle. You can configure a world on the object that the object storage and when the condition met the object storage will execute the rules. You have two types of transitions. Speaker 1: One is expiration deleting the data and one is to moving the object. So for example, with expiration, I can tell the storage, I want to delete all the versions that are not current version, but are older than 30 days. This is one kind of rule. The other kind of rule, I can say, I don't want to, I want to delete all the multi-par uploads that haven't completed for a week, for seven days. This will clean all of Speaker 1: Failed multiple upload ahead and clean the space automatically without any need of my involvement.
Speaker 1: And usually Turing is used for archiving. I can say any object that wasn't read for the last year should be moved to the archive as it's not used. It's a very cool feature. I think it's very useful. Speaker 1: And an example I said we are flat namespace, but you can actually have a much complex hierarchy. For example, here you are for the one containing for the true that content for the free. You can do it in object storage.
Speaker 1: And this is with what it's called in a free prefix prefix is basically a key, a metadata key that you can add to an object. Speaker 1: So for example, an object that time for the one will have prefix prefix slash for the one object for the two will ever prefix slash for the one slash for the two and so on.
Speaker 1: And when we do a listing of a bucket with the prefix, you'll get only the object that specified this prefix. Speaker 1: So if I want to see only the object in for the two, I will give that prefix to the listing and get them. Speaker 1: As we are in the cloud, it's very important to make sure your data is secure and to keep it in private.
Speaker 1: I've sadly seen many MS configuration that made the data public. Speaker 1: So first of all, use HTTP unless it's your own private network or you have VPN. Speaker 1: Sadly, it's not default. Speaker 1: I wish they would do that, but make sure HTTPS transport is encrypted. Speaker 1: Next, next, the storage itself always encrypt the data when it gets the data.
Speaker 1: This is service side encryption, but that's not good for your privacy. Speaker 1: Object storage has client side encryption, meaning the data is already encrypted in the SDK basically. Speaker 1: And even before it gets to the network actually. Speaker 1: And when the storage gets it, it's already encrypted this way. Speaker 1: The storage provider can erase your data.
Speaker 1: You have two types of keys. Speaker 1: You can provide your keys or use the key management system. Speaker 1: Another thing, we have access control for bucket. Speaker 1: And one of the default, but it's not default, one of the options public bucket. Speaker 1: Please don't use public buckets. Speaker 1: There are lots of leaks every few months of public buckets.
Speaker 1: Today, AWS actually can warn you if you have such buckets. Speaker 1: So we have lots of granularity of access control to buckets and object. Speaker 1: Sadly, I don't have time to go over them. Speaker 1: Please use them and try to use the most limited access you can. Speaker 1: And we have new, we have bucket and user policy to allow you much better granularity.
Speaker 1: For example, you can share bucket between user and you can give read only for anonymous user. Speaker 1: You can restrict for specific IP or MAC address. Speaker 1: So presenting you today object storage. Speaker 1: It's designed for the scale of the cloud and its unique features make it perfect to the cloud and it can help you to develop much better application for the cloud.
Speaker 1: But to use the feature, please use the storage, the APIs and not use it as a file system as that will, won't allow you to use features like versioning or lifecycle and so on. Speaker 1: We are in the cloud. Speaker 1: Make sure your data is safe and it's private. Speaker 1: And if you use a private cloud, please use safe Windows Gateway for your object storage.
Speaker 1: Feel free to pin for question in the, I assume will be the conference chat that is set. Speaker 1: And always like thank you. Speaker 1: Thank you.
Transcribed automatically; names checked against the speaker record. Select a time to jump there.
Article based on this talk
Por que o armazenamento de objetos na nuvem funciona melhor quando você para de tratá-lo como um sistema de arquivos
Orit Wasserman, arquiteta de armazenamento da Red Hat, explica os recursos de armazenamento de objetos que a maioria das equipes não usa e os erros de segurança que expõem dados.
Em resumo
O armazenamento de objetos na nuvem, como o Amazon S3, foi projetado para a escala da nuvem, e seu verdadeiro valor está em recursos como multipart upload, versionamento e regras de ciclo de vida. Orit Wasserman argumenta que as equipes só obtêm esses benefícios quando usam diretamente as APIs de armazenamento de objetos, e não uma camada de sistema de arquivos, e quando restringem o acesso e aplicam criptografia. Com base em seu trabalho no desenvolvimento do armazenamento de objetos do Ceph, ela compartilha as boas e más práticas que observou com grandes clientes.
Principais aprendizados
O que é armazenamento de objetos na nuvem
Quando e como usar armazenamento de objetos na nuvem
Os recursos especiais do armazenamento de objetos na nuvem
O que é armazenamento de objetos e por que a nuvem o tornou popular
Wasserman começa explicando que o armazenamento tradicionalmente se divide em armazenamento em bloco e de arquivos, mas o enorme volume de dados criado hoje exige algo mais escalável e econômico. O armazenamento de objetos responde a isso com um design deliberadamente simples: um namespace plano em que buckets contêm objetos, objetos são referenciados por nome e um bucket não pode conter outro bucket.
"Essa limitação ajuda a reduzir o custo do armazenamento e torna o gerenciamento muito, muito mais fácil para o armazenamento." (3:36)
A segunda diferença é a imutabilidade. Objetos ainda podem ser substituídos, mas nunca alterados parcialmente: "Você não pode atualizar uma parte do objeto. Você o sobrescreve por completo." (4:05) Como o gerenciamento é mais simples, o armazenamento de objetos também pode conter metadados ricos, incluindo metadados de usuário que ajudam em análises e buscas.
Wasserman observa que o armazenamento de objetos existe desde meados dos anos 1990, citando o EMC Centera, mas permaneceu um nicho até a AWS lançar o EC2 e o S3 em 2006. "E a mudança, o que mudou e tornou o armazenamento de objetos tão popular foi a nuvem." (5:03) O acréscimo decisivo foi uma API RESTful baseada em HTTP, que funciona em redes padrão e atravessa firewalls abertos, ideal quando todo acesso é remoto. Hoje todos os grandes provedores de nuvem oferecem armazenamento de objetos, e o Ceph fornece armazenamento de objetos compatível com S3 on-premises.
Upload de objetos grandes com multipart upload
Usando álbuns de fotos como exemplo, em que um álbum é um bucket e cada foto um objeto, Wasserman aborda um problema comum: uploads grandes que falham no meio. O multipart upload divide um objeto grande em partes enviadas separadamente dentro de uma transação. Um comando init retorna um upload ID, cada parte é enviada com esse ID e um comando complete torna o objeto visível.
Os benefícios são reais: as partes já enviadas sobrevivem a falhas de rede, os uploads podem ser feitos em paralelo para melhor taxa de transferência e podem ser pausados e retomados, por exemplo enviando apenas via Wi-Fi. Também funciona quando o tamanho final é desconhecido, como em streaming de vídeo.
Há também armadilhas. Para objetos pequenos, as requisições extras podem deixar a taxa de transferência até três vezes mais lenta, segundo a palestrante, enquanto uploads comuns são limitados a 5 GB, então objetos maiores precisam usar multipart upload. "Felizmente, quando usamos o S3, temos muitos frameworks e SDKs que cuidam de tudo isso para nós." (10:39) Seu conselho é verificar se os padrões e o limite de multipart estão configurados corretamente. Uploads que nunca são concluídos deixam partes órfãs que consomem capacidade pela qual você paga.
Versionamento e regras de ciclo de vida
Documentos parecem pouco adequados a objetos imutáveis, mas, por serem relativamente pequenos e atualizados com pouca frequência, funcionam bem, especialmente com versionamento. Ativado por bucket, o versionamento preserva os dados antigos sempre que um objeto é sobrescrito, então um erro pode ser desfeito lendo ou revertendo para um version ID anterior. O custo é espaço: dez versões de um documento de 5 MB ocupam 50 MB.
"Infelizmente, eu não me lembro de fazer nada, mas aqui o armazenamento de objetos nos ajuda." (13:03) As regras de ciclo de vida, que Wasserman considera um dos melhores recursos do armazenamento de objetos, permitem que o armazenamento aja automaticamente quando certas condições são atendidas. Regras de expiração podem excluir versões não atuais com mais de 30 dias ou remover multipart uploads não concluídos em sete dias. Regras de transição cuidam do tiering: "Posso dizer que qualquer objeto que não foi lido no último ano deve ser movido para o arquivo, já que não está sendo usado." (14:19)
Ela também mostra como os prefixos recriam uma hierarquia semelhante a pastas dentro do namespace plano. Cada objeto tem um prefixo, como o caminho de uma pasta, e listar um bucket com esse prefixo retorna apenas os objetos correspondentes.
Mantendo os dados seguros e privados
Wasserman já viu muitas configurações incorretas que tornaram dados públicos. Suas recomendações são diretas. Use HTTPS, a menos que você esteja em sua própria rede privada ou VPN, já que ele não é o padrão. A criptografia no lado do servidor protege os dados armazenados, mas, para privacidade, ela recomenda a criptografia no lado do cliente, em que o SDK criptografa os dados antes que cheguem à rede, usando suas próprias chaves ou um sistema de gerenciamento de chaves.
Sobre controle de acesso, ela é enfática: "Por favor, não usem buckets públicos." (16:37) Ela observa que vazamentos de buckets públicos acontecem a cada poucos meses e que a AWS agora pode alertar sobre eles. Controles de acesso granulares, políticas de bucket e políticas de usuário permitem compartilhamento entre usuários, acesso anônimo somente leitura ou restrições por endereço IP. "Por favor, usem esses recursos e tentem usar o acesso mais limitado possível." (17:00)
Use as APIs, não uma camada de sistema de arquivos
Sua mensagem final amarra a palestra. O armazenamento de objetos foi projetado para a escala da nuvem, e seus recursos exclusivos ajudam as equipes a criar aplicações em nuvem melhores, mas só se forem usados. "Mas para usar o recurso, por favor, usem o armazenamento, as APIs, e não o usem como sistema de arquivos, pois isso vai, não vai permitir usar recursos como versionamento ou ciclo de vida e assim por diante." (17:57) Para nuvens privadas, ela recomenda o Ceph RADOS Gateway para armazenamento de objetos.
Assista à palestra
"Storing your data in the cloud: doing it right", de Orit Wasserman, 19 minutos: https://www.womentech.net/video/storing-your-data-in-cloud-doing-it-right
Sobre a palestrante
Orit Wasserman é OpenShift Container Storage Architect na Red Hat, com foco em armazenamento para contêineres, nuvem híbrida, multicloud e edge. Engenheira de software experiente e apaixonada por open source e infraestrutura, ela trabalhou anteriormente na Red Hat no armazenamento de objetos do Ceph (Ceph Rados Gateway) e em live migration para KVM/QEMU, e desenvolveu virtualização aninhada para KVM no IBM Research Labs.
Perguntas que esta palestra responde
O que diferencia o armazenamento de objetos do armazenamento em bloco e de arquivos?
Quando o multipart upload deve ser usado, e quando não?
Como evitar que o versionamento e uploads com falha desperdicem armazenamento?
O armazenamento de objetos pode ter pastas?
Como manter os dados no armazenamento de objetos na nuvem seguros e privados?
Rascunho gerado com IA a partir da transcrição da palestra. Revisão editorial pendente.
Resources mentioned
Ceph RADOS Gateway (recommended for private cloud object storage)
Cite this talk
Orit Wasserman. "Storing your data in the cloud: doing it right." WomenTech Network, 2021. https://www.womentech.net/video/storing-your-data-in-cloud-doing-it-right